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 file is part of Buildbot. Buildbot 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 program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | anish/buildbot | master/buildbot/test/unit/test_reporters_utils.py | Python | gpl-2.0 | 8,181 | 0.001834 |
# -*- coding: utf-8 -*-
#
# 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 writing, software
... | zack3241/incubator-airflow | airflow/contrib/hooks/redshift_hook.py | Python | apache-2.0 | 4,181 | 0.001196 |
import asyncio
import time
import psycopg2
import psycopg2.pool
import os
import sys
class Database:
def __init__(self):
loop = asyncio.get_event_loop()
loop.run_until_complete(self.init_connection())
@asyncio.coroutine
def init_connection(self):
result = 1
loop_end =... | STOP2/stop2.0-backend | src/db.py | Python | mit | 4,799 | 0.004168 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/_subscriptions_operations.py | Python | mit | 12,046 | 0.004649 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/cluster_upgrade_description_object.py | Python | mit | 5,840 | 0.00137 |
'''
restlite: REST + Python + JSON + XML + SQLite + authentication.
http://code.google.com/p/restlite
Copyright (c) 2009, Kundan Singh, kundan10@gmail.com. All rights reserved.
License: released under LGPL (Lesser GNU Public License).
This light-weight module allows quick prototyping of web services using the... | lbovet/platane | restlite.py | Python | lgpl-3.0 | 29,388 | 0.010617 |
import smbus, sys
import time
bus = smbus.SMBus(1)
# i2c address
address = 0x04
if len(sys.argv) < 3:
print -1
sys.exit()
cmd = sys.argv[1]
msg = sys.argv[2]
msAr = []
for x in msg:
msAr.append(ord(x))
def writeNumber():
#bus.write_byte(address, value)
bus.write_i2c_block_data(address,ord(cmd)... | a2ron44/alfredHomeAutomation | alfredPHP/controller.py | Python | gpl-3.0 | 539 | 0.012987 |
# encoding=utf-8
import sqlalchemy
from sqlalchemy.engine import create_engine
from sqlalchemy.pool import SingletonThreadPool
from terroroftinytown.tracker.model import Session, Base
class Database(object):
def __init__(self, path, delete_everything=False):
if path.startswith('sqlite:'):
sel... | hugovk/terroroftinytown | terroroftinytown/tracker/database.py | Python | mit | 992 | 0 |
import os
CACHE_TYPE = os.environ.get('CACHE_TYPE', 'redis').strip()
if CACHE_TYPE == 'redis':
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': os.environ.get('CACHE_URL', 'redis://redis:6379/1').strip(),
'OPTIONS': {
'CLIE... | astrobin/astrobin | astrobin/settings/components/caches.py | Python | agpl-3.0 | 824 | 0.002427 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import mrp_document
from . import mrp_abstract_workorder
from . import res_config_settings
from . import mrp_bom
from . import mrp_routing
from . import mrp_workcenter
from . import mrp_production
from . import st... | t3dev/odoo | addons/mrp/models/__init__.py | Python | gpl-3.0 | 608 | 0 |
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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... | helldorado/ansible | test/units/modules/network/f5/test_bigiq_device_facts.py | Python | gpl-3.0 | 3,123 | 0.00064 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-securitycenter | google/cloud/securitycenter_v1p1beta1/types/source.py | Python | apache-2.0 | 2,762 | 0.000362 |
# Copyright 2013 IBM Corp.
#
# 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 t... | ntymtsiv/tempest | tempest/api/compute/v3/admin/test_servers.py | Python | apache-2.0 | 7,222 | 0 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2008 Lukáš Lalinský
# Copyright (C) 2013, 2018-2021 Laurent Monin
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2018-2019 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it under... | metabrainz/picard | picard/formats/mutagenext/tak.py | Python | gpl-2.0 | 2,426 | 0.000825 |
# -*- coding: utf-8 -*-
'''
Torrenter v2 plugin for XBMC/Kodi
Copyright (C) 2012-2015 Vadim Skorba v1 - DiMartino v2
https://forums.tvaddons.ag/addon-releases/29224-torrenter-v2.html
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Li... | chimkentec/KodiMODo_rep | plugin.video.torrenter/Localization.py | Python | gpl-3.0 | 56,942 | 0.008658 |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from sympy import log, exp, Symbol, Pow, sin
from sympy.printing.ccode import ccode
from sympy.codegen.cfunctions import log2, exp2, expm1, log1p
from sympy.codegen.rewriting import (
optimize, log2_opt, exp2_opt, expm1_opt,... | wxgeo/geophar | wxgeometrie/sympy/codegen/tests/test_rewriting.py | Python | gpl-2.0 | 4,843 | 0.000413 |
# Copyright 2014-2015 Isotoma Limited
#
# 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 wr... | mitchellrj/touchdown | touchdown/aws/cloudfront/streaming_distribution.py | Python | apache-2.0 | 6,002 | 0.001666 |
"""
homeassistant.components.script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scripts are a sequence of actions that can be triggered manually
by the user or automatically based upon automation events, etc.
"""
import logging
from datetime import timedelta
import homeassistant.util.dt as date_util
import threading
from homeas... | michaelarnauts/home-assistant | homeassistant/components/script.py | Python | mit | 5,105 | 0 |
#!/usr/bin/python
from planetlab.model import *
from users import user_list
# NOTE: The legacy network remap is used to re-order the automatically
# generated, sequential list of ipaddresses to a legacy order to preserve
# pre-existing slice-and-IP assignments. Otherwise, slices would be assigned
# to new IPs,... | m-lab/operator | plsync/sites.py | Python | apache-2.0 | 25,116 | 0.01067 |
# coding=utf-8
# 项目反应理论中的等级反应模型
from __future__ import division, print_function, unicode_literals
from psy import Grm, data
scores = data['lsat.dat']
grm = Grm(scores=scores)
print(grm.em())
| inuyasha2012/pypsy | demo/demo_grm.py | Python | mit | 220 | 0 |
# Definition for an interval.
class Interval:
def __init__(self, s=0, e=0):
self.start = s
self.end = e
class Solution:
def eraseOverlapIntervals(self, intervals):
"""
:type intervals: List[Interval]
:rtype: int
"""
if not intervals:
return 0... | feigaochn/leetcode | p435_non_overlapping_intervals.py | Python | mit | 823 | 0 |
from django import forms
from django.utils.translation import ugettext_lazy as _
from django_summernote.widgets import SummernoteInplaceWidget
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from .models import Speaker, Program
class EmailLoginForm(forms.Form):
email = forms.Emai... | pythonkr/pyconkr-2014 | pyconkr/forms.py | Python | mit | 1,760 | 0 |
from django.db import models
from django.core.exceptions import MultipleObjectsReturned
from expedient.clearinghouse.aggregate.models import Aggregate
from expedient.common.permissions.shortcuts import must_have_permission
from vt_plugin.models.VM import VM
# Virtualization Plugin class
class VtPlugin(Aggregate):
... | dana-i2cat/felix | expedient/src/python/plugins/vt_plugin/models/VtPlugin.py | Python | apache-2.0 | 3,112 | 0.008676 |
#!/usr/bin/env python
"""Script to split a large mediawiki file into multiple files, by header."""
import sys
import re
import os
ADD_TOC = True # Add TOC everywhere?
def usage():
print "Usage: [scriptname] [infilename]"
if len(sys.argv) != 2:
usage()
exit()
filename_in = sys.argv[1]
if '.' in filename... | brandonheller/mediawiki_to_gollum | split_by_headers.py | Python | bsd-3-clause | 2,218 | 0.002705 |
from flask import Flask, request, jsonify, abort
import os
import requests
app = Flask(__name__)
app.debug = os.getenv('DEBUG', '') == 'True'
def access_token():
return os.getenv('ACCESS_TOKEN', '')
def check_user_id(user_id):
if user_id not in os.getenv('USER_IDS', ''):
return abort(403)
def check_user_nam... | cyrilkyburz/bhwi_proxy | bhwi_proxy.py | Python | mit | 1,516 | 0.019789 |
#!/usr/bin/env python
#
# Copyright 2013, 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 opti... | hamgravy/volk-fft | python/volk_fft_modtool/cfg.py | Python | gpl-3.0 | 3,621 | 0.005523 |
import sys, os, time, atexit
from signal import SIGTERM, SIGKILL
class Daemon:
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
self.stdin = stdin
self.stdout = stdout
self... | marshallflax/NVDARemoteServer | daemon.py | Python | gpl-2.0 | 3,540 | 0.051695 |
"""pilvi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | prawn-cake/pilvi | pilvi/urls.py | Python | mit | 762 | 0 |
import os, shutil
if not os.path.isdir('Bin'):
os.mkdir('Bin')
if not os.path.isdir('Temp'):
os.mkdir('Temp')
| cprogrammer1994/Python-ComputeShader | Prepare.py | Python | gpl-3.0 | 121 | 0.024793 |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# Sandesh Logger
#
import logging
import logging.config
import logging.handlers
from gen_py.sandesh.ttypes import SandeshLevel
import sandesh_base_logger
import util
def create_logger(generator, logger_class, logger_config_file=None):
l_cl... | toabctl/contrail-sandesh | library/python/pysandesh/sandesh_logger.py | Python | apache-2.0 | 6,516 | 0 |
# -*- coding: utf-8 -*-
from libqtile.manager import Key, Click, Drag, Screen, Group
from libqtile.command import lazy
from libqtile import layout, bar, widget, hook
from libqtile import xcbq
xcbq.keysyms["XF86AudioRaiseVolume"] = 0x1008ff13
xcbq.keysyms["XF86AudioLowerVolume"] = 0x1008ff11
xcbq.keysyms["XF86AudioMute... | andrelaszlo/qtile | examples/config/tailhook-config.py | Python | mit | 6,113 | 0.003278 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Requests/Messages/CollectDailyDefenderBonusMessage.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import mes... | Mickey32111/pogom | pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/CollectDailyDefenderBonusMessage_pb2.py | Python | mit | 2,108 | 0.010436 |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado import netutil
from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str
from tornado import gen
from tornado.http1connection import HTTP1Connection
from tornado... | mr-ping/tornado | tornado/test/httpserver_test.py | Python | apache-2.0 | 41,934 | 0.000501 |
import sys
# widgets
class Button:
"""
Represents button
Keyword arguments:
text -- button text
| str
onclick -- function invoked after pressing the button
| function: Button -> void
Attributes:
wide -- makes the button wide
"""
def __new__(cl... | klausweiss/python-aui | aui/widgets.py | Python | bsd-2-clause | 4,207 | 0.000475 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 ~ 2012 Deepin, Inc.
# 2011 ~ 2012 Wang Yong
#
# Author: Wang Yong <lazycat.manatee@gmail.com>
# Maintainer: Wang Yong <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the... | linuxdeepin/deepin-ui | dtk/ui/cycle_strip.py | Python | gpl-3.0 | 2,087 | 0.001917 |
from django.conf.urls.defaults import *
from .views import *
urlpatterns = patterns('',
url(r'^signup/$',
view=SignupLoginView.as_view(
featured_form_mixin_class=SignupMultipleFormMixin),
name='accounts_signup'
),
url(r'^login/$',
view=SignupLoginView.as_view(
... | mfogel/django-signup-login | signup_login/urls.py | Python | bsd-3-clause | 1,287 | 0.006993 |
# import the ERPXE core API
import core
# Global variables
TFTPBOOT_DIR = "/tftpboot"
PLUGINS_DIR = TFTPBOOT_DIR + "/er/plugins"
# try to Load configuration from file system or use defaults
def load_configuration():
# try to fetch configuration from file
try:
config = core.get_configuration()
exce... | ERPXE/erpxe | erpxe/cli.py | Python | gpl-3.0 | 2,519 | 0.030171 |
"""URLs to run the tests."""
try:
from django.urls import include
except ImportError:
from django.conf.urls import include
from django.conf.urls import url
from django.contrib import admin
admin.autodiscover()
urlpatterns = (
url(r'^admin/', admin.site.urls),
url(r'^status', include('server_status.url... | mitodl/django-server-status | server_status/tests/urls.py | Python | agpl-3.0 | 328 | 0 |
"""Represent a mood on the gateway."""
from .const import ROOT_MOODS
from .resource import ApiResource
class Mood(ApiResource):
def __init__(self, raw, parent):
super().__init__(raw)
self._parent = parent
@property
def path(self):
return [ROOT_MOODS, self._parent, self.id]
de... | r41d/pytradfri | pytradfri/mood.py | Python | mit | 383 | 0 |
import asyncio
import sys
from abc import ABC, abstractmethod
from collections.abc import Iterable, Sized
PY_35 = sys.version_info >= (3, 5)
class AbstractRouter(ABC):
def __init__(self):
self._frozen = False
def post_init(self, app):
"""Post init stage.
Not an abstract method for ... | juliatem/aiohttp | aiohttp/abc.py | Python | apache-2.0 | 3,396 | 0 |
from port_range import PortRange
pr = PortRange('1027/15')
print(pr.bounds)
pr = PortRange('4242-42')
print(pr)
| VRaviTheja/SDN-policy | testing/testing_portrange.py | Python | apache-2.0 | 112 | 0 |
#!/usr/bin/env python
import sys
import optparse
import socket
import random
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
if sys.platform == 'win32':
HEADER... | nootropics/propane | propane.py | Python | mit | 3,698 | 0.027853 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... | stuart-knock/tvb-framework | tvb/core/code_versions/code_update_scripts/4750_update_code.py | Python | gpl-2.0 | 2,378 | 0.006728 |
from Gaudi.Configuration import *
from Configurables import DaVinci
#from Configurables import AlgTool
from Configurables import GaudiSequencer
MySequencer = GaudiSequencer('Sequence')
#For 2012 MC
DaVinci.DDDBtag='dddb-20130929-1'
DaVinci.CondDBtag='sim-20130522-1-vc-md100'
#for 2011 MC
#DaVinci.DDDBtag='dddb-2013092... | Williams224/davinci-scripts | ksteta3pi/NTupleMaker_MagDown.py | Python | mit | 17,928 | 0.01863 |
# -*- coding: utf-8 -*-
from itertools import product, imap
import copy
import math
import string
import multiprocessing
import platform
import numpy as np
import pandas as pd
from pandas.tools.plotting import radviz
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import ColorConverte... | chrisjsewell/PyGauss | pygauss/analysis.py | Python | gpl-3.0 | 44,913 | 0.00993 |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 13 23:10:40 2016
@author: zhouyu
"""
#%%
import pandas as pd
import numpy as np
import os
import re
import nltk
from nltk.corpus import stopwords
from bs4 import BeautifulSoup
os.chdir('/Users/zhouyu/Documents/Zhou_Yu/DS/kaggle_challenge/text processing')
#%% step1: impor... | sadahanu/DataScience_SideProject | Stack_Exchange/py2_text.py | Python | mit | 7,689 | 0.017167 |
#!/usr/bin/python
import time
class Recorder(object):
debug = 0
def __init__(self):
self.recordings = []
self.lastRecord = 0
if Recorder.debug:
print("init Recorder")
def record(self):
now = time.time();
if self.lastRecord != 0:
self.reco... | detman/stomplooper | recorder.py | Python | gpl-3.0 | 646 | 0.010836 |
import re
from django import template
from django.conf import settings
from django.template import TemplateSyntaxError
from django.template.base import FilterExpression
from django.template.defaulttags import URLNode
from django.utils.encoding import iri_to_uri, smart_str
from django.urls import set_urlconf, get_urlco... | jezdez/django-hosts | django_hosts/templatetags/hosts.py | Python | bsd-3-clause | 5,070 | 0 |
# -*- coding: utf-8 -*-
"""test_replay."""
import os
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
exp_replay_file_name = os.path.join('foo', 'bar.json')
assert replay.get_file... | luzfcb/cookiecutter | tests/replay/test_replay.py | Python | bsd-3-clause | 2,207 | 0 |
"""
A collection of Xentica models and experiments.
Indended to illustrate how to use the framework.
"""
| a5kin/hecate | examples/__init__.py | Python | mit | 107 | 0 |
import hashlib
def hash_list():
return str(hashlib.algorithms_guaranteed)
def hash_text(algorithm_array, text, pass_count):
result_dict = {}
# Type checking
if type(pass_count) is not int:
return [False, {"error": "Pass count should be of 'integer' type."}]
elif type(text) is not str:
... | tykkz/hasherapp | algorithm.py | Python | mit | 1,194 | 0.002513 |
#!/usr/bin/env python
import tester
tester.make(["--input='./result/standard'", "--output='./result/out'", "--standard", "--cores=1"]) | ONLYOFFICE/core | Test/Applications/StandardTester/tester/scripts/generate.py | Python | agpl-3.0 | 134 | 0.014925 |
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2013 by Łukasz Mierzwa
:contact: l.mierzwa@gmail.com
"""
from __future__ import unicode_literals
import logging
from inspect import ismethod
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.encoding import ... | prymitive/bootstrap-breadcrumbs | django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py | Python | mit | 7,292 | 0 |
#!/usr/bin/env python3
from auto.config import DIR, RV32_LINUX
from auto.gnu_toolchain import GnuToolchain
from auto.utils import cat, cd, path, shell
import auto.pkg
import os
class LLVM(auto.pkg.Package):
def _prepare(self):
link = path(DIR.submodules, "llvm/tools/clang")
if not os.path.exist... | OpenISA/riscv-sbt | scripts/auto/llvm.py | Python | mit | 3,402 | 0.004409 |
"""Support for OVO Energy sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from datetime import datetime, timedelta
from typing import Final
from ovoenergy import OVODailyUsage
from ovoenergy.ovoenergy import OVOEnergy
from homeassistant.components... | rohitranjan1991/home-assistant | homeassistant/components/ovo_energy/sensor.py | Python | mit | 6,463 | 0.000928 |
"""
@file test_gyro_lsm330dlc.py
"""
##
# @addtogroup soletta sensor
# @brief This is sensor test based on soletta app
# @brief test sensor lsm330dlc on Galileo/MinnowMax/Edison
##
import os
import time
from oeqa.utils.helper import shell_cmd
from oeqa.oetest import oeRuntimeTest
from EnvirSetup import EnvirSetup
from ... | daweiwu/meta-iotqa-1 | lib/oeqa/runtime/sensor/test_gyro_lsm330dlc.py | Python | mit | 2,634 | 0.006834 |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/as_external_lsa/__init__.py | Python | apache-2.0 | 19,446 | 0.001337 |
class A(B):
pass
class A(object):
pass
class A(x.y()):
pass
class A(B, C):
pass
| warner83/micropython | tests/bytecode/mp-tests/class5.py | Python | mit | 96 | 0.03125 |
"""
WSGI config for eyrie project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWh... | ZeroCater/Eyrie | eyrie/wsgi.py | Python | mit | 478 | 0 |
class Symbol(object):
def __init__(self, num, name):
pass
| lodevil/pyparser | pyparser/symbol.py | Python | apache-2.0 | 72 | 0 |
# -*- coding: utf-8 -*-
"""Setup/installation tests for this package."""
from ade25.assetmanager.testing import IntegrationTestCase
from plone import api
class TestInstall(IntegrationTestCase):
"""Test installation of ade25.assetmanager into Plone."""
def setUp(self):
"""Custom shared utility setup ... | ade25/ade25.assetmanager | ade25/assetmanager/tests/test_setup.py | Python | mit | 1,209 | 0.002481 |
# Copyright (C) 2017 Kacy Thorne
#
# This file is part of Clontris.
#
# Clontris 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.
#
# Cl... | kcthrn/clontris | clontris/meta.py | Python | gpl-3.0 | 1,028 | 0 |
t = int(raw_input())
MOD = 10**9 + 7
def modexp(a,b):
res = 1
while b:
if b&1:
res *= a
res %= MOD
a = (a*a)%MOD
b /= 2
return res
fn = [1 for _ in xrange(100001)]
ifn = [1 for _ in xrange(100001)]
for i in range(1,100000):
fn[i] = fn[i-1] * i
fn[i] %... | ManrajGrover/CodeSprint_India_2014 | Qualification_Round_2/Editorials/array_simp_2.py | Python | mit | 683 | 0.030747 |
import sys
from unicode_parse_common import *
# http://www.unicode.org/Public/5.1.0/ucd/Scripts.txt
script_to_harfbuzz = {
# This is the list of HB_Script_* at the time of writing
'Common': 'HB_Script_Common',
'Greek': 'HB_Script_Greek',
'Cyrillic': 'HB_Script_Cyrillic',
'Armenian': 'HB_Script_Armenian',
... | zcbenz/cefode-chromium | third_party/harfbuzz/contrib/tables/scripts-parse.py | Python | bsd-3-clause | 2,516 | 0.010731 |
# 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 writing, software
# d... | openstack/neutron-lib | neutron_lib/callbacks/resources.py | Python | apache-2.0 | 1,353 | 0 |
from decouple import Csv, config
from dj_database_url import parse as db_url
from .base import * # noqa
DEBUG = False
SECRET_KEY = config('SECRET_KEY')
DATABASES = {
'default': config('DATABASE_URL', cast=db_url),
}
DATABASES['default']['ATOMIC_REQUESTS'] = True
ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=C... | camilaavilarinho/monitorador-twitter | monitortwitter/settings/production.py | Python | mit | 3,261 | 0.000613 |
import sys
sys.path.append("..")
from deflate import fix_star_rating
# The beatmap that you are checking and fixing inflated patterns for
beatmap_path = "./necro.osu"
# The new difficulty name (Version) of the beatmap
new_difficulty_name = "star rating fix"
# The output file path of the beatmap
output_path = "./nec... | Swan/ManiaStarReducer | test/example.py | Python | mit | 398 | 0.005025 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | PLyczkowski/Sticky-Keymap | 2.74/scripts/startup/bl_ui/properties_data_armature.py | Python | gpl-2.0 | 10,538 | 0.001803 |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | google/tmppy | _py2tmp/unification/__init__.py | Python | apache-2.0 | 920 | 0 |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import create_input
from bitcodin import Input
from bitcodin.exceptions import BitcodinBadRequestError
from bitcodin.test.bitcodin_test_case import BitcodinTestCase
class CreateInputIncompleteDataTestCase(BitcodinTestCase):
... | bitmovin/bitcodin-python | bitcodin/test/input/testcase_create_input_incomplete_data.py | Python | unlicense | 727 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... | ikkebr/PyBozoCrack | docs/conf.py | Python | bsd-3-clause | 8,453 | 0.005442 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Create oauthclient tables."""
import sqlalchemy as sa
import sqlalchemy_utils
fro... | tiborsimko/invenio-oauthclient | invenio_oauthclient/alembic/97bbc733896c_create_oauthclient_tables.py | Python | mit | 2,898 | 0 |
#!/usr/bin/env python
"""
Create generic LPU and simple pulse input signal.
"""
from itertools import product
import sys
import numpy as np
import h5py
import networkx as nx
def create_lpu_graph(lpu_name, N_sensory, N_local, N_proj):
"""
Create a generic LPU graph.
Creates a graph containing the neuron... | AdamRTomkins/Neurokernel-singularity-container | examples/data/gen_generic_lpu.py | Python | apache-2.0 | 12,988 | 0.004312 |
from django.conf.urls.defaults import patterns, url, include
urlpatterns = patterns('professor.views',
url(r'^$', 'home', name='home'),
url(r'^adicionar-compromisso$', 'adicionarCompromisso', name='adicionarCompromisso'),
url(r'^visualizar-compromisso/(?P<id>\d{1,10})$', 'visualizarCompromisso', name='visu... | dextervip/rpv | GerenDisponibilidade/professor/urls.py | Python | gpl-3.0 | 1,015 | 0.009852 |
from distutils.core import setup
from setuptools import find_packages
setup(name='ddns_updater_aws',
version='0.1',
author='Felix Bouliane',
license='MIT',
py_modules=[],
packages=find_packages(exclude=['contrib', 'docs', 'test']),
url='https://github.com/fbouliane/ddns-updater-aws',... | fbouliane/ddns-updater-aws | setup.py | Python | mit | 1,053 | 0 |
# Copyright 2013 IBM Corp.
#
# 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 t... | rickerc/cinder_audit | cinder/tests/db/test_name_id.py | Python | apache-2.0 | 2,344 | 0 |
"""
View endpoints for Survey
"""
import logging
import json
from django.contrib.auth.decorators import login_required
from django.http import (
HttpResponse, HttpResponseRedirect, HttpResponseNotFound
)
from django.core.urlresolvers import reverse
from django.views.decorators.http import require_POST
from django... | xingyepei/edx-platform | lms/djangoapps/survey/views.py | Python | agpl-3.0 | 4,127 | 0.002908 |
from __future__ import absolute_import
from agms.exception.not_found_exception import NotFoundException
try:
import requests
except ImportError as e:
raise NotFoundException(e)
class RequestsClient(object):
def http_do(self, http_verb, url, headers, request_body):
response = requests.request... | agmscode/agms_python | agms/util/requests_client.py | Python | mit | 509 | 0.001965 |
#!/usr/bin/env python
"""Small tool for copying android icons from material-design-icons repo to specified android gradle module.
It copies all density versions of png files to appropriate res subdirectories.
Usage:
picon.py add <category> <name> [-i <path>] [-o <path>] [-c <color>] [-s <size>]
... | langara/MyBlocks | picon.py | Python | apache-2.0 | 3,366 | 0.007427 |
import numpy as np
from scipy.sparse import spdiags, block_diag
from scipy.sparse.linalg import spsolve, isolve
from matplotlib import pyplot as plt
import copy
import time
import ThreeChannels_generalizing
reload(ThreeChannels_generalizing)
r = ThreeChannels_generalizing.rnet()
self = r
plt.ion()
# PER RIVER #
#... | awickert/river-network-evolution | backup/run_ThreeChannels_generalizing.py | Python | gpl-3.0 | 3,834 | 0.021127 |
import os
import tuned.logs
from . import base
from tuned.utils.commands import commands
log = tuned.logs.get()
class cpulist_present(base.Function):
"""
Checks whether CPUs from list are present, returns list containing
only present CPUs
"""
def __init__(self):
# arbitrary number of arguments
super(cpulist_... | redhat-performance/tuned | tuned/profiles/functions/function_cpulist_present.py | Python | gpl-2.0 | 691 | 0.023155 |
# -*- coding: utf-8 -*-
"""
Base Class for InvenTree plugins
"""
import warnings
from django.db.utils import OperationalError, ProgrammingError
from django.utils.text import slugify
class InvenTreePluginBase():
"""
Base class for a plugin
DO NOT USE THIS DIRECTLY, USE plugin.IntegrationPluginBase
"""... | inventree/InvenTree | InvenTree/plugin/plugin.py | Python | mit | 2,145 | 0.000932 |
from pyramda.function.curry import curry
from pyramda.iterable.reduce import reduce
from .multiply import multiply
product = reduce(multiply, 1)
| jackfirth/pyramda | pyramda/math/product.py | Python | mit | 147 | 0 |
#!/usr/bin/env python
import json, time
from flask import Flask, request, render_template, Response
from gevent import pywsgi, monkey
from helpers.generateCalibration import GenerateCalibration
#monkey.patch_all()
app = Flask(__name__)
#cameraInstance = Camera()
runCalibration = GenerateCalibration('frames', 'calib... | 3299/visioninabox | server.py | Python | mit | 2,744 | 0.027697 |
"""Support for SimpliSafe alarm control panels."""
import logging
import re
from simplipy.entity import EntityTypes
from simplipy.system import SystemStates
from homeassistant.components.alarm_control_panel import (
FORMAT_NUMBER,
FORMAT_TEXT,
AlarmControlPanel,
)
from homeassistant.components.alarm_contr... | qedi-r/home-assistant | homeassistant/components/simplisafe/alarm_control_panel.py | Python | apache-2.0 | 5,527 | 0.000543 |
#Euclidean path planning control with Kalman filter for localization
import time
import cv2
from ev3control.rpc import Robot
from rick.controllers import *
from rick.A_star_planning import *
from rick.core import State
from rick.core import main_loop
from rick.async import AsyncCamera
from rick.utils import TrackerWra... | TheCamusean/DLRCev3 | scripts/benchmarks/demo3.py | Python | mit | 27,312 | 0.028412 |
from rknfilter.targets import BaseTarget
from rknfilter.db import Resource, Decision, CommitEvery
from rknfilter.core import DumpFilesParser
class StoreTarget(BaseTarget):
def __init__(self, *args, **kwargs):
super(StoreTarget, self).__init__(*args, **kwargs)
self._dump_files_parser = DumpFilesPars... | DmitryFillo/rknfilter | rknfilter/targets/store.py | Python | bsd-2-clause | 1,324 | 0.002266 |
from django import forms
from django.contrib.auth.models import User as user_model
from django.contrib.auth.forms import UserCreationForm
from mc2.models import UserSettings
class UserSettingsForm(forms.ModelForm):
settings_level = forms.ChoiceField(
choices=UserSettings.SETTINGS_LEVEL_CHOICES,
... | praekelt/mc2 | mc2/forms.py | Python | bsd-2-clause | 1,161 | 0 |
#
# 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 us... | wangmiao1981/spark | python/pyspark/sql/pandas/map_ops.py | Python | apache-2.0 | 3,806 | 0.002365 |
"""SCons.Tool.g++
Tool-specific initialization for g++.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission is... | makinacorpus/mapnik2 | scons/scons-local-1.2.0/SCons/Tool/g++.py | Python | lgpl-2.1 | 3,111 | 0.0045 |
"""
Unittests for gj2ascii CLI
"""
from __future__ import division
import os
import tempfile
import unittest
import click
import emoji
import fiona as fio
import pytest
import gj2ascii
from gj2ascii import cli
def test_complex(runner, expected_line_40_wide, line_file, compare_ascii):
result = runner.invoke(c... | geowurster/gj2ascii | tests/test_cli.py | Python | bsd-3-clause | 13,853 | 0.000361 |
from __future__ import print_function
from BinPy.connectors.connector import *
from BinPy.gates.tree import *
from BinPy.connectors.connector import *
from BinPy.gates.gates import *
from BinPy.combinational.combinational import *
from nose.tools import with_setup, nottest
'''
Testing backtrack() function for depths ... | daj0ker/BinPy | BinPy/tests/tree_tests.py | Python | bsd-3-clause | 2,286 | 0.000875 |
from django.conf import settings
from zerver.lib.test_classes import WebhookTestCase
from zerver.models import get_realm, get_system_bot
class HelloWorldHookTests(WebhookTestCase):
STREAM_NAME = "test"
URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}&stream={stream}"
PM_URL_TEMPLATE = "/api... | rht/zulip | zerver/webhooks/helloworld/tests.py | Python | apache-2.0 | 3,346 | 0.002092 |
# -*- coding: utf-8 -*-
"""
A real simple app for using webapp2 with auth and session.
It just covers the basics. Creating a user, login, logout
and a decorator for protecting certain handlers.
Routes are setup in routes.py and added in main.py
"""
# standard library imports
import logging
# related ... | krismcfarlin/todo_angular_endpoints_sockets | bp_content/themes/default/handlers/handlers.py | Python | lgpl-3.0 | 10,823 | 0.00462 |
#!/usr/bin/python
from multiprocessing import Pool
import time
import os
import sys
import argparse
from homolog4 import *
from collections import defaultdict
# Copyright(C) 2014 David Ream
# Released under Biopython license. http://www.biopython.org/DIST/LICENSE
# Do not remove this comment
# This exists to make t... | reamdc1/gene_block_evolution_old | loci_filtering.py | Python | gpl-3.0 | 8,117 | 0.014291 |
from modularodm.exceptions import ValidationValueError
def copy_files(src, target_node, parent=None, name=None):
"""Copy the files from src to the target node
:param Folder src: The source to copy children from
:param Node target_node: The node settings of the project to copy files to
:param Folder pa... | arpitar/osf.io | website/files/utils.py | Python | apache-2.0 | 3,388 | 0.000885 |
########################################################################
#
# File Name: HTMLSelectElement.py
#
#
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved.
See http://4suite.com/COPYRIGHT for license and copyright info... | alanjw/GreenOpenERP-Win-X86 | python/Lib/site-packages/_xmlplus/dom/html/HTMLSelectElement.py | Python | agpl-3.0 | 4,750 | 0.008421 |
from telegram.handlers.base import BasePlatformHandler
class DummyHandler(BasePlatformHandler):
def handle(self):
print 'Channel: %s' % self.telegram.channel.name
print 'Subject: %s' % self.telegram.subject
print 'Message: %s' % self.telegram.content
print 'Level: %s' % self.subsc... | aquametalabs/django-telegram | telegram/handlers/dummy.py | Python | bsd-3-clause | 387 | 0 |
"""
Functions that aid testing in various ways. A typical use would be::
lowcore = create_named_configuration('LOWBD2-CORE')
times = numpy.linspace(-3, +3, 13) * (numpy.pi / 12.0)
frequency = numpy.array([1e8])
channel_bandwidth = numpy.array([1e7])
# Define th... | SKA-ScienceDataProcessor/algorithm-reference-library | processing_components/simulation/testing_support.py | Python | apache-2.0 | 47,842 | 0.007504 |
from aisikl.events import action_event
from .actionablecontrol import ActionableControl
class Button(ActionableControl):
def __init__(self, dialog, id, type, parent_id, properties, element):
super().__init__(dialog, id, type, parent_id, properties, element)
self.image = properties.get('img')
... | fmfi-svt/votr | aisikl/components/button.py | Python | apache-2.0 | 1,203 | 0.002494 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.