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 |
|---|---|---|---|---|---|---|
from django.conf.urls import url
from . import views
app_name = 'repo'
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^home/$', views.home, name='home'),
url(r'^library/$', views.library, name='library'),
url(r'^login/$', views.login, name='login'),
url(r'^register/$', views.register, name='register')... | giantas/elibrary | repo/urls.py | Python | mit | 535 | 0.018692 |
self.description = "Backup file relocation"
lp1 = pmpkg("bash")
lp1.files = ["etc/profile*"]
lp1.backup = ["etc/profile"]
self.addpkg2db("local", lp1)
p1 = pmpkg("bash", "1.0-2")
self.addpkg(p1)
lp2 = pmpkg("filesystem")
self.addpkg2db("local", lp2)
p2 = pmpkg("filesystem", "1.0-2")
p2.files = ["etc/profile**"]
p2.... | kylon/pacman-fakeroot | test/pacman/tests/upgrade042.py | Python | gpl-2.0 | 725 | 0.002759 |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from odoo import api, SUPERUSER_ID
_logger = logging.getLogger(__name__)
def post_init_hook(cr, registry):
"""
Create a payment group for every existint payment
"""
env = api.Environment(cr, SUPERUSER_ID, {})
# payments... | ingadhoc/account-payment | account_payment_group/hooks.py | Python | agpl-3.0 | 1,366 | 0.000732 |
import logging
import time
from collections import OrderedDict, defaultdict
from datetime import datetime, timedelta
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
from django.conf import settings
from django.db import connection
from django.db.models import F
from psycopg2.sql import SQL, C... | showell/zulip | analytics/lib/counts.py | Python | apache-2.0 | 29,578 | 0.003719 |
'''
Testing class for database API's course related functions.
Authors: Ari Kairala, Petteri Ponsimaa
Originally adopted from Ivan's exercise 1 test class.
'''
import unittest, hashlib
import re, base64, copy, json, server
from database_api_test_common import BaseTestCase, db
from flask import json, jsonify... | petterip/exam-archive | test/rest_api_test_course.py | Python | mit | 16,344 | 0.006975 |
import time
seen = set()
import_order = []
elapsed_times = {}
level = 0
parent = None
children = {}
def new_import(name, globals={}, locals={}, fromlist=[]):
global level, parent
if name in seen:
return old_import(name, globals, locals, fromlist)
seen.add(name)
import_order.append((name, ... | hazelnusse/sympy-old | bin/sympy_time.py | Python | bsd-3-clause | 1,207 | 0.023198 |
#
# 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... | wileeam/airflow | airflow/operators/dummy_operator.py | Python | apache-2.0 | 1,203 | 0 |
#!/usr/bin/python
'''
Example of zmq client.
Can be used to record test data on
remote PC
Nacho Mas January-2017
'''
import sys
import zmq
import time
import json
from config import *
# Socket to talk to server
context = zmq.Context()
socket = context.socket(zmq.SUB)
#socket.setsockopt(zmq.CONFLATE, 1)
socket.... | nachoplus/cronoStamper | zmqClient.py | Python | gpl-2.0 | 568 | 0.021127 |
import asyncio
import errno
import json
import logging
import os
import stat
import sys
from functools import partial
from pathlib import Path
from platform import system
from shutil import rmtree, which
from subprocess import CalledProcessError
from sys import version_info
from tempfile import TemporaryDirectory
from ... | psf/black | src/black_primer/lib.py | Python | mit | 13,941 | 0.001507 |
# Copyright 2016 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... | cg31/tensorflow | tensorflow/contrib/distributions/python/ops/operator_test_util.py | Python | apache-2.0 | 6,295 | 0.008896 |
#!/F3/core/tweet_model.py
# A class for representating a tweet.
# Author : Ismail Sunni/@ismailsunni
# Created : 2012-03-30
from db_control import db_conn
from datetime import datetime, timedelta
import preprocess as pp
class tweet_model:
'''A class for representating a tweet.'''
def __init__(self, id... | ismailsunni/f3-factor-finder | core/tweet_model.py | Python | gpl-2.0 | 4,719 | 0.042594 |
# -*- coding: utf-8 -*-
from orator.orm import Factory, Model, belongs_to, has_many
from orator.connections import SQLiteConnection
from orator.connectors import SQLiteConnector
from .. import OratorTestCase, mock
class FactoryTestCase(OratorTestCase):
@classmethod
def setUpClass(cls):
Model.set_con... | sdispater/orator | tests/orm/test_factory.py | Python | mit | 4,197 | 0.000477 |
# 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
# distrib... | dtroyer/osc-debug | oscdebug/tests/v1/test_auth.py | Python | apache-2.0 | 1,401 | 0 |
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
class GCodeListDecorator(SceneNodeDecorator):
def __init__(self):
super().__init__()
self._gcode_list = []
def getGCodeList(self):
return self._gcode_list
def setGCodeList(self, list):
self._gcode_list = list
| alephobjects/Cura2 | cura/Scene/GCodeListDecorator.py | Python | lgpl-3.0 | 316 | 0 |
from .ica import *
#from .ica_gpu import ica_gpu
| alvarouc/ica | ica/__init__.py | Python | gpl-3.0 | 49 | 0.020408 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://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, eithe... | electrolinux/weblate | weblate/accounts/tests.py | Python | gpl-3.0 | 26,044 | 0 |
# -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | dnjohnstone/hyperspy | hyperspy/tests/component/test_components.py | Python | gpl-3.0 | 20,259 | 0.000346 |
"""
Models a GC-MS experiment represented by a list of signal peaks
"""
#############################################################################
# #
# PyMS software for processing of metabolomic mass-spectrometry data #
# Copy... | thegodone/pyms | Experiment/Class.py | Python | gpl-2.0 | 3,288 | 0.012165 |
from django.apps import AppConfig
class PlayersConfig(AppConfig):
name = 'players'
| kevinharvey/django-tourney | tourney/players/apps.py | Python | gpl-3.0 | 89 | 0 |
#!/usr/bin/python
#
# Copyright Friday Film Club. All Rights Reserved.
"""League unit tests."""
__author__ = 'adamjmcgrath@gmail.com (Adam McGrath)'
import unittest
import base
import helpers
import models
class LeagueTestCase(base.TestCase):
def testPostPutHook(self):
league_owner = helpers.user()
le... | adamjmcgrath/fridayfilmclub | src/tests/test_model_league.py | Python | mpl-2.0 | 1,925 | 0.002597 |
import ctypes
import os
import types
from platform_utils import paths
def load_library(libname):
if paths.is_frozen():
libfile = os.path.join(paths.embedded_data_path(), 'accessible_output2', 'lib', libname)
else:
libfile = os.path.join(paths.module_path(), 'lib', libname)
return ctypes.windll[libfile]
def get... | codeofdusk/ProjectMagenta | src/accessible_output2/__init__.py | Python | gpl-2.0 | 885 | 0.027119 |
# $Id$
import copy
import logging
import time
import traceback
import types
from quixote import form2
from quixote.html import htmltext
import canary.context
from canary.gazeteer import Feature
from canary.qx_defs import MyForm
from canary.utils import DTable, render_capitalized
import dtuple
class ExposureRoute ... | dchud/sentinel | canary/study.py | Python | mit | 63,030 | 0.009107 |
#!/usr/bin/env python
#! -*- coding: utf-8 -*-
###
# Copyright (c) Rice University 2012-13
# This software is subject to
# the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
###
"""
THis exists solely to provide less typing for a "leaf node"
in a simple real... | jbarmash/rhaptos2.user | rhaptos2/user/cnxbase.py | Python | agpl-3.0 | 1,673 | 0.003586 |
from django.conf.urls import url
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='homepage.html')),
url(r'^remote.html$', TemplateView.as_view(template_name='remote.html'), name="remote.html"),
]
| bashu/django-facebox | example/urls.py | Python | bsd-3-clause | 266 | 0.003759 |
# Copyright 2016 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... | nanditav/15712-TensorFlow | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | Python | apache-2.0 | 163,728 | 0.009143 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api, fields, models
class CrmActivity(models.Model):
''' CrmActivity is a model introduced in Odoo v9 that models activities
performed in CRM, like phonecalls, sending emails, making demonst... | tvtsoft/odoo8 | addons/crm/models/crm_activity.py | Python | agpl-3.0 | 2,406 | 0.001663 |
# coding: utf-8
'''
Created on 2012-8-30
@author: shanfeng
'''
import smtplib
from email.mime.text import MIMEText
import urllib
import web
class XWJemail:
'''
classdocs
'''
def __init__(self, params):
'''
Constructor
'''
pass
@staticmethod
def sendfindpass(user,hash):
link = "%s/account/newpass?%s"... | waile23/todo | utils/xwjemail.py | Python | mit | 2,175 | 0.063391 |
#!/usr/bin/python
# This script reads through a enotype likelihood file and the respective mean genotype likelihood file. It writes a nexus file for all individuals and the given genotypesi, with '0' for ref homozygote, '1' for heterozygote, and '2' for alt homozygote.
# Usage: ~/vcf2nex012.py pubRetStriUG_unlnkd.gl ... | schimar/hts_tools | vcf2nex012.py | Python | gpl-2.0 | 1,837 | 0.004355 |
""" ListCompToMap transforms list comprehension into intrinsics. """
from pythran.analyses import OptimizableComprehension
from pythran.passmanager import Transformation
from pythran.transformations import NormalizeTuples
import ast
class ListCompToMap(Transformation):
'''
Transforms list comprehension int... | hainm/pythran | pythran/optimizations/list_comp_to_map.py | Python | bsd-3-clause | 2,611 | 0 |
#!/usr/bin/env python
#
# Copyright 2008 Jose Fonseca
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This ... | dpimenov/tvdb_api | tests/gprof2dot.py | Python | unlicense | 53,218 | 0.004209 |
from HSM_Reactions import *
########## RIGHT MEMBERS OF ODEs, rewritten with only 10 equations to isolate those that are independent ##############
def f10eqs(t, y, ksetDict, TparamSet, REACparamSet, DirectControlnuPp, IC_PplusPp, IC_SplusSs):
#P = y[0]
Ph = y[0]
#S = y[2]
Ss = y[1]
F = y[2]
... | QTB-HHU/ModelHeatShock | HSM_ODEsSystem10or9eqs.py | Python | gpl-3.0 | 5,759 | 0.009029 |
#!/usr/bin/env python3
#########################################################################
# File Name: mthreading.py
# Author: ly
# Created Time: Wed 05 Jul 2017 08:46:57 PM CST
# Description:
#########################################################################
# -*- coding: utf-8 -*-
im... | LingyuGitHub/codingofly | python/threading/mthreading.py | Python | gpl-3.0 | 699 | 0.013413 |
# coding=utf-8
"""TV base class."""
from __future__ import unicode_literals
import threading
from builtins import object
from medusa.indexers.config import INDEXER_TVDBV2
class Identifier(object):
"""Base identifier class."""
def __bool__(self):
"""Magic method."""
raise NotImplementedError... | pymedusa/SickRage | medusa/tv/base.py | Python | gpl-3.0 | 2,303 | 0.001303 |
from astropy.io import ascii
from astropy.table import MaskedColumn, Table, Column
import logging
import math
import numpy
import os
from .downloads.cutouts.downloader import ImageDownloader
from . import util
from .downloads.cutouts.source import SourceCutout
from astropy.time import Time
from .astrom import Observati... | OSSOS/MOP | src/ossos/core/ossos/match.py | Python | gpl-3.0 | 13,649 | 0.005495 |
import sys
import os
import platform
import re
import imp
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
import webbrowser
from idlelib.MultiCall import MultiCallCreator
from idlelib import idlever
from idlelib import WindowList
from idlelib import SearchDialog
from idlelib import GrepDialog
from idle... | sdlBasic/sdlbrt | win32/mingw/opt/lib/python2.7/idlelib/EditorWindow.py | Python | lgpl-2.1 | 66,626 | 0.001816 |
"""Implements a HD44780 character LCD connected via PCF8574 on I2C.
This was tested with: https://www.wemos.cc/product/d1-mini.html"""
from time import sleep_ms, ticks_ms
from machine import I2C, Pin
from esp8266_i2c_lcd import I2cLcd
# The PCF8574 has a jumper selectable address: 0x20 - 0x27
DEFAULT_I2C_ADDR = 0x... | dhylands/python_lcd | lcd/esp8266_i2c_lcd_test.py | Python | mit | 1,476 | 0.002033 |
from jinja2 import Markup
class momentjs(object):
def __init__(self, timestamp):
self.timestamp = timestamp
def render(self, format):
return Markup("<script>\ndocument.write(moment(\"%s\").%s);\n</script>" % (self.timestamp.strftime("%Y-%m-%dT%H:%M:%S Z"), format))
def format(self, fmt):
... | mikkqu/rc-chrysalis | scapp/moment.py | Python | bsd-2-clause | 500 | 0.006 |
# -*- coding: utf-8 -*-
"""Parser related functions and classes for testing."""
import heapq
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import resolver as path_spec_resolver
from plaso.containers import sessions
from plaso.engine imp... | dc3-plaso/plaso | tests/parsers/test_lib.py | Python | apache-2.0 | 8,486 | 0.004949 |
from setuptools import setup, find_packages
setup(name='MODEL1201230000',
version=20140916,
description='MODEL1201230000 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/MODEL1201230000',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages(... | biomodels/MODEL1201230000 | setup.py | Python | cc0-1.0 | 377 | 0.005305 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.ncl
~~~~~~~~~~~~~~~~~~~
Lexers for NCAR Command Language.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, words
from pygments.token... | wakatime/wakatime | wakatime/packages/py27/pygments/lexers/ncl.py | Python | bsd-3-clause | 63,986 | 0.004095 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides the tools used to internally run the astropy test suite
from the installed astropy. It makes use of the `pytest` testing framework.
"""
from __future__ import (absolute_import, division, print_function,
uni... | AustereCuriosity/astropy | astropy/tests/helper.py | Python | bsd-3-clause | 18,299 | 0 |
import sqlalchemy
metadata = sqlalchemy.MetaData()
log_table = sqlalchemy.Table('log', metadata,
sqlalchemy.Column('id', sqlalchemy.Integer, primary_key=True),
sqlalchemy.Column('filename', sqlalchemy.Unicode),
sqlalchemy.Column('d... | Stackato-Apps/py3kwsgitest | tables.py | Python | mit | 647 | 0.006182 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-30 12:53
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_... | pashinin-com/pashinin.com | src/core/migrations/0002_auto_20161030_1553.py | Python | gpl-3.0 | 478 | 0 |
input = """
g(1).
g(2).
g(3).
f(a,b).
f(A,B):- g(A), g(B).
f(a,a).
"""
output = """
{f(1,1), f(1,2), f(1,3), f(2,1), f(2,2), f(2,3), f(3,1), f(3,2), f(3,3), f(a,a), f(a,b), g(1), g(2), g(3)}
"""
| Yarrick13/hwasp | tests/wasp1/AllAnswerSets/edbidb_3.test.py | Python | apache-2.0 | 199 | 0.005025 |
from velox_deploy import *
| kcompher/velox-modelserver | bin/cluster/fabfile.py | Python | apache-2.0 | 27 | 0 |
# (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: redis
author:
- Jan-P... | Azulinho/ansible | lib/ansible/plugins/lookup/redis.py | Python | gpl-3.0 | 3,113 | 0.002891 |
from __future__ import absolute_import
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content... | tschmorleiz/amcat | amcat/scripts/article_upload/controller.py | Python | agpl-3.0 | 3,148 | 0.0054 |
# -*- coding: utf-8 -*-
"""
Unit tests for reverse URL lookups.
"""
from __future__ import unicode_literals
import sys
import threading
import unittest
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth.models import... | dfunckt/django | tests/urlpatterns_reverse/tests.py | Python | bsd-3-clause | 50,749 | 0.003074 |
from worldengine.simulations.basic import *
import random
from worldengine.views.basic import color_prop
from PyQt4 import QtGui
class WatermapView(object):
def is_applicable(self, world):
return world.has_watermap()
def draw(self, world, canvas):
width = world.width
height = world.h... | ftomassetti/worldengine | worldengine/views/WatermapView.py | Python | mit | 880 | 0 |
"""NuGridPy package version"""
__version__ = '0.7.6'
| NuGrid/NuGridPy | nugridpy/version.py | Python | bsd-3-clause | 54 | 0 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# -*- mode: python -*-
# vi: set ft=python :
import os
from setuptools import setup, find_packages
README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README')
DESCRIPTION = 'Easy image thumbnails in Django.'
if os.path.exists(README_PATH): LONG_DE... | pegler/django-thumbs | setup.py | Python | bsd-2-clause | 691 | 0.004342 |
# -*- coding: utf-8 -*-
"""
lets.transparentlet
~~~~~~~~~~~~~~~~~~~
Deprecated. gevent-1.1 keeps a traceback exactly.
If you want to just prevent to print an exception by the hub, use
:mod:`lets.quietlet` instead.
:copyright: (c) 2013-2018 by Heungsub Lee
:license: BSD, see LICENSE for more det... | sublee/lets | lets/transparentlet.py | Python | bsd-3-clause | 600 | 0 |
#!/usr/bin/python
from gevent import monkey
monkey.patch_all()
import logging
import gevent
from gevent.coros import BoundedSemaphore
from kafka import KafkaClient, KeyedProducer, SimpleConsumer, common
from uveserver import UVEServer
import os
import json
import copy
import traceback
import uuid
import struct
import ... | facetothefate/contrail-controller | src/opserver/partition_handler.py | Python | apache-2.0 | 23,447 | 0.00917 |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of a woob module.
#
# This woob module 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, o... | Phyks/Flatisfy | modules/seloger/pages.py | Python | mit | 9,785 | 0.002146 |
# perf trace event handlers, generated by perf trace -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. Ba... | droidzone/Supernova-Kernel | tools/tools/perf/scripts/python/check-perf-trace.py | Python | gpl-2.0 | 2,501 | 0.02479 |
# flake8: noqa
import sys
import toml
import log
from .uploader import DropboxUploader
from .file_manager import DirectoryPoller, VolumePoller
SECT = 'flysight-manager'
class ConfigError(Exception):
pass
class FlysightConfig(object):
pass
class DropboxConfig(object):
pass
class VimeoConfig(object... | richo/flysight-manager | flysight_manager/config.py | Python | mit | 6,142 | 0.002279 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2022 Daniele Simonetti
#
# 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.
#
... | OpenNingia/l5r-character-manager-3 | l5r/dialogs/newrankdlg.py | Python | gpl-3.0 | 3,473 | 0.001152 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ClassObj',
fields=[
('id', models.AutoField(ver... | ricardogsilva/django-mapserver | djangomapserver/migrations/0001_initial.py | Python | bsd-2-clause | 8,539 | 0.00445 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 30, transform = "None", sigma = 0.0, exog_count = 20, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_None/trend_MovingAverage/cycle_30/ar_12/test_artificial_32_None_MovingAverage_30_12_20.py | Python | bsd-3-clause | 264 | 0.087121 |
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Erkan Ozgur Yilmaz
#
# This module is part of oyProjectManager and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
"""
Database Module
===============
This is where all the magic happens.
.. versionadded:: 0.2.0
SQLite3 Datab... | dshlai/oyprojectmanager | oyProjectManager/db/__init__.py | Python | bsd-2-clause | 5,475 | 0.009315 |
# --------------------------------------------------------------------------- #
# CUBECOLOURDIALOG Widget wxPython IMPLEMENTATION
#
# Python Code By:
#
# Andrea Gavana, @ 16 Aug 2007
# Latest Revision: 14 Apr 2010, 12.00 GMT
#
#
# TODO List
#
# 1. Find A Way To Reduce Flickering On The 2 ColourPanels;
#
# 2. See Why wx... | ezequielpereira/Time-Line | libs64/wx/lib/agw/cubecolourdialog.py | Python | gpl-3.0 | 139,714 | 0.003285 |
#-------------------------------------------------------------------------------
#
# This file is part of pygimplib.
#
# Copyright (C) 2014, 2015 khalim19 <khalim19@gmail.com>
#
# pygimplib is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | Buggaboo/gimp-plugin-export-layers | export_layers/pygimplib/pgitemdata.py | Python | gpl-3.0 | 14,487 | 0.015669 |
#!/usr/bin/env python
# coding: utf-8
from module import Module
import numpy as np
try:
from im2col_cyt import im2col_cython, col2im_cython
except ImportError:
print('Installation broken, please reinstall PyFunt')
from numpy.lib.stride_tricks import as_strided
def tile_array(a, b1, b2):
r, c = a.shape
... | dnlcrl/PyFunt | pyfunt/spatial_up_sampling_nearest.py | Python | mit | 2,179 | 0.001377 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 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... | darren-wang/op | oslo_policy/_parser.py | Python | apache-2.0 | 8,552 | 0 |
#!/usr/bin/env python
import telnetlib
import time
import socket
import sys
import getpass
TELNET_PORT = 23
TELNET_TIMEOUT = 6
def send_command(remote_conn, cmd):
'''
Initiate the Telnet Session
'''
cmd = cmd.rstrip()
remote_conn.write(cmd + '\n')
time.sleep(1)
return remote_conn.read_ver... | gahlberg/pynet_class_work | class2/ex2a_telnet.py | Python | apache-2.0 | 1,588 | 0.003149 |
from django.shortcuts import render, render_to_response
from django.shortcuts import redirect
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.conf import settings
from manage.forms import *
from manage.models import *
from... | csdevsc/colcat_crowdsourcing_application | manage/views.py | Python | mit | 7,968 | 0.005522 |
import numpy as np
from scipy.stats import sem
import scipy.constants as const
from uncertainties import ufloat
import uncertainties.unumpy as unp
from uncertainties.unumpy import (nominal_values as noms, std_devs as stds)
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from PIL import Image
import... | smjhnits/Praktikum_TU_D_16-17 | Fortgeschrittenenpraktikum/Protokolle/V27_Zeeman-Effekt/Python/blau_s.py | Python | mit | 2,866 | 0.010479 |
from mutant_django.generator import DjangoBase
def register(app):
app.extend_generator('django', django_json_field)
def django_json_field(gen):
gen.field_generators['JSON'] = JSONField
class JSONField(DjangoBase):
DJANGO_FIELD = 'JSONField'
def render_imports(self):
return ['from jsonfiel... | peterdemin/mutant | src/mutant_django_json/__init__.py | Python | isc | 341 | 0 |
#!/usr/bin/env python3
# Copyright (c) 2019-2021 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 descriptor wallet function."""
from test_framework.blocktools import COINBASE_MATURITY
from test_... | tecnovert/particl-core | test/functional/wallet_descriptor.py | Python | mit | 10,725 | 0.00317 |
dimensions(8,2)
wall((0, 2), (8, 2))
wall((1, 1.5),(1.5, 1.5))
wall((2, 1.6),(2.8, 1.6))
wall((3.1, 1.4),(3.5, 1.4))
initialRobotLoc(1.0, 1.0)
| Cynary/distro6.01 | arch/6.01Soft/lib601-F13-4/soar/worlds/oneDdiff.py | Python | mit | 148 | 0.027027 |
import web
urls = (
'/hello','Index'
)
app = web.application(urls,globals())
render = web.template.render('/usr/local/LPTHW/ex51/gothonweb/templates/',base="layout")
class Index(object):
def GET(self):
return render.hello_form()
def POST(self):
form = web.input(name="No... | tridvaodin/Assignments-Valya-Maskaliova | LPTHW/projects/gothonweb/bin/app.py | Python | gpl-2.0 | 488 | 0.020492 |
import os, sys, re
import ConfigParser
import optparse
import shutil
import subprocess
import difflib
import collections
#import numpy as np
# Alberto Meseguer file; 18/11/2016
# Modified by Quim Aguirre; 13/03/2017
# This file is the master coordinator of the DIANA project. It is used to run multiple DIANA commands... | quimaguirre/diana | scripts/old_scripts/run_experiment_cluster.py | Python | mit | 5,102 | 0.010584 |
# COPYRIGHT (c) 2016-2018 Nova Labs SRL
#
# All rights reserved. All use of this software and documentation is
# subject to the License Agreement located in the file LICENSE.
from .Core import *
from .ModuleTarget import *
from .ParametersTarget import *
from abc import abstractmethod
class CoreWorkspaceBase:
de... | novalabs/core-tools | novalabs/core/CoreWorkspace.py | Python | gpl-3.0 | 16,247 | 0.000923 |
import logging
import socket
import re
from os import path, remove, makedirs, rename, environ
from . import docker_client, pull_image
from . import DockerConfig
from . import DockerPool
from cattle import Config
from cattle.compute import BaseComputeDriver
from cattle.agent.handler import KindBasedMixin
from cattle.ty... | rancherio/python-agent | cattle/plugins/docker/compute.py | Python | apache-2.0 | 33,197 | 0.00009 |
#!/usr/bin/env python
__author__ = 'Jamie Diprose'
import rospy
from sensor_msgs.msg import JointState
from ros_pololu_servo.msg import servo_pololu
import math
class EinsteinController():
def __init__(self):
rospy.init_node('einstein_controller')
rospy.Subscriber("joint_angles", JointState, self... | jdddog/einstein_robot | einstein_driver/src/einstein_controller.py | Python | bsd-3-clause | 1,255 | 0.004781 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-19 21:08
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrat... | KraftSoft/together | location/migrations/0001_initial.py | Python | bsd-3-clause | 767 | 0.002608 |
# Copyright 2015 Internap.
#
# 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, so... | mlecours/fake-switches | fake_switches/netconf/netconf_protocol.py | Python | apache-2.0 | 4,337 | 0.003689 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEBUG = False
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
SECRET_KEY = 'my-key'
ROOT_URLCONF = 'tests.urls'
INSTALLED_APPS = [
'tests',
'cloudinary_storage',
# 'django.contrib.admin',
'django.contrib.auth',
'django.con... | klis87/django-cloudinary-storage | tests/settings.py | Python | mit | 2,246 | 0.000445 |
import unittest
from isbn_verifier import is_valid
# Tests adapted from `problem-specifications//canonical-data.json`
class IsbnVerifierTest(unittest.TestCase):
def test_valid_isbn(self):
self.assertIs(is_valid("3-598-21508-8"), True)
def test_invalid_isbn_check_digit(self):
self.assertIs(i... | TGITS/programming-workouts | exercism/python/isbn-verifier/isbn_verifier_test.py | Python | mit | 1,989 | 0 |
from datetime import datetime
import mock
from nose.tools import eq_
import mkt
import mkt.site.tests
from mkt.account.serializers import (AccountSerializer, AccountInfoSerializer,
TOSSerializer)
from mkt.users.models import UserProfile
class TestAccountSerializer(mkt.site.tests... | ingenioustechie/zamboni | mkt/account/tests/test_serializers.py | Python | bsd-3-clause | 3,416 | 0 |
from .sample_filter import SampleFilter, GtFilter
from .sv_gt_filter import SvGtFilter
import logging
from collections import OrderedDict, defaultdict
class FamilyFilter(object):
'''
Determine whether variants/alleles fit given inheritance
patterns for families.
'''
def __init__(self, pe... | gantzgraf/vape | vase/family_filter.py | Python | gpl-3.0 | 69,896 | 0.000229 |
import inspect
import os
import time
import sys
import numpy as np
import tensorflow as tf
import shutil
import data_engine
VGG_MEAN = [103.939, 116.779, 123.68]
image_height = 720
image_width = 960
feature_height = int(np.ceil(image_height / 16.))
feature_width = int(np.ceil(image_width / 16.))
class RPN:
def... | huangshiyu13/RPNplus | train.py | Python | mit | 12,215 | 0.00393 |
import sys
import os
import re
import shutil
from setuptools import setup
name = 'django-skivvy'
package = 'skivvy'
description = ('Write faster integration tests for Django views – with less '
'code.')
url = 'https://github.com/oliverroick/django-skivvy'
author = 'Oliver Roick'
author_email = 'oliver.r... | Cadasta/django-skivvy | setup.py | Python | agpl-3.0 | 3,207 | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Fabrizio Colonna <colofabrix@tin.it>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | sidartaoliveira/ansible | lib/ansible/modules/system/parted.py | Python | gpl-3.0 | 22,160 | 0.000632 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
import os
from smart_open import smart_open
try:
import cPickle as _pickle
except ImportError:
import pickle as _pickle
from gensi... | olavurmortensen/gensim | gensim/similarities/index.py | Python | lgpl-2.1 | 3,188 | 0.002509 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Deepin, Inc.
# 2011 Wang Yong
# 2012 Reza Faiz A
#
# Author: Wang Yong <lazycat.manatee@gmail.com>
# Maintainer: Wang Yong <lazycat.manatee@gmail.com>
# Reza Faiz A <ylpmiskrad@gmail.com>
# Remixed : Reza Faiz A <ylpmi... | Zulfikarlatief/tealinux-software-center | src/updatePage.py | Python | gpl-3.0 | 6,849 | 0.007446 |
# coding=utf8
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import os
from os.path import join
import tempfile
import shutil
from six.moves import configparser
import pytest
from tests import setenv, test_doc0
f... | eukaryote/knowhow | tests/conftest.py | Python | mit | 1,892 | 0 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class SexyItem(scrapy.Item):
# define the fields for your item here like:
name = scrapy.Field()
dirname = scrapy.Field()
file_urls = scr... | eryxlee/scrapy | sexy/sexy/items.py | Python | gpl-2.0 | 358 | 0.002793 |
class Printer(object):
"""
"""
def __init__(self):
self._depth = -1
self._str = str
self.emptyPrinter = str
def doprint(self, expr):
"""Returns the pretty representation for expr (as a string)"""
return self._str(self._print(expr))
def _print(self, expr):
... | certik/sympy-oldcore | sympy/printing/printer.py | Python | bsd-3-clause | 847 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-11-02 10:04
from __future__ import unicode_literals
from django.db import migrations
def update_version_queues(apps, schema_editor):
VersionQueue = apps.get_model('repository', 'VersionQueue')
for queue in VersionQueue.objects.all():
queu... | BirkbeckCTP/janeway | src/repository/migrations/0020_vq_title_abstracts.py | Python | agpl-3.0 | 693 | 0.001443 |
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
register_host_test("ec_app")
| coreboot/chrome-ec | zephyr/test/ec_app/BUILD.py | Python | bsd-3-clause | 195 | 0 |
################################
# These variables are overwritten by Zenoss when the ZenPack is exported
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = "ZenPacks.community.SquidMon"
VERSION = "1.0"
AUTHOR = "Josh Baird"
LICENSE = "GPLv2"
NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.c... | zenoss/ZenPacks.community.SquidMon | setup.py | Python | gpl-2.0 | 2,623 | 0.012962 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from .tinytag import TinyTag, StringWalker, ID3, Ogg, Wave, Flac
__version__ = '0.9.1'
if __name__ == '__main__':
print(TinyTag.get(sys.argv[1])) | bradchristensen/cherrymusic | tinytag/__init__.py | Python | gpl-3.0 | 194 | 0.005155 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Monk-ee (magic.monkee.magic@gmail.com).
#
"""__init__.py: Init for unit testing this module."""
__author__ = "monkee"
__maintainer__ = "monk-ee"
__email__ = "magic.monkee.magic@gmail.com"
__status__ = "Development"
import unittest
from PuppetDBClien... | monk-ee/AWSBillingToDynamoDB | tests/__init__.py | Python | gpl-2.0 | 623 | 0 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Romain Bignon
#
# 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... | yannrouillard/weboob | modules/voyagessncf/pages.py | Python | agpl-3.0 | 4,591 | 0.003921 |
from pymander.exceptions import CantParseLine
from pymander.handlers import LineHandler, RegexLineHandler, ArgparseLineHandler
from pymander.contexts import StandardPrompt
from pymander.commander import Commander
from pymander.decorators import bind_command
class DeeperLineHandler(LineHandler):
def try_execute(se... | altvod/pymander | examples/simple.py | Python | mit | 1,893 | 0.002113 |
from django.conf.urls import include, url
from django.contrib import admin
from rest_framework.routers import DefaultRouter
from sk_map.api.map import MapViewSet, WallViewSet, BoxViewSet, PointViewSet, MenViewSet,\
WallListViewSet, BoxListViewSet, PointListViewSet, MenListViewSet, MapListViewSet
from sk_auth.api.au... | chepe4pi/sokoban_api | sokoban/urls.py | Python | gpl-2.0 | 2,156 | 0.00603 |
#
# Copyright 2001 - 2016 Ludek Smid [http://www.ospace.net/]
#
# This file is part of Outer Space.
#
# Outer Space 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
# (... | dahaic/outerspace | server/lib/ige/ospace/Rules/__init__.py | Python | gpl-2.0 | 11,626 | 0.027697 |
"""__Main__."""
import sys
import os
import logging
import argparse
import traceback
import shelve
from datetime import datetime
from CONSTANTS import CONSTANTS
from settings.settings import load_config, load_core, load_remote, load_email
from settings.settings import load_html, load_sms
from core import read_structure... | Hoohm/pyHomeVM | pyHomeVM/__main__.py | Python | gpl-3.0 | 5,792 | 0.000691 |
# -*-coding:Utf-8 -*
# Copyright (c) 2013 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | stormi/tsunami | src/secondaires/navigation/commandes/matelot/recruter.py | Python | bsd-3-clause | 5,585 | 0.00072 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.