text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# This script is an example of how you can run blender from the command line (in background mode with no interface)
# to automate tasks, in this example it creates a text object, camera and light, then renders and/or saves it.
# This example also shows how you can parse command line options to python scripts.
#
# Examp... | ivanamihalek/blender | old/bgjob.py | Python | gpl-2.0 | 3,413 | 0.033402 |
# channels.py -- OpenChange RPC-over-HTTP implementation
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Julien Kerihuel <j.kerihuel@openchange.org>
# Wolfgang Sourdeau <wsourdeau@inverse.ca>
# Enrique J. Hernández <ejhernandez@zentyal.com>
#
# This program is free... | Zentyal/openchange | mapiproxy/services/web/rpcproxy/rpcproxy/channels.py | Python | gpl-3.0 | 23,946 | 0.000752 |
#!/usr/bin/env python3
import struct
class Rom(object):
def __init__(self):
self.romData = []
def load(self, path):
file = open(path, 'rb')
while True:
byte = file.read(1)
if not byte:
break
self.romData.append(ord(byte))
| ZaoLahma/PyCHIP-8 | rom.py | Python | mit | 308 | 0.003247 |
#!/usr/bin/env python
import dockci.commands
from dockci.server import APP, app_init, MANAGER
if __name__ == "__main__":
app_init()
MANAGER.run()
| sprucedev/DockCI | manage.py | Python | isc | 157 | 0 |
from .decorators import raml_optional, raml_simple_parse, raml_tabbed
from .RamlBody import RamlBody
from .RamlParseable import RamlParseable
class RamlResponse(RamlParseable):
def __init__(self, code, yaml):
self.code = code
super(RamlResponse, self).__init__(yaml)
@raml_optional
@raml_... | SandyChapman/ramlizer | ramlizer/RamlResponse.py | Python | mit | 907 | 0 |
from corecat.constants import OBJECT_CODES, MODEL_VERSION
from ._sqlalchemy import Base, CoreCatBaseMixin
from ._sqlalchemy import Column, \
Integer, \
String, Text
class Project(CoreCatBaseMixin, Base):
"""Project Model class represent for the 'projects' table
which is used to store project's basic i... | DanceCats/CoreCat | corecat/models/project.py | Python | mit | 1,533 | 0 |
from .layer import Layer
from ..activation import Activation
import numpy as np
class Particle2Dipole(object):
"""
Dipole approximated as 2 coupled charges of equal magnitude, uncoupled
"""
def __init__(self, input_size=0, output_size=0, activation="sigmoid", k_bond=1.0, k_eq=0.1, s=1.0, cut=10.0,
... | awlange/brainsparks | src/calrissian/layers/particle2_dipole.py | Python | mit | 4,517 | 0.000221 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | addition-it-solutions/project-all | addons/document/content_index.py | Python | agpl-3.0 | 6,555 | 0.005034 |
import logging
import json
import usi
import usi.systemc
class SoCR_StreamHandler(logging.StreamHandler): # Inherit from StreamHandler
def __init__(self, stream=None):
logging.StreamHandler.__init__(self)
def emit(self, record):
if "message_type" in record.__dict__:
recor... | hlange/LogSoCR | pysc/usi/log/socr_streamhandler/handler.py | Python | agpl-3.0 | 770 | 0.011688 |
# -*- coding: utf-8 -*-
"""
|oauth1| Providers
--------------------
Providers which implement the |oauth1|_ protocol.
.. autosummary::
OAuth1
Bitbucket
Flickr
Meetup
Plurk
Twitter
Tumblr
UbuntuOne
Vimeo
Xero
Xing
Yahoo
"""
import abc
import binascii
import datetime
i... | jasco/authomatic | authomatic/providers/oauth1.py | Python | mit | 38,859 | 0 |
# -*- coding: utf-8 -*-
''' Define functions for transforming encoded values
.. moduleauthor:: David Marteau <david.marteau@mappy.com>
'''
from .utils import signum
from .constants import (BIT24FACTOR_REVERSED,
DECA_MICRO_DEG_FACTOR,
BEARING_SECTOR,
... | Mappy/PyLR | pylr/values.py | Python | apache-2.0 | 3,453 | 0.003475 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## ... | PXke/invenio | invenio/modules/search/testsuite/test_search_external_collections_getter.py | Python | gpl-2.0 | 2,766 | 0.007954 |
# Copyright (C) 2013-2016 2ndQuadrant Italia Srl
#
# This file is part of Barman.
#
# Barman 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 ver... | hareevs/pgbarman | tests/test_infofile.py | Python | gpl-3.0 | 19,981 | 0 |
"""
mweigert@mpi-cbg.de
"""
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
from biobeam.simlsm.simlsm import SimLSM_Base
from six.moves import range
class SimLSM_DSLM(SimLSM_Base):
def _prepare_u0_illum(self, zfoc):
self.u0_illum = self._bpm_illum.u0_be... | maweigert/biobeam | biobeam/simlsm/sim_dslm.py | Python | bsd-3-clause | 3,286 | 0.025867 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | yannrouillard/weboob | modules/regionsjob/__init__.py | Python | agpl-3.0 | 805 | 0 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding SortedM2M table for field groups on 'Person'
db.create_table(u'... | Venturi/cms | env/lib/python2.7/site-packages/aldryn_people/south_migrations/0021_auto_person_groups.py | Python | gpl-2.0 | 15,722 | 0.007696 |
class Solution(object):
def minSubArrayLen(self, s, nums):
"""
:type s: int
:type nums: List[int]
:rtype: int
"""
MAX_INT = 2 ** 31 - 1
if not nums or len(nums) == 0:
return 0
i = j = n_sum = 0
min_len = MAX_INT
while j < ... | ChuanleiGuo/AlgorithmsPlayground | LeetCodeSolutions/python/209_Minimum_Size_Subarray_Sum.py | Python | mit | 564 | 0 |
"""Describe logbook events."""
from homeassistant.core import callback
from .const import DOMAIN, EVENT_COMMAND_RECEIVED, SOURCE_CLOUD
COMMON_COMMAND_PREFIX = "action.devices.commands."
@callback
def async_describe_events(hass, async_describe_event):
"""Describe logbook events."""
@callback
def async_d... | lukas-hetzenecker/home-assistant | homeassistant/components/google_assistant/logbook.py | Python | apache-2.0 | 992 | 0.002016 |
"""
Support for the Locative platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.locative/
"""
import asyncio
from functools import partial
import logging
from homeassistant.const import (
ATTR_LATITUDE, ATTR_LONGITUDE, STATE_NOT... | persandstrom/home-assistant | homeassistant/components/device_tracker/locative.py | Python | apache-2.0 | 4,098 | 0 |
KEYWORDS = ['resin', ]
def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
return False | nanshihui/PocCollect | middileware/resin/__init__.py | Python | mit | 123 | 0.073171 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# format keyshort in sublime text2: ctrl+shift+alt+t
# powered by SublimePythonTidy
__author__ = 'lwz'
from WebElements.Display import Label
from WebElements.Layout import Horizontal
from WebElements.DOM import Div, Img
from uiwiget import CompleteDom, RoundCornerPanel, Cus... | lwz7512/logtoeye | dashboard/reportor.py | Python | apache-2.0 | 9,877 | 0.000405 |
##############################################################################
# Copyright 2016-2019 Rigetti Computing
#
# 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... | rigetticomputing/pyquil | pyquil/latex/latex_generation.py | Python | apache-2.0 | 1,266 | 0.00158 |
from .types import InstallableFiles
| FrodeSolheim/fs-uae-launcher | fsgamesys/files/installablefiles.py | Python | gpl-2.0 | 36 | 0 |
from dvc.prompt import confirm
def test_confirm_in_tty_if_stdin_is_closed(mocker):
mock_input = mocker.patch("dvc.prompt.input", side_effect=EOFError)
mock_isatty = mocker.patch("sys.stdout.isatty", return_value=True)
ret = confirm("message")
mock_isatty.assert_called()
mock_input.assert_called()
... | dmpetrov/dataversioncontrol | tests/unit/test_prompt.py | Python | apache-2.0 | 339 | 0 |
"""
Platform for Ecobee Thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.ecobee/
"""
import logging
from os import path
import voluptuous as vol
from homeassistant.components import ecobee
from homeassistant.components.climate import... | betrisey/home-assistant | homeassistant/components/climate/ecobee.py | Python | mit | 9,405 | 0 |
#!/usr/bin/env python
#
# Copyright (c) 2011 Canonical Ltd.
#
# This file is part of: SST (selenium-simple-test)
# https://launchpad.net/selenium-simple-test
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... | ktan2020/legacy-automation | win/Lib/site-packages/sst/__init__.py | Python | mit | 1,057 | 0.000946 |
"""
This file is part of Maml.
Maml 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.
Maml is distributed in the hope tha... | brianhawthorne/maml | maml/test/test_parser.py | Python | gpl-3.0 | 2,468 | 0.002431 |
""" Capturing and analyzing the box information
Author: Lyu Yaopengfei
Date: 23-May-2016
"""
import cv2
import threading
import time
from PIL import Image
import Lego.dsOperation as dso
import Lego.imgPreprocessing as imgprep
from Lego.ocr import tesserOcr
capImg = None
resImg = None
stopFlat = 0
lock = ... | sotondriver/Lego_classification | src/boxCap.py | Python | mit | 6,567 | 0.014314 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from holmes.validators.base import Validator
from holmes.utils import _
class MetaTagsValidator(Validator):
@classmethod
def get_violation_definitions(cls):
return {
'absent.metatags': {
'title': _('Meta tags not present'),
... | holmes-app/holmes-api | holmes/validators/meta_tags.py | Python | mit | 2,813 | 0.000355 |
# -*- coding: utf-8 -*-
import scrapy
import requests
from PIL import Image
from scrapy_splash import SplashRequest
class OpenLawSpider(scrapy.Spider):
name = 'test_splash'
allowed_domains = ['openlaw.cn']
start_urls = [
'http://openlaw.cn/search/judgement/court?zoneName=%E5%8C%97%E4%BA%AC%E5%B8%8... | Shoufu/Scrapy-Openlaw | openlaw/spiders/test_splash.py | Python | mit | 538 | 0.001859 |
#
# Copyright (c) SAS Institute 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 w... | sassoftware/jobslave | jobslave_test/keytest.py | Python | apache-2.0 | 5,039 | 0.00258 |
from flask import jsonify, request
from radar.api.serializers.nurture_tubes import OptionSerializer, SamplesSerializer
from radar.api.views.common import (
PatientObjectDetailView,
PatientObjectListView,
)
from radar.api.views.generics import ListModelView
from radar.database import db
from radar.exceptions im... | renalreg/radar | radar/api/views/nurture_tubes.py | Python | agpl-3.0 | 1,651 | 0.002423 |
#!/home/toppatch/Python-2.7.5/bin/python2.7
"""An RFC 2821 smtp proxy.
Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
Options:
--nosetuid
-n
This program generally tries to setuid `nobody', unless this flag is
set. The setuid call will fail if this program is not ... | vFense/vFenseAgent-nix | agent/deps/rpm6/Python-2.7.5/bin/smtpd.py | Python | lgpl-3.0 | 18,564 | 0.000431 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) All Rights Reserved.
# Pedro Tarrafeta <pedro@acysos.com>
# Copyright (c) 2008 Pablo Roc... | jmesteve/openerpseda | openerp/addons/l10n_es_payment_order/wizard/csb_19.py | Python | agpl-3.0 | 13,523 | 0.007848 |
#!/usr/bin/env python
#
# gst-python
# Copyright (C) 2005 Andy Wingo <wingo@pobox.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your op... | offlinehacker/flumotion | tests/checks.py | Python | gpl-2.0 | 5,092 | 0.002749 |
"""Functions and script for problems in HW2
For problem 3:
--------------
class oblate:
provides the mechanics for calulating the desired orbital values from an
initilized object of a given mass, radius, and moments.
function problem_3():
function to output results using the oblate class on given scenarios
... | justincely/classwork | UMD/AST630/HW2/hw2.py | Python | bsd-3-clause | 4,890 | 0.008793 |
# pylint: disable=invalid-name, protected-access
# pylint: disable=no-member, missing-docstring, not-callable
from __future__ import absolute_import
import ctypes
from ..base import _LIB, check_call, c_str
from ..node_generic import _set_class_node_base
from .types import TVMValue, TypeCode
from .types import RETURN_S... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/python/tvm/_ffi/_ctypes/node.py | Python | apache-2.0 | 2,777 | 0.00144 |
"""A module for handling and accessing both the in-memory, and on-disk,
representation of a set of routes as a set of segments. Where each segment
specifies its start and end stop ids, and other data (see
topology_shapefile_data_model.py for more."""
import sys
import csv
import re
import operator
import itertools
i... | PatSunter/SimpleGTFSCreator | route_segs.py | Python | lgpl-3.0 | 52,470 | 0.003774 |
#! /usr/bin/env python
"""
A __main__ namespace for the primer package.
"""
from __future__ import print_function
import sys
import argparse
from time import time
from primer import primes
def main(argv):
"""Call primes when the package is run as a script."""
parser = argparse.ArgumentParser(
prog=... | cbcunc/primer | primer/__main__.py | Python | gpl-2.0 | 1,218 | 0 |
'''
Demonstrate repeating textures
==============================
This was a test to fix an issue with repeating texture and window reloading.
'''
from kivy.app import App
from kivy.uix.image import Image
from kivy.properties import ObjectProperty
from kivy.lang import Builder
kv = '''
FloatLayout:
canvas.before... | JulienMcJay/eclock | windows/kivy/examples/canvas/repeat_texture.py | Python | gpl-2.0 | 827 | 0.001209 |
from __future__ import unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from html5lib.constants import tokenTypes
from html5lib.sanitizer import HTMLSanitizerMixin
from html5lib.tokenizer import HTMLTokenizer
PROTOS = HTMLSanitizerMixin.acceptable_protocols
PROTOS.remove('feed')
class Bleac... | marcdm/bleach | bleach/sanitizer.py | Python | bsd-3-clause | 6,574 | 0.00502 |
from tkp.accessors.dataaccessor import RequiredAttributesMetaclass
class LofarAccessor(object):
__metaclass__ = RequiredAttributesMetaclass
"""
Additional metadata required for processing LOFAR images through QC
checks.
Attributes:
antenna_set (string): Antenna set in use during observati... | transientskp/tkp | tkp/accessors/lofaraccessor.py | Python | bsd-2-clause | 886 | 0 |
'''Fairly basic set of tools for real-time data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
'''
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import re
from scipy import linalg
import scipy.ndimag... | kemaswill/keras | keras/preprocessing/image.py | Python | mit | 25,315 | 0.001659 |
# Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
import multiprocessing
import time
from .. import log; log = log[__name__]
from .. import QROOT
from ..io import root_open, DoesNotExist
from ..utils.extras import humanize_byt... | henryiii/rootpy | rootpy/tree/chain.py | Python | gpl-3.0 | 10,795 | 0.000093 |
# Copyright 2010 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... | scripnichenko/nova | nova/tests/unit/api/openstack/test_common.py | Python | apache-2.0 | 26,175 | 0.00042 |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.autograd as autograd
import torchvision.datasets as dset
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torchvision.utils import save_image
import numpy as np
clas... | pianomania/infoGAN-pytorch | trainer.py | Python | mit | 4,627 | 0.007348 |
"""Support for MQTT message handling."""
import asyncio
from functools import partial, wraps
import inspect
from itertools import groupby
import json
import logging
from operator import attrgetter
import os
import ssl
from typing import Any, Callable, List, Optional, Union
import attr
import certifi
import voluptuous ... | nkgilley/home-assistant | homeassistant/components/mqtt/__init__.py | Python | apache-2.0 | 44,531 | 0.001011 |
import matplotlib.pyplot as pl
import numpy as np
import math
from matplotlib.collections import LineCollection
from matplotlib.colors import colorConverter
def plot(X, m, x_star, t, z_t):
fig = pl.figure(figsize=(10,10))
# Draw the grid first
ax = pl.axes()
ax.set_xlim(-4,20)
ax.set_ylim(-4,20)... | mufid/berkilau | ws/CSUIBotClass2014/util/plotter2.py | Python | mit | 1,816 | 0.010463 |
from yangson.datamodel import DataModel
from yangson.instance import InstanceRoute
module_dir = "../yang-data/"
yang_library_file = "../yang-data/yang-library-data.json"
with open(yang_library_file) as ylfile:
yl = ylfile.read()
dm = DataModel(yl, [module_dir])
with open("data.json", "rt") as fp:
json_data ... | kimjinyong/i2nsf-framework | Hackathon-105/jetconf/tests/test_yangson.py | Python | apache-2.0 | 1,077 | 0.001857 |
from rllab.algos.nop import NOP
from rllab.baselines.zero_baseline import ZeroBaseline
from rllab.envs.box2d.cartpole_env import CartpoleEnv
from rllab.envs.normalized_env import normalize
from rllab.policies.uniform_control_policy import UniformControlPolicy
env = normalize(CartpoleEnv())
policy = UniformControlPoli... | brain-research/mirage-rl-qprop | examples/nop_cartpole.py | Python | mit | 665 | 0.001504 |
from ..utils import ApiUtil
from ..utils.ApiUtil import Url
class BlueprintHistories:
def __init__(self, code, auth_token, blueprint_id):
self.code = code
self.auth_token = auth_token
self.blueprint_id = blueprint_id
url = Url.blueprintHistoriesList(self.blueprint_id, Url.url)
... | cloudconductor/cloud_conductor_gui | gui_app/api_models/blueprint_histories.py | Python | apache-2.0 | 762 | 0 |
default_app_config = 'jobs.apps.JobConfig'
| SeiryuZ/HemeWeb | src/jobs/__init__.py | Python | lgpl-3.0 | 43 | 0 |
# This file is subject to the terms and conditions defined in
# file 'LICENSE', which is part of this source code package.
# Copyright (c) 2009 SKR Farms (P) LTD.
# -*- coding: utf-8 -*-
from pygments.lexer import RegexLexer
from pygments.token import *
try :
from tayra.lexer import TTLLexer
except :
... | prataprc/eazytext | eazytext/extension/ttlpygment.py | Python | gpl-3.0 | 3,677 | 0.032363 |
# Copyright 2013-2015 DataStax, 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 writi... | bbirand/python-driver | tests/integration/standard/test_prepared_statements.py | Python | apache-2.0 | 13,413 | 0.001342 |
# Copyright (c) 2004-2016 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
"""diagram objects
"""
import astroid
from pylint.pyreverse.... | bgris/ODL_bgris | lib/python3.5/site-packages/pylint/pyreverse/diagrams.py | Python | gpl-3.0 | 8,634 | 0.001042 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | SUSE/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_sku.py | Python | mit | 1,696 | 0 |
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import *
from unittest import TestCase
try:
from i2p.crypto import crypto
except ImportError:
crypto = None
from i2p import datatypes
if crypto is not None:
DSA_ELGAMAL_KEY_CERT = b'BQAEAAAAAA=='
DSA_ELG... | majestrate/i2p.socket | i2p/test/test_datatypes.py | Python | mit | 8,496 | 0.003296 |
#!/usr/local/bin/python
# -- coding: utf-8 --
#
# Subroutine defs inspired by http://nltk.org/book/
# -- gene at ology dot net not dot com
#
# Import functionality.
from __future__ import division
import nltk
def generate_model(cfdist, word, num=15):
for i in range(num):
print word,
word = cfdist... | ology/NLTK-Study | Defs.py | Python | artistic-2.0 | 1,971 | 0.006088 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import platform
import shutil
import subprocess
import sys
import tempfile
import unittest
import zipfile
from telemetry.util impo... | guorendong/iridium-browser-ubuntu | tools/telemetry/telemetry/util/find_dependencies_unittest.py | Python | bsd-3-clause | 2,648 | 0.007931 |
import os
dir = os.path.dirname(os.path.realpath(__file__))
class BaseConfig(object):
SECRET_KEY = "SO_SECURE"
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = True
class TestConfig(object):
SECRET_KEY = "SO_SECURE"
TESTING = True
DEBUG = ... | Pseudonick47/sherlock | backend/config.py | Python | gpl-3.0 | 428 | 0.007009 |
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///../instance/pa-hotness.db' | Code4SA/pa-hotness | instance/config.py | Python | apache-2.0 | 76 | 0.013158 |
"""The template component."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
import logging
from homeassistant import config as conf_util
from homeassistant.const import (
CONF_UNIQUE_ID,
EVENT_HOMEASSISTANT_START,
SERVICE_RELOAD,
)
from homeassistant.core import Co... | rohitranjan1991/home-assistant | homeassistant/components/template/__init__.py | Python | mit | 5,547 | 0.000721 |
# -*- coding: utf-8 -*-
import os
import sys
from formalchemy.i18n import get_translator
from formalchemy import helpers
from formalchemy.helpers import literal
from tempita import Template as _TempitaTemplate
class TempitaTemplate(_TempitaTemplate):
default_encoding = None
try:
from mako.lookup import TemplateL... | FormAlchemy/formalchemy | formalchemy/templates.py | Python | mit | 4,638 | 0.004743 |
import unittest
class TestLogTrace(unittest.TestCase):
def test_log_trace(self):
# self.assertEqual(expected, log_trace(errmsg))
assert True # TODO: implement your test here
class TestLogErrmsg(unittest.TestCase):
def test_log_errmsg(self):
# self.assertEqual(expected, log_errmsg(errms... | GhostshipSoftware/avaloria | src/tests/test_utils_logger.py | Python | bsd-3-clause | 979 | 0.011236 |
#
# 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... | irinabov/debian-qpid-dispatch | tests/router_engine_test.py | Python | apache-2.0 | 27,299 | 0.009194 |
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import re
from PyQt5.QtCore import Qt, pyqtSlot
from PyQt5.QtWidgets import (
QPushButton,
QLineEdit... | arsenetar/dupeguru | qt/exclude_list_dialog.py | Python | gpl-3.0 | 7,359 | 0.002582 |
# -*- coding: utf-8 -*-
'''
Created on May 15, 2015
@author: chenchen9
'''
import json
import lazyxml
import tornado.web
from manager.TestcaseManager import TestcaseManager
class QueueController(tornado.web.RequestHandler):
def get(self):
queue_size = TestcaseManager().get_size()
queue_list = Tes... | five3/wireless-testing-platform | wtp/controller/QueueController.py | Python | gpl-2.0 | 1,894 | 0.00528 |
"""
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
# Python, ctypes and types dependencies.
import re
from ctypes import addressof, byref, c_double, c_size_t
from types import UnicodeType
# GEOS-related dependencies.
from django.contrib.gis.geos.coordseq impo... | weigj/django-multidb | django/contrib/gis/geos/base.py | Python | bsd-3-clause | 21,337 | 0.003749 |
#! /usr/bin/env python
"""
Get status and output of any command, capable of handling unicode.
"""
import subprocess
import codecs
from tempfiles import *
tmp = TempFiles()
def getstatusoutput(cmd):
logname = tmp.getTempFileName()
log = codecs.open(logname, mode="w", encoding="utf-8", errors="replace", buff... | ajaybhatia/archlinux-dotfiles | Scripts/pythonscripts/subprocess_extensions.py | Python | mit | 760 | 0.007895 |
from disco.core import Disco, result_iterator
from disco.settings import DiscoSettings
from disco.func import chain_reader
from discodex.objects import DataSet
from freequery.document import docparse
from freequery.document.docset import Docset
from freequery.index.tf_idf import TfIdf
class IndexJob(object):
def... | sqs/freequery | freequery/index/job.py | Python | agpl-3.0 | 1,947 | 0.002054 |
"""
Testing frame work for Wrapping Textures
Written by Zachary Ferguson
"""
from __future__ import print_function
import scipy.sparse
import scipy.sparse.linalg
import numpy
import pdb
from recordclass import recordclass
import includes
import bilerp_energy as energy
import seam_gradient
from seam_intervals impo... | zfergus2/Wrapping-Textures | tests/energy_tests/energy_test.py | Python | mit | 7,271 | 0.006602 |
class Solution:
def diStringMatch(self, S: 'str') -> 'List[int]':
ret = []
left = 0
right = len(S)
for i in range(0, len(S)):
if S[i] == 'I':
ret.append(left)
left += 1
else:
ret.append(right)
rig... | MingfeiPan/leetcode | math/942.py | Python | apache-2.0 | 381 | 0.002625 |
import uuid
import numpy as np
from ..data_utils import is_pandas_df, has_geo_interface, records_from_geo_interface
from .json_tools import JSONMixin, camel_and_lower
from pydeck.types import Image
from pydeck.exceptions import BinaryTransportException
TYPE_IDENTIFIER = "@@type"
FUNCTION_IDENTIFIER = "@@="
QUOTE_C... | uber-common/deck.gl | bindings/pydeck/pydeck/bindings/layer.py | Python | mit | 6,775 | 0.001919 |
from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import *
from future.utils import with_metaclass
import copy
import types
import wizzat.decorators
from wizzat.pghelper import *
from wizzat.util import set_defaults
__all__ = [
'DBTable',
'DBTableError',
'D... | wizzat/wizzat.py | wizzat/dbtable.py | Python | mit | 13,346 | 0.011389 |
# -*- coding: utf-8 -*-
#Copyright (C) Fiz Vazquez vud1@sindominio.net
# Modified by dgranda
#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 your option) ... | pytrainer/pytrainer | plugins/garmintools/garmintools.py | Python | gpl-2.0 | 4,768 | 0.027475 |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... | drinkertea/pywinauto | pywinauto/handleprops.py | Python | bsd-3-clause | 14,767 | 0.002302 |
from __future__ import absolute_import
from __future__ import division
import os, traceback, math, re, zlib, base64, time, sys, platform, glob, string, stat
import cPickle as pickle
if sys.version_info[0] < 3:
import ConfigParser
else:
import configparser as ConfigParser
from Cura.util import resources
from Cura.ut... | tinkerinestudio/Tinkerine-Suite | TinkerineSuite/Cura/util/profile2.py | Python | agpl-3.0 | 23,092 | 0.027239 |
"""add seen tables
Revision ID: 48a75abc0121
Revises: 35513370ba0d
Create Date: 2020-09-15 22:34:50.116403
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "48a75abc0121"
down_revision = "35513370ba0d"
branch_labels = None
depends_on = None
def upgrade():
... | conorsch/securedrop | securedrop/alembic/versions/48a75abc0121_add_seen_tables.py | Python | agpl-3.0 | 1,840 | 0 |
#!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# 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 a... | whitepyro/debian_server_setup | tornado/netutil.py | Python | gpl-3.0 | 17,330 | 0.000404 |
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
# 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
#
# ... | bswartz/cinder | cinder/volume/drivers/huawei/huawei_driver.py | Python | apache-2.0 | 97,319 | 0 |
from django.conf.urls import patterns, url
from django.views.generic import RedirectView
from . import views
APP_SLUGS = {
'chrono': 'Chrono',
'face_value': 'Face_Value',
'podcasts': 'Podcasts',
'roller': 'Roller',
'webfighter': 'Webfighter',
'generalnotes': 'General_Notes',
'rtcamera': '... | andymckay/zamboni | mkt/ecosystem/urls.py | Python | bsd-3-clause | 4,853 | 0.000824 |
#!/usr/bin/python
#
# Copyright 2016 Canonical Ltd
#
# 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 agr... | konono/equlipse | openstack-install/charm/trusty/charm-keystone/hooks/manager.py | Python | mit | 11,385 | 0 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | marmyshev/item_title | openlp/plugins/songs/lib/songimport.py | Python | gpl-2.0 | 15,903 | 0.001698 |
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
date_range,
)
import pandas._testing as tm
class TestTZLocalize:
# See also:
# test_tz_convert_and_localize in test_tz_convert
def test_tz_localize(self, frame_or_series):
rng = date_range("1/1/2011", periods=10... | pandas-dev/pandas | pandas/tests/frame/methods/test_tz_localize.py | Python | bsd-3-clause | 2,050 | 0.000488 |
from flask import Blueprint, render_template
# 利用 Blueprint建立 ag1, 並且 url 前綴為 /ag1, 並設定 template 存放目錄
ag6 = Blueprint('ag6', __name__, url_prefix='/ag6', template_folder='templates')
# 展示傳回 Brython 程式
@ag6.route('/a40323152')
def task1():
outstring = '''
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
... | 40323155/2016springcd_aG6 | users/a/g6/ag6.py | Python | agpl-3.0 | 14,459 | 0.006189 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
================================================================================
mingus - Music theory Python package, Instrument module
Copyright (C) 2008-2009, Bart Spaans
This program is free software: you can redistribute it and/or modify
it under the... | edudobay/mingus | mingus/containers/Instrument.py | Python | gpl-3.0 | 7,067 | 0.001415 |
import os
import peru.runtime as runtime
import shared
class RuntimeTest(shared.PeruTest):
def test_find_peru_file(self):
test_dir = shared.create_dir({
'a/find_me': 'junk',
'a/b/c/junk': 'junk',
})
result = runtime.find_project_file(
os.path.join(test... | oconnor663/peru | tests/test_runtime.py | Python | mit | 466 | 0 |
import json
import sys
from controller.framework.ControllerModule import ControllerModule
import controller.framework.ipoplib as ipoplib
class TincanDispatcher(ControllerModule):
def __init__(self, CFxHandle, paramDict):
super(TincanDispatcher, self).__init__()
self.CFxHandle = CFxHandle
... | kyuhojeong/controllers | controller/modules/svpn/TincanDispatcher.py | Python | mit | 6,334 | 0.000316 |
#
#
# Copyright (C) 2007, 2011 Google Inc.
#
# 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 your option) any later version.
#
# This program is distri... | ekohl/ganeti | qa/qa_config.py | Python | gpl-2.0 | 3,219 | 0.013669 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-01 19:47
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
depen... | othreecodes/MY-RIDE | broadcast/migrations/0001_initial.py | Python | mit | 1,998 | 0.003504 |
# Copyright (c) 2009 Canonical Ltd <duncan.mcgreggor@canonical.com>
# Licenced under the txaws licence available at /LICENSE in the txaws source.
from twisted.trial.unittest import TestCase
from txaws.exception import AWSError
from txaws.exception import AWSResponseParseError
from txaws.util import XML
REQUEST_ID =... | lud4ik/txAWS | txaws/tests/test_exception.py | Python | mit | 4,188 | 0 |
# Copyright (c) 2018 Kevin Weiss, for HAW Hamburg <kevin.weiss@haw-hamburg.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
"""@package PyToAPI
This module handles parsing of information from RI... | lazytech-org/RIOT | tests/periph_uart/tests/periph_uart_if.py | Python | lgpl-2.1 | 1,079 | 0 |
# -*- coding: utf-8 -*-
"""
* Copyright (c) 2017 SUSE LLC
*
* openATTIC 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 2.
*
* This package is distributed in the hope that it will be useful... | openattic/openattic | backend/volumes/migrations/0002_remove.py | Python | gpl-2.0 | 5,838 | 0.001884 |
"""
Copyright (C) 2014 Delft University of Technology, The Netherlands
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 lat... | jkokorian/ODMAnalysis | odmanalysis/scripts/ViewCyclesInteractive.py | Python | gpl-3.0 | 3,813 | 0.012851 |
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 Foundation, either version 3 of the
# License, or (at your op... | ofer43211/unisubs | apps/teams/search_indexes.py | Python | agpl-3.0 | 6,266 | 0.001596 |
from charms.reactive import Endpoint, when
class TestAltProvides(Endpoint):
invocations = []
@when('endpoint.{endpoint_name}.joined')
def handle_joined(self):
self.invocations.append('joined: {}'.format(self.endpoint_name))
@when('endpoint.{endpoint_name}.changed')
def handle_changed(sel... | juju-solutions/charms.reactive | tests/data/reactive/relations/test-alt/provides.py | Python | apache-2.0 | 561 | 0 |
# -*- coding: utf-8 -*-
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Viewer
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Viewers.Viewer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.s... | Ledoux/ShareYourSystem | Pythonlogy/ShareYourSystem/Standards/Viewers/Texter/__init__.py | Python | mit | 2,100 | 0.045238 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Yan Yan'
'''
Deployment toolkit.
'''
import os, re
from datetime import datetime
from fabric.api import *
env.user = 'michael'
env.sudo_user = 'root'
env.hosts = ['192.168.0.3']
db_user = 'www-data'
db_password = 'www-data'
_TAR_FILE = 'dist-awesome.tar... | Byronic94/py-blog | fabfile.py | Python | gpl-2.0 | 5,473 | 0.00676 |
# -*- coding: utf-8 -*-
##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# ... | andrewkaufman/gaffer | python/GafferSceneUI/CameraUI.py | Python | bsd-3-clause | 15,659 | 0.026968 |
from .fields import CharArrayField, TextArrayField, IntegerArrayField
| aino/django-arrayfields | arrayfields/__init__.py | Python | bsd-3-clause | 70 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.