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 |
|---|---|---|---|---|---|
from audioop import reverse
from time import sleep
import pytest
import requests
from utils import *
from conftest import file_dir as test_home
from conftest import ref_version
import json
import datetime
class TestsortMajor:
def test_sort_with_reminderState_1(self):
filter_response = call_ref_url("get", make_book... | soumyaslab/pythonlab | py2/excel_example/test_planner_extended_filters.py | Python | gpl-2.0 | 83,909 |
this_should_be_linted = "double quote string"
| maxcountryman/flake8-single-quotes | tests/data/doubles.py | Python | mit | 46 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
# --... | r0balo/pelisalacarta | python/main-classic/core/library.py | Python | gpl-3.0 | 26,504 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | jmesteve/openerpseda | openerp/addons/base_vat/base_vat.py | Python | agpl-3.0 | 10,127 |
# -*- coding: utf-8 -*
__kupfer_name__ = _("XFCE Session Management")
__kupfer_sources__ = ("XfceItemsSource", )
__description__ = _("Special items and actions for XFCE environment")
__version__ = "2012-09-17"
__author__ = "Karol Będkowski <karol.bedkowski@gmail.com>"
from kupfer.plugin import session_support as supp... | KarolBedkowski/kupfer-adds | kupfer/plugin/session_xfce.py | Python | gpl-3.0 | 793 |
from flask import Flask, render_template, session, request, redirect
import random
app = Flask(__name__)
app.secret_key = 'my_secret_key'
@app.route('/')
def index():
if not 'gold' in session:
session['gold'] = 0
if not 'activities' in session:
session['activities'] = []
return render_temp... | authman/Python201609 | Jessie Smith/assignments/Flask Olympics/olympics8/server.py | Python | mit | 1,465 |
"""Naming conventions for abd."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdt_naming
#
# Public Classes:
# Error
# TrackerBranch
# .branch
# .status
# .description
# .bas... | valhallasw/phabricator-tools | py/abd/abdt_naming.py | Python | apache-2.0 | 9,640 |
# -*- coding: utf-8 -*-
"""Tests for notify plugins package."""
| infothrill/python-dyndnsc | dyndnsc/tests/plugins/notify/__init__.py | Python | mit | 65 |
# 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 u... | michaelhkw/incubator-impala | tests/query_test/test_exprs.py | Python | apache-2.0 | 6,107 |
# -*- coding: utf-8 -*-
from __future__ import division
from os import walk
from os.path import abspath, join, getsize
from hashlib import md5 as hashmd5
from sys import version_info
from zlib import crc32
class AnalysingFiles:
def __init__(self, md5=False):
"""
Initialize this instance before pro... | NyanKiyoshi/Py-Search-Duplicates | AnalysingFiles.py | Python | mit | 5,059 |
# -*- test-case-name: twisted.web.test.test_xml -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Micro Document Object Model: a partial DOM implementation with SUX.
This is an implementation of what we consider to be the useful subset of the
DOM. The chief advantage of this library is ... | bdh1011/wau | venv/lib/python2.7/site-packages/twisted/web/microdom.py | Python | mit | 35,469 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('discussions', '0005_auto_20150430_1645'),
]
operations = [
migrations.AlterField(
model_name='post',
... | ZackYovel/studybuddy | server/studybuddy/discussions/migrations/0006_auto_20150430_1648.py | Python | mit | 428 |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | sidzan/netforce | netforce_general/netforce_general/models/field_default.py | Python | mit | 2,457 |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | GdZ/scriptfile | software/googleAppEngine/google/appengine/api/search/stub/simple_tokenizer.py | Python | mit | 4,586 |
"""
Django settings for amcatdashboard project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Bui... | amcat/amcat-dashboard | amcatdashboard/settings.py | Python | agpl-3.0 | 7,503 |
from django.contrib import admin
from data.models import *
class EntryAdmin(admin.ModelAdmin):
pass
class GroupAdmin(admin.ModelAdmin):
pass
class FieldAdmin(admin.ModelAdmin):
pass
class RecordAdmin(admin.ModelAdmin):
pass
admin.site.register(Entry, EntryAdmin)
admin.site.register(Group, GroupAdmi... | jochenklar/quantify | data/admin.py | Python | apache-2.0 | 403 |
# This file is part of the dionaea honeypot
#
# SPDX-FileCopyrightText: 2015 Tan Kean Siong
# SPDX-FileCopyrightText: 2016 PhiBo (DinoTools)
#
# SPDX-License-Identifier: GPL-2.0-or-later
from dionaea import ServiceLoader
from .mqtt import mqttd
class MQTTService(ServiceLoader):
name = "mqtt"
@classmethod
... | dionaea-honeypot/dionaea | modules/python/dionaea/mqtt/__init__.py | Python | gpl-2.0 | 522 |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2002-2006 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 your optio... | sam-m888/gprime | gprime/filters/rules/_isprivate.py | Python | gpl-2.0 | 1,613 |
import datetime
import math
import os
from collections import namedtuple
from urllib.parse import urlparse
from django.conf import settings
from django.contrib.sitemaps import Sitemap as DjangoSitemap
from django.db.models import Count, Max, Q
from django.template import loader
from django.utils.functional import cach... | mozilla/addons-server | src/olympia/amo/sitemap.py | Python | bsd-3-clause | 15,675 |
__author__ = 'D. Garlisi'
"""
EU project WISHFUL
"""
import abc
"""
The WISHFUL interface definitions - UPIs (UPI_M) for install/update/active/deactive software modules.
"""
"""
The UPI_M - UPI for managing protocol software modules at any layer.
"""
class UPI_M(object):
__metaclass__ = abc.ABCMeta
""" Gen... | pruckebusch/WiSHFUL_UPI_SHOWCASES | upis/upi_m.py | Python | gpl-3.0 | 715 |
# -*- coding: utf-8 -*-
# KodiAddon
#
from lib.scraper import myAddon
import re
import sys
# Start of Module
addonName = re.search('plugin\://plugin.video.(.+?)/',str(sys.argv[0])).group(1)
ma = myAddon(addonName)
ma.processAddonEvent()
| odicraig/kodi2odi | addons/plugin.video.metv/default.py | Python | gpl-3.0 | 240 |
class ParsingObject:
def __init__(self, pos):
self.oid = 0
self.start_pos = pos
self.end_pos = pos
self.tag = '#empty'
self.value = None
self.parent = None
self.child = None
class ParsingLog:
def __init__(self):
self.next = None
self.index... | Kouhei-Moriya/peg4d-java | libnez/libnez.py | Python | bsd-2-clause | 2,876 |
#! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | chrta/simulavr | regress/test_opcodes/test_LD_X_incr.py | Python | gpl-2.0 | 3,078 |
import sys
import logging
sys.path.append('./entities')
from CommonDAO import CommonDAO
from datetime import datetime, date, time
class SourceHasFileDAO(CommonDAO):
jointable = "source_has_file"
def __init__(self):
CommonDAO.__init__(self)
def insertOrUpdate(self, sourceId, fileId, availabi... | tassia/DonkeySurvey | src/database/SourceHasFileDAO.py | Python | gpl-3.0 | 2,024 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from setuptools import setup
setup(name='fondasms',
version='0.8.1',
description='Django app to add support for FondaSMS requests.',
long_description=("Allow any django app to handle SMS/Call requests "
... | yeleman/django-fondasms | setup.py | Python | unlicense | 826 |
#!/usr/bin/env python
a = range(10)
for i in a:
print("Hello {}".format(i))
| FryguyPA/pynet | hello10x.py | Python | apache-2.0 | 84 |
import logging
from flock.hsm import Hsm, HsmState
from flock.protocol import FlockProtocol
from flock.controller.enocean.packet import Packet
class EnoceanPacketHsm(Hsm):
class BaseState(HsmState):
def on_data(self, hsm, data):
return self
class SyncState(BaseState):
def on_data(... | MainRo/python-flock | flock/controller/enocean/protocol.py | Python | mit | 4,961 |
from enigma import eTimer
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.Button import Button
from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.ConfigList import ConfigListScreen
from Components.config import getConfigListEntry, co... | SIFTeam/enigma2 | lib/python/SIFTeam/Cloud/AccountConfiguration.py | Python | gpl-2.0 | 1,634 |
#!/usr/bin/env python
# Copyright (c) 2011, Willow Garage, Inc.
# 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
# noti... | tut-yury/tut_ibx0020 | scripts/teleop_key.py | Python | gpl-3.0 | 5,586 |
#1. Program - Python shell de çalışan 5 temel uygulama denemesi :)
metin = """
(1) Toplama yap
(2) Faktoriyel bul
(3) Öğrenci listesi işlemleri
(4) İngilizce sözlük işlemleri
(5) Asker oluştur :)
-------------------------
Lütfen Seçiminizi yapınız
Çıkmak için (q) ya basınız
"""
d ="Devam etmek için bir tuşa basınız"
... | ozgurturkiye/istihzapython | 000.JustForFunPrograms/mixed_will_be_fixed_uygulama.py | Python | gpl-3.0 | 5,497 |
import socket
from pyrf.vrt import Stream
from pyrf.config import SweepEntry, TriggerSettings, TriggerSettingsError
class WSA4000(object):
"""
Interface for WSA4000
:meth:`.connect` must be called before other methods are used.
"""
ADC_DYNAMIC_RANGE = 72.5
def __init__(self):
pass
... | wardi/python-thinkrf | pyrf/devices/thinkrf.py | Python | bsd-3-clause | 14,687 |
#!/usr/bin/python
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Tests for database module."""
import logging.config
import os.path
import shutil
impo... | dartino/dart-sdk | tools/dom/scripts/database_test.py | Python | bsd-3-clause | 2,860 |
# Zadání:
#########
#
# Napište funkci multiVecMat(v,m), která vypočte součin vektoru v a matice m.
#
# Pokud nesouhlasí rozměry matice a vektoru, pak funkce vrací None.
#
# Otestujte Váš program na těchto datech:
#
# m=[[0,0,1],[0,1,0],[1,0,0]]
# v=[2, 4, 6]
#
####################################################... | malja/cvut-python | cviceni05/04_nasobeni_vektoru_matice.py | Python | mit | 1,362 |
from ucca import convert
import pickle
import os
import sys
def main():
dbpath = sys.argv[1]
textdir = sys.argv[2]
with open(dbpath, 'rb') as f:
passages = pickle.load(f)
for p in passages:
with open(os.path.join(textdir, p.ID + '.tagged')) as f:
tokens = []
for... | ffancellu/ucca | scripts/postag_passages.py | Python | gpl-3.0 | 780 |
"""Refinement steps for refining the 'crude' fits """
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from numpy.testing import assert_allclose
from scipy.ndimage.interpolation import map_coordinates
import scipy.ndimage
try:
... | caspervdw/circletracking | circletracking/refine.py | Python | bsd-3-clause | 12,910 |
"""
Fixture to configure XQueue response.
"""
import json
import requests
from common.test.acceptance.fixtures import XQUEUE_STUB_URL
class XQueueResponseFixtureError(Exception):
"""
Error occurred while configuring the stub XQueue.
"""
pass
class XQueueResponseFixture(object):
"""
Confi... | edx-solutions/edx-platform | common/test/acceptance/fixtures/xqueue.py | Python | agpl-3.0 | 1,436 |
#!/usr/bin/env python3
"""
微信群回复方法
:author Wang Weiwei <email>weiwei02@vip.qq.com / weiwei.wang@100credit.com</email>
:sine 2017/8/14
:version 1.0
"""
from .MessageEvent import *
# 需要设置回复的群
REPLY_GROUPS_NAMES = []
IS_AT = False
@itchat.msg_register([TEXT, MAP, CARD, NOTE, SHARING, PICTURE, RECORDIN... | weiwei02/Technical--Documentation | python/src/weichat/xiaobing/Groups.py | Python | apache-2.0 | 1,008 |
# -*- coding: utf-8 -*-
"""
Class for reading data from from Tucker Davis TTank format.
Terminology:
TDT hold data with tanks (actually a directory). And tanks hold sub block
(sub directories).
Tanks correspond to neo.Block and tdt block correspond to neo.Segment.
Note the name Block is ambiguous because it does not r... | SummitKwan/python-neo | neo/io/tdtio.py | Python | bsd-3-clause | 12,325 |
# Copyright (c) 2014 Mirantis, 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... | sergmelikyan/murano | murano/tests/unit/test_actions.py | Python | apache-2.0 | 3,357 |
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | liangwang/m5 | src/mem/slicc/ast/MachineAST.py | Python | bsd-3-clause | 3,435 |
from django.db import models
from django.db.models import Q
from django.db.models.loading import get_model
from cyder.base.eav.constants import ATTRIBUTE_INVENTORY
from cyder.base.eav.fields import EAVAttributeField
from cyder.base.eav.models import Attribute, EAVBase
from cyder.base.mixins import ObjectUrlMixin
from ... | murrown/cyder | cyder/core/system/models.py | Python | bsd-3-clause | 2,803 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Country'
db.create_table('locations_country', (
('id', self.gf('django.db.mode... | MauHernandez/cyclope | cyclope/apps/locations/migrations/0001_initial.py | Python | gpl-3.0 | 2,676 |
from django.conf.urls.defaults import *
from lingcod.spacing.views import *
urlpatterns = patterns('',
# Example:
(r'^$', Index),
url(r'^land/kml/', LandKML, name='land_kml'),
url(r'^fish_distance/kml', FishDistanceKML, name='fish_distance_kml'),
url(r'^spacing_points/kml/', SpacingPointKML, name='... | Alwnikrotikz/marinemap | lingcod/spacing/urls.py | Python | bsd-3-clause | 424 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import sys
from prjxray.segmaker im... | SymbiFlow/prjxray | fuzzers/010-clb-lutinit/generate.py | Python | isc | 864 |
#!/usr/bin/env python
"""
Unit tests for DVE authorizations
"""
import sys
import unittest
import dx_authorization
from lib.GetSession import GetSession
class DxAuthorizationTests(unittest.TestCase):
"""
Creates, activates, lists destroys Delphix Authorizations
Requirements: VDB named dx_vdb, group n... | CloudSurgeon/delphixpy-examples | tests/test_dx_authorization.py | Python | apache-2.0 | 2,758 |
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Button import Button
from Tools.LoadPixmap import LoadPixmap
import xml.etree.cElementTree
from twisted.in... | postla/OpenNFR-E2 | lib/python/Plugins/Extensions/AccuWeather/plugin.py | Python | gpl-2.0 | 51,351 |
#!flask/bin/python
from app import db, models
from config import ALTMETRIC_KEY
import urllib2
import json
from app.scripts import fetch_articles
query_term = 'genome'
try:
response = urllib2.urlopen(
'http://api.altmetric.com/v1/citations/1d?q={0}&key={1}'.format(query_term, ALTMETRIC_KEY))
except urllib2.... | alexherns/sciral-ocf-dev | create_sample_set.py | Python | mit | 730 |
def validate_user_id(api, params, user):
if params.get('user_id') in ['001', '002', '003']:
return True
return False | devashishsharma2302/testing-heroku-deployment | example/exampleapp/custom_validators.py | Python | mit | 133 |
from sys import argv
file = open(argv[1])
lines = file.readlines()
sum = int(0)
for line in lines:
line = line.strip()
sum += (len(line) - len(eval(line)))
print str(sum)
| burakozhan/adventofcode2015 | 8/8p1.py | Python | gpl-3.0 | 178 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest as ut
import logging
from ....datastructures.auxiliary import FileFrom
class TestFileFrom(ut.TestCase):
def setUp(self):
str_generator = (str(i) for i in range(11))
int_generator = (i for i in range(2))
self.str_stream = File... | yedivanseven/bestPy | tests/datastructures/auxiliary/test_filefrom.py | Python | gpl-3.0 | 1,933 |
#
# QAPI visitor generator
#
# Copyright IBM, Corp. 2011
#
# Authors:
# Anthony Liguori <aliguori@us.ibm.com>
# Michael Roth <mdroth@linux.vnet.ibm.com>
#
# This work is licensed under the terms of the GNU GPLv2.
# See the COPYING.LIB file in the top-level directory.
from ordereddict import OrderedDict
from qapi ... | mithleshvrts/qemu-kvm-rhel6 | scripts/qapi-visit.py | Python | gpl-2.0 | 8,655 |
# coding=utf-8
import unittest
"""782. Transform to Chessboard
https://leetcode.com/problems/transform-to-chessboard/description/
An N x N `board` contains only `0`s and `1`s. In each move, you can swap any 2
rows with each other, or any 2 columns with each other.
What is the minimum number of moves to transform the... | openqt/algorithms | leetcode/python/lc782-transform-to-chessboard.py | Python | gpl-3.0 | 1,708 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-11 11:19
from __future__ import unicode_literals
from django.db import migrations, models
import yksi.custom_storages
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(... | vchrisb/django-apps | yksi/django/candidate/migrations/0001_initial.py | Python | mit | 904 |
# 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... | frreiss/tensorflow-fred | tensorflow/python/framework/tensor_util_test.py | Python | apache-2.0 | 47,223 |
#!/usr/bin/python
import socket
import time
import sys
import random
from Vms import Vms
IP=sys.argv[1]
range=int(sys.argv[2])
vmInst = Vms(IP, random.randint(1,range))
s = socket.socket()
port = 8899
host = '127.0.0.1'
s.connect((host, port))
buf = vmInst.getStats()
s.send(buf)
s.close()
| nnadarajah/VMstats | vm-sim.py | Python | apache-2.0 | 296 |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Ashley Whetter <ashley@awhetter.co.uk>
# Copyright (c) 2016 Moisés López <moylop260@vauxoo.com>
# Copyright (c) 2016 Glenn Matthews <glenn@e-dad.net>
# Copyright (c) 2016 Claudiu Popa <pcmanticore@gmail.com>
# Licensed under the GPL: https://www.gnu.org/licenses/old-license... | arju88nair/projectCulminate | venv/lib/python3.5/site-packages/pylint/test/extensions/test_check_return_docs.py | Python | apache-2.0 | 17,279 |
from datetime import datetime
from _datetime import timedelta
from AlarmEntity import AlarmEntity
class AlarmTimeEntity():
def __init__(self, alarmTimeDao):
self.id = alarmTimeDao[0]
self.alarm = AlarmEntity((alarmTimeDao[4],alarmTimeDao[5]))
dayAlarm = alarmTimeDao[1]
timeAlarm = s... | Guervyl/GVPAlarm-manager | AlarmTimeEntity.py | Python | gpl-3.0 | 1,357 |
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""A tool to aggregate data about Ansible source and testing into a sqlite DB for reporting."""
from __future__ import (absolute_import, print_function)
import argparse
import json
import os
import sqlite3
import sys
import yaml
DATABASE_PATH = os.path.expanduser('~/.ans... | anryko/ansible | hacking/report.py | Python | gpl-3.0 | 6,781 |
# a waf tool to add autoconf-like macros to the configure section
import os, sys
import Build, Options, preproc, Logs
from Configure import conf
from TaskGen import feature
from samba_utils import TO_LIST, GET_TARGET_TYPE, SET_TARGET_TYPE, unique_list, mkdir_p
missing_headers = set()
################################... | jelmer/samba | buildtools/wafsamba/samba_autoconf.py | Python | gpl-3.0 | 28,806 |
from __future__ import absolute_import
from sentry.lang.native.utils import get_sdk_from_event, cpu_name_from_data, \
version_build_from_data
def test_get_sdk_from_event():
sdk_info = get_sdk_from_event({
'debug_meta': {
'sdk_info': {
'dsym_type': 'macho',
... | JackDanger/sentry | tests/sentry/lang/native/test_utils.py | Python | bsd-3-clause | 3,840 |
# coding=utf-8
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
from flask.ext.login import UserMixin
from flask.ext.principal import Identity
import hashlib
import os
import yaml
from octoprint.settings import settings
class UserMana... | 3dprintcanalhouse/octoprint2 | octoprint/users.py | Python | agpl-3.0 | 5,919 |
def test_pass():
assert True
| bbiskup/pytest-purkinje | testdata/testproj/singlepass/simple_test.py | Python | mit | 33 |
# -*- 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):
# Deleting field 'Article.published'
db.delete_column(u'articles_article'... | AmandaCMS/amanda-cms | amanda/articles/migrations/0002_auto__del_field_article_published__add_field_article_is_published.py | Python | mit | 2,096 |
"""
"""
from ._utfiles import *
from ._utconfig import *
from ._uttime import * | abantos/bolt | bolt/utils/__init__.py | Python | mit | 79 |
import argparse
import time
import logging
import json
import typing
from datetime import datetime
import apache_beam as beam
from apache_beam.options.pipeline_options import GoogleCloudOptions
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import StandardOpti... | GoogleCloudPlatform/training-data-analyst | quests/dataflow_python/5_Streaming_Analytics/lab/streaming_minute_traffic_pipeline.py | Python | apache-2.0 | 5,609 |
#
# Copyright (c) 2015-2018 Nest Labs, Inc.
# Copyright (c) 2019-2020 Google LLC.
# 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://ww... | openweave/openweave-core | src/device-manager/python/openweave/WeaveCoreBluetoothMgr.py | Python | apache-2.0 | 23,625 |
"""Copyright 2008 Orbitz WorldWide
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... | pu239ppy/graphite-web | webapp/graphite/urls.py | Python | apache-2.0 | 2,222 |
# 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... | keras-team/keras | keras/layers/convolutional/conv3d_transpose.py | Python | apache-2.0 | 14,187 |
from __future__ import annotations
import pathlib
import random
import sys
import typing
from typing import (
AbstractSet,
Container,
FrozenSet,
Iterable,
Tuple,
)
import gidgethub.abc
import gidgethub.httpx
import gidgethub.actions
import httpx
import trio
import yaml
class ConfigData(typing.T... | DonJayamanne/pythonVSCode | .github/assign-reviewers/__main__.py | Python | mit | 5,762 |
#
# users.py: Code for creating user accounts and setting the root password
#
# Copyright (C) 2006, 2007, 2008 Red Hat, Inc. All rights reserved.
#
# 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 Foundati... | Sabayon/anaconda | pyanaconda/users.py | Python | gpl-2.0 | 16,470 |
## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
## -----------------------------------
## PubNub 3.0 Real-time Push Cloud API
## -----------------------------------
tr... | joeshaw/pubnub-python | Pubnub.py | Python | mit | 6,723 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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, eith... | lem9/weblate | weblate/trans/util.py | Python | gpl-3.0 | 7,459 |
#!/usr/bin/python
#excercize 4 - variables and names
cars = 100
space_in_a_car = 4
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print("There are", cars, "cars available.")
print... | Baumelbi/IntroPython2016 | students/sheree/session_01/homework/LPTHW-EXC-04.py | Python | unlicense | 616 |
# -*- coding: utf-8 -*-
#
# Ulakbus Documents documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 28 14:30:19 2015.
#
# 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
# autogenerated f... | hiorws/ulakbus.org | source/conf.py | Python | gpl-3.0 | 11,687 |
# 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... | ankur-gupta91/horizon-net-ip | openstack_dashboard/test/integration_tests/pages/project/compute/access_and_security/securitygroupspage.py | Python | apache-2.0 | 2,566 |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 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 RPC calls related to blockchain state. Tests correspond to code in
# rpcblockchain.cpp.
#
from ... | janko33bd/bitcoin | qa/rpc-tests/blockchain.py | Python | mit | 2,833 |
#!/usr/bin/python
#
# currentsensor.py API for reading current from the ACS712 sensor
#
# Aug2018 tests show readings are generally within 60mA of the actual current
# e.g. idle (w pigpio daemon running) .31-33 Amps shows 337-379mA
# loaded w three systemtests/loadcpu_fib.py .68-.70 Amps shows 664-741mA
... | slowrunner/RWPi | litst/currentsensor.py | Python | gpl-3.0 | 2,432 |
from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParametersTerrestrial, eDVBFrontendParametersCable, eDVBFrontendParameters, eDVBResourceManager, eTimer
class Tuner:
def __init__(self, frontend, ignore_rotor=False):
self.frontend = frontend
self.ignore_rotor = ignore_rotor
# transponder = (freque... | popazerty/EG-2 | lib/python/Components/TuneTest.py | Python | gpl-2.0 | 10,730 |
from line import *
from numba import jit
'''
INPUT
lines - a list of LineSegments and params is a list of the parameters
params - a list of the parameters which includes
dist_merge - the minimum distance below which line segments are merged
angle_merge - angle below which line segments are merged
'''
#@jit
de... | Molecular-Image-Recognition/Molecular-Image-Recognition | code/lines_to_graph.py | Python | mit | 5,383 |
# -*- 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-tasks | google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py | Python | apache-2.0 | 33,575 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fsfs-reshard.py REPOS_PATH MAX_FILES_PER_SHARD
#
# Perform an offline conversion of an FSFS repository between linear (format
# 2, usable by Subversion 1.4+) and sharded (format 3, usable by Subversion
# 1.5+) layouts.
#
# The MAX_FILES_PER_SHARD argument specifies the... | bdmod/extreme-subversion | BinarySourcce/subversion-1.6.17/tools/server-side/fsfs-reshard.py | Python | gpl-2.0 | 14,407 |
# stdlib
import csv
import io
import tarfile
from typing import Callable
from typing import Dict as TypeDict
from typing import List
from typing import Type
from typing import Union
# third party
from nacl.signing import VerifyKey
import numpy as np
import torch as th
# relative
from ...... import deserialize
from ..... | OpenMined/PySyft | packages/syft/src/syft/core/node/common/node_service/dataset_manager/dataset_manager_service.py | Python | apache-2.0 | 9,520 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | qutebrowser/qutebrowser | tests/unit/browser/webkit/http/test_http.py | Python | gpl-3.0 | 3,271 |
from django.contrib.postgres.fields import JSONField
from django.db.models.aggregates import Aggregate
__all__ = [
'ArrayAgg', 'BitAnd', 'BitOr', 'BoolAnd', 'BoolOr', 'JSONBAgg', 'StringAgg',
]
class ArrayAgg(Aggregate):
function = 'ARRAY_AGG'
template = '%(function)s(%(distinct)s%(expressions)s)'
d... | Beauhurst/django | django/contrib/postgres/aggregates/general.py | Python | bsd-3-clause | 1,509 |
from django.core.management.base import BaseCommand
from django.db.models import get_apps, get_app
from django_evolution.models import Evolution
class Command(BaseCommand):
"""Lists the applied evolutions for one or more apps."""
def handle(self, *app_labels, **options):
if not app_labels:
... | shash/IconDB | djev/management/commands/list-evolutions.py | Python | agpl-3.0 | 718 |
from django.db import models
from cms.models import CMSPlugin
CLASS_CHOICES = ['container', 'content', 'teaser']
CLASS_CHOICES = tuple((entry, entry) for entry in CLASS_CHOICES)
TAG_CHOICES = [
'div', 'article', 'section', 'header', 'footer', 'aside',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6'
]
TAG_CHOICES = tuple... | rsalmaso/django-cms | cms/test_utils/project/pluginapp/plugins/style/models.py | Python | bsd-3-clause | 1,967 |
import os
import re
import sys
"""
* Perform initial configuration to ensure that the server is set up to work with Burton's format
sudo chown -R ubuntu:ubuntu /var/www
mkdir -p /var/www/default/public_html
mv /var/www/html/index.html /var/www/default/public_html # Ubuntu >=14.04
mv /var/www/index.html... | dotancohen/burton | configure_websites.py | Python | gpl-3.0 | 4,169 |
# Copyright (c) MetaCommunications, Inc. 2003-2007
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import xml.sax.saxutils
import zipfile
import ftplib
import time
import stat
import xml.dom.minidom
import xml... | NixaSoftware/CVis | venv/bin/tools/regression/src/collect_and_upload_logs.py | Python | apache-2.0 | 18,518 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import os
from asdf.extension import AsdfExtension, BuiltinExtension
from asdf.util import filepath_to_url
# Make sure that all tag implementations are imported by the time we create
# the extension class so that _astropy_asdf_ty... | astropy/astropy | astropy/io/misc/asdf/extension.py | Python | bsd-3-clause | 2,664 |
import os
import numpy as np
import nibabel as nb
from scipy.fftpack import fft, ifft
def ideal_bandpass(data, sample_period, bandpass_freqs):
# Derived from YAN Chao-Gan 120504 based on REST.
sample_freq = 1. / sample_period
sample_length = data.shape[0]
data_p = np.zeros(int(2**np.ceil(np.log2... | FCP-INDI/C-PAC | CPAC/nuisance/bandpass.py | Python | bsd-3-clause | 5,588 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The primar... | saydulk/newfies-dialer | newfies/survey/forms.py | Python | mpl-2.0 | 27,466 |
#----------------------------------------------------------------------------
# Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in /LICENSE.txt and may be redistributed only
# under the conditions described in the af... | burnpanck/traits | traits/util/tests/test_record_containers.py | Python | bsd-3-clause | 2,637 |
import sys, re
import xbmc, xbmcgui
import contextmenu
__language__ = sys.modules[ "__main__" ].__language__
__cwd__ = sys.modules[ "__main__" ].__cwd__
CANCEL_DIALOG = ( 9, 10, 92, 216, 247, 257, 275, 61467, 61448, )
ACTION_SHOW_INFO = ( 11, )
class GUI( xbmcgui.WindowXMLDialog ):
def __init__( self... | arKtelix/plugin.program.1.search | resources/lib/infodialog.py | Python | gpl-2.0 | 6,445 |
class Reader:
@staticmethod
def get_number(size):
num = input("Type the number you want to move (Type 0 to quit): ")
while not (num.isdigit() and 0 <= int(num) <= size**2-1):
num = input("Type the number you want to move (Type 0 to quit): ")
return int(num)
| imscs21/myuniv | 1학기/programming/basic/파이썬/파이썬 과제/11/slidingPuzzle/SlidingView.py | Python | apache-2.0 | 306 |
# -*- coding:utf-8 -*-
"""
base.py
~~~~~~~
"""
import re
import datetime
import json
import requests
from torndb import Connection
from tornado.gen import coroutine
from tornado.concurrent import run_on_executor
from tornado.escape import to_unicode, url_escape
from concurrent.futures import ThreadPoolExecutor
... | richardGaoPy/NetSpider | zhihuspyder/base.py | Python | apache-2.0 | 15,004 |
# -*- coding: utf-8 -*-
import datetime
from django.db import models
from librehatti.catalog.models import Category, PurchaseOrder
from librehatti.voucher.models import FinancialSession
class SuspenseOrder(models.Model):
"""
Stores order with over head costs.
"""
voucher = models.IntegerField()
... | GreatDevelopers/LibreHatti | src/librehatti/suspense/models.py | Python | gpl-2.0 | 6,188 |
def product(*iterables):
"""compute the cartesian product of a list of iterables
>>> for i in product(['a','b','c'],[1,2]):
... print i
...
['a', 1]
['a', 2]
['b', 1]
['b', 2]
['c', 1]
['c', 2]
"""
if iterables:
for head in iterables[0]:
for rema... | egaburov/thrust | performance/build/perftest.py | Python | apache-2.0 | 4,777 |
# -*- coding: utf-8 -*-
"""Module providing views for the site navigation root"""
from Acquisition import aq_inner
from Products.Five.browser import BrowserView
from Products.ZCatalog.interfaces import ICatalogBrain
from plone import api
from plone.app.contentlisting.interfaces import IContentListing
from plone.app.con... | a25kk/eda | src/eda.sitecontent/eda/sitecontent/browser/frontpage.py | Python | mit | 3,589 |
import numpy as np
import matplotlib.pyplot as plt
import sys
class Sudoku:
def __init__(self):
# build the sudoku board
# @N: board size, 9
# @n: board subgrid size 3
# fill every block with a permutation of 1 to 9
self.N = 9
self.n = 3
self.board = np.zeros... | yu-H-ang/leetcode-backup | optimization/SimulatedAnnealing.py | Python | mit | 3,369 |
from django.contrib import admin
from jobs.models import Job, JobParameter
admin.site.register(Job)
admin.site.register(JobParameter)
| silps/solesite | jobs/admin.py | Python | bsd-3-clause | 135 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.