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
# coding=utf-8 # Author: Giovanni Borri # Modified by gborri, https://github.com/gborri for TNTVillage # URL: https://sickchill.github.io # # This file is part of SickChill. # # SickChill is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
coderbone/SickRage-alt
sickbeard/providers/tntvillage.py
Python
gpl-3.0
16,761
# Copyright 2010-2011 OpenStack Foundation # Copyright 2012-2013 IBM Corp. # 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/li...
sajeeshcs/nested_quota_latest
nova/tests/unit/db/test_migrations.py
Python
apache-2.0
27,298
# -*- coding: utf-8 -*- # # 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 #...
RealImpactAnalytics/airflow
tests/hooks/test_hive_hook.py
Python
apache-2.0
10,247
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-28 18:16 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migration...
mohrm/umklapp_site
umklapp/migrations/0001_initial.py
Python
mit
2,352
import pathlib from ...helpers import techreport from .._helpers import _read, register _source = techreport( authors=["R. Cools", "A. Haegemans"], title="Construction of fully symmetric cubature formulae of degree 4k-3 for fully symmetric planar regions", year="1985", institution="Dept. of Computer S...
nschloe/quadpy
src/quadpy/e2r2/_cools_haegemans/__init__.py
Python
mit
860
from mongoengine import Document, DoesNotExist, EmbeddedDocumentField, ListField, StringField # Note: This model is duplicated in # deployment_scripts/dump_attack_mitigations/attack_mitigations.py. If the schema changes here, it # will also need to be changed there. class AttackMitigations(Document): COLLECTION_N...
guardicore/monkey
monkey/monkey_island/cc/models/attack/attack_mitigations.py
Python
gpl-3.0
781
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Marijn van Vliet <w.m.vanvliet@gmail.com> # Jona Sassenhagen <jona.sassenhagen@gmai...
olafhauk/mne-python
mne/channels/layout.py
Python
bsd-3-clause
36,277
BBBB BBBBBBBBBBBBBB BBBBBBBBBBB BBBB XXXXX XXXXXXXXXXXXX BB BBBBBBBBBBBBBB gettext('Current rating') X FFFFFFFFFFF BBBB gettext('Currently unrated') BBBBB XXXXXXX BB BBB BBBBB BB BBBBBBBBBBBBBBBBBBBBBBBBBBBBB XXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXBBB BBBBBBBBXX BBBBBBB...
amigcamel/taipei.py
templates/generic/includes/rating.html.py
Python
mit
568
# -*- coding: utf-8 -*- # Copyright 2017 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. """Module to manage builder statuses.""" from __future__ import print_function import collections import pickle import sys from...
endlessm/chromium-browser
third_party/chromite/lib/builder_status_lib.py
Python
bsd-3-clause
27,385
# -*- coding: utf-8 -*- """Tests of email marketing signal handlers.""" import datetime import logging import ddt from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.contrib.sites.models import Site from django.test import TestCase from django.test.client import Request...
cpennington/edx-platform
lms/djangoapps/email_marketing/tests/test_signals.py
Python
agpl-3.0
30,562
import gzip import logging import urllib2 from StringIO import StringIO import simplejson as json from django.conf import settings from django.core.urlresolvers import reverse from treeherder.etl import th_publisher logger = logging.getLogger(__name__) class JsonExtractorMixin(object): def extract(self, url):...
avih/treeherder
treeherder/etl/mixins.py
Python
mpl-2.0
3,050
""" Common helper functions for tests. """ from __future__ import absolute_import, division, print_function import keyword import string from collections import OrderedDict from hypothesis import strategies as st import attr from attr import Attribute from attr._make import NOTHING, make_class def simple_class(...
anthgur/servo
tests/wpt/web-platform-tests/tools/third_party/attrs/tests/utils.py
Python
mpl-2.0
7,560
#!/usr/bin/env python import sys import click import xpcs.pcs import xpcs.resource import xpcs.node import xpcs.globals @click.group() @click.option('--quiet', '-q', is_flag=True) @click.option('--status') @click.pass_context def cli(ctx, quiet=False, status=None): xpcs.globals.quiet = quiet ctx.obj = xpcs....
larsks/xpcs
xpcs/main.py
Python
gpl-3.0
454
# -*- coding: utf-8 -*- from module.plugins.internal.XFSHoster import XFSHoster class MovReelCom(XFSHoster): __name__ = "MovReelCom" __type__ = "hoster" __version__ = "1.29" __status__ = "testing" __pattern__ = r'http://(?:www\.)?movreel\.com/\w{12}' __config__ = [("activated" , "b...
Guidobelix/pyload
module/plugins/hoster/MovReelCom.py
Python
gpl-3.0
1,042
# 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 # distribu...
jarrodmcc/OpenFermion
src/openfermion/transforms/_fenwick_tree.py
Python
apache-2.0
5,002
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
crmccreary/openerp_server
openerp/addons/l10n_be_hr_payroll/__openerp__.py
Python
agpl-3.0
1,824
# -*- coding: utf-8 -*- """ Created on Fri Aug 11 17:25:50 2017 @author: Eliot al-najdawi.py """ import cv2 import numpy as np import os from matplotlib import pyplot as plt thisfilepath = os.path.dirname(__file__) loaddirpath = os.path.abspath(os.path.join(thisfilepath, "test_files/orig")) savedirpath = os.path.ab...
EliotBryant/ShadDetector
shadDetector_testing/Gradient Based Methods/al-najdawi.py
Python
gpl-3.0
996
""" Copyright 2014 Sotera Defense Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
Sotera/Datawake
server/datawake/util/dataconnector/local_entity_data_connector.py
Python
apache-2.0
16,318
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Fisher'] , ['MovingAverage'] , ['Seasonal_MonthOfYear'] , ['AR'] );
antoinecarme/pyaf
tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_MovingAverage_Seasonal_MonthOfYear_AR.py
Python
bsd-3-clause
163
import mock import shutil from pathlib import Path import spreadsplug.autorotate as autorotate from spreads.workflow import Page # TODO: Test if latest processed_image is rotated if present # TODO: Test if non-jpg files are skipped def test_process(): # No need for confit.Configuration, since the plugin doesn...
miloh/spreads
tests/autorotate_test.py
Python
agpl-3.0
2,075
from django.apps import AppConfig class PlayersConfig(AppConfig): name = 'players'
kevinharvey/django-tourney
tourney/players/apps.py
Python
gpl-3.0
89
from re import match as re_match from django import template from django.core.urlresolvers import reverse from django.db import models from django.utils import dates from django.template import resolve_variable from tagging.models import TaggedItem from blog.models import Post, Category register = template.Library(...
davisd/django-blogyall
blog/templatetags/blog_tags.py
Python
bsd-3-clause
5,246
#!/usr/bin/env python3 """ Copyright Sean Bruton Contact sbruton$$$$ᣣ££tcd.ie. (Take away the currency symbols) """ import argparse import sys import subprocess def cmd_output_to_str_list(output): # TODO: Sense checks output_str = str(output) output_list = output_str.split('\\n') # Remove the bytes ...
leaveitout/.dotfiles
actwin.py
Python
mit
2,511
DEPS = [ 'recipe_engine/platform', ]
shishkander/recipes-py
recipe_modules/path/__init__.py
Python
bsd-3-clause
39
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Mon Oct 03 15:32:11 2011 by generateDS.py version 2.6a. # import sys import getopt import re as re_ etree_ = None Verbose_import_ = False ( XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree ) = range(3) XMLParser_import_l...
MaxTyutyunnikov/lino
lino/sandbox/bcss/SSDNRequest.py
Python
gpl-3.0
103,635
#!/usr/bin/env python # ****************************************************** # Michael Cohen <scudette@users.sourceforge.net> # # ****************************************************** # Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 12 00:48:38 EST 2008$ # ****************************************************** # #...
backupManager/pyflag
src/FileFormats/PST.py
Python
gpl-2.0
26,312
import re from django.conf import settings from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured from django.views.static import serve def static(prefix, view=serve, **kwargs): """ Helper function to return a URL pattern for serving files in debug mode. fro...
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/conf/urls/static.py
Python
mit
898
from django import apps from django.utils.translation import ugettext_lazy as _ class AppConfig(apps.AppConfig): name = 'core' verbose_name = _('Núcleo')
LeandroRoberto/musicat
core/apps.py
Python
gpl-3.0
165
#!/bin/bash # Oh wait, you'll usually be running this on Windows :-) # # Sondemonitor to APRS bridge # Copyright (C) 2014 Mark Jessop <vk5qi@rfhead.net> # # Dependencies: pykml (get it from pip) # import time, datetime, urllib2, argparse, sys from pykml import parser as kmlparse from socket import * # ...
darksidelemm/sondemonitorUtils
sonde_to_aprs.py
Python
gpl-3.0
4,527
import argparse import json parser = argparse.ArgumentParser(description='Flattens a conll file to individual sentences.') parser.add_argument('--input_file', type=str, help='The location of the .conll-file to be parsed') parser.add_argument('--json_files', type=str, help='The location of the .json-files to be include...
MichSchli/QuestionAnsweringGCN
helpers/map_gold_relations.py
Python
mit
2,619
import tkinter as tk from time import sleep from playsound import playsound import config import fasttick from helpmessage import fasttick_help_message import misc from tickerwindow import TickerWindow class GUIfasttick(TickerWindow): def __init__(self, app): super().__init__(app) misc.delete_anci...
JevinJ/Bittrex-Notify
src/GUIfasttick.py
Python
mit
3,213
# -*- coding: utf-8 -*- __license__ = """ This file is part of RasPy. RasPy 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 vers...
bibi21000/RasPy
src/raspy/common/server.py
Python
gpl-2.0
3,274
import sys import json import os path = os.path.dirname(os.path.abspath(__file__)) try: print "generating blog..." #read in template information index = open(os.path.join(path, 'index.dcc'), 'r').read() entryStyle = open(os.path.join(path, 'entry_style.dcc'), 'r').read() #read in blog entries fr...
devCodeCamp/dcc-py-blogger
make.py
Python
mit
933
#!/usr/bin/env python """ @package mi.dataset.parser.vel3d_k_wfp_stc @file marine-integrations/mi/dataset/parser/vel3d_k_wfp_stc.py @author Steve Myerson (Raytheon), Mark Worden @brief Parser for the Vel3dKWfpStc dataset driver Release notes: Initial Release """ """ The VEL3D input file is a binary file. The first r...
petercable/mi-dataset
mi/dataset/parser/vel3d_k_wfp_stc.py
Python
bsd-2-clause
17,721
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- from collections import namedtuple from typing import List, Union import numpy as np from astropy.io import fits TimeChunk = namedtuple('TimeChunk', 'start_time num_of_samples') def split_time_range(time_length: float, num_of_chunks: int, ...
ziotom78/stripeline
stripeline/timetools.py
Python
mit
11,654
import hashlib def hash160(data): hash1 = hashlib.sha256(data).digest() ripemd160 = hashlib.new('ripemd160') ripemd160.update(hash1) return ripemd160.digest()
sirk390/coinpy
coinpy-lib/src/coinpy/tools/bitcoin/hash160.py
Python
lgpl-3.0
176
$$ Checks total duration of ATTK-tagged audio segments in a given directory. import os def time_completed(dir_path): pathnames=[os.path.join(dir_path,filename) for filename in os.listdir(dir_path)] corrected_files=sorted([item for item in pathnames if '_corrected.csv' in item]) csv_set=[] for pathnam...
stevemclaugh/audio-tagging-toolkit
scripts/completed_audio_duration.py
Python
apache-2.0
825
# Ansible module to manage CheckPoint Firewall (c) 2019 # # 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 License, or # (at your option) any later version. # # Ansible is dist...
kvar/ansible
test/units/modules/network/check_point/test_cp_mgmt_security_zone_facts.py
Python
gpl-3.0
2,864
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...
tylertian/Openstack
openstack F/keystone/keystone/common/logging.py
Python
apache-2.0
2,281
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun """ import sys import os # # print(os.path.abspath("./pub")) # new_path = os.path.join("./pub", "root") # home = os.path.abspath(new_path) # if os.path.isdir(home): # print(999) # else: # print(os.makedirs(home, exist_ok=False)) # # import ...
zengchunyun/s12
day7/temp/sys_cmd_ext.py
Python
gpl-2.0
3,659
""" Django's standard crypto functions and utilities. """ from __future__ import unicode_literals import hmac import struct import hashlib import binascii import time # Use the system PRNG if possible import random try: random = random.SystemRandom() using_sysrandom = True except NotImplementedError: impo...
simbha/mAngE-Gin
lib/django/utils/crypto.py
Python
mit
6,880
from rpython.rtyper.lltypesystem import rffi, lltype from rpython.rlib.rarithmetic import intmask from hippy import consts from hippy.error import PHPException from hippy.builtin import wrap_method, ThisUnwrapper, StringArg from hippy.builtin_klass import GetterSetterWrapper, k_Exception from hippy.klass import def_cl...
ericpp/hippyvm
hippy/module/date/dateinterval_klass.py
Python
mit
9,931
import atexit import logging import smc.api.session import smc.base.util from .__version__ import __description__, __url__, __version__ from .__version__ import __author__, __author_email__, __license__ manager = smc.api.session.SessionManager.create() atexit.register(manager.close_all) session = manager.get_defa...
gabstopper/smc-python
smc/__init__.py
Python
apache-2.0
2,874
# coding=utf-8 import typing from collections import MutableMapping from emft.core.logging import make_logger from emft.core.path import Path from emft.core.singleton import Singleton LOGGER = make_logger(__name__) # noinspection PyAbstractClass class OutputFolder(Path): pass class OutputFolders(MutableMappin...
132nd-etcher/EMFT
emft/plugins/reorder/value/output_folder.py
Python
gpl-3.0
1,091
""" Django settings for columbus project on production server. """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import mimetypes import socket mimetypes.add_type("image/svg+xml", ".svg", True) mimetypes.add_type("image/svg+xml", ".svgz", True) # Webservice for Galileo. Needed only...
jkachika/columbus
columbus/prod_settings.py
Python
mit
9,944
"""Core models used by the CMS.""" from __future__ import unicode_literals from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.core import urlresolvers from django.db import models, connection, transaction from django.db.models import Q, F from django.utils.encoding imp...
dan-gamble/cms
cms/apps/pages/models.py
Python
bsd-3-clause
15,992
import os import sys import math import argparse import config import shutil from turkic.cli import handler, importparser, Command, LoadCommand from turkic.database import session import sqlalchemy import random from vision import Box from vision import ffmpeg import vision.visualize import vision.track.interpolation i...
cvondrick/vatic
cli.py
Python
mit
45,587
#!/usr/bin/python #coding=utf-8 # 过期文件清理工具 # 用于清理超过一定时间的日志、临时文件 # 作者: kevin.hongs@gmail.com # 修订: 2016/03/03 import os import re import sys import time import datetime from getopt import getopt def hsClean(dn, tm, ep, op, nm, ne): """ 清理工具 dn: 待清理的目录 tm: 清除此时间前的文件 ep: 删除空的目录 op: 仅输出不删除 nm...
ihongs/HongsCode
Python/main/strip.py
Python
mit
4,212
# import json # import pandas as pd import numpy as np import os from core.lda_engine import model_files from pandas import DataFrame from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from core.keyword_db import keyword_dbs def db_connect(base, model_name='dss'): try: path = 'sq...
conferency/find-my-reviewers
core/helper/tables.py
Python
mit
3,572
"""Support for RDW binary sensors.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from vehicle import Vehicle from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, BinarySensorEntityDescription, ) fr...
home-assistant/home-assistant
homeassistant/components/rdw/binary_sensor.py
Python
apache-2.0
3,210
from __future__ import print_function import sys import argparse from .interface import HttpRequestTranslator from .input_handler import handlers def init(): args = take_args() hrt = process_args(args) codes = hrt.generate_code() if args.parse_args().beautify: for language in codes: ...
owtf/http-request-translator
hrt/cli.py
Python
bsd-3-clause
4,650
# 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...
zouyapeng/horizon-newtouch
openstack_dashboard/dashboards/admin/aggregates/tables.py
Python
apache-2.0
5,423
"""logging functions""" import sys # log colors RED = '\033[1;31m' GREEN = '\033[1;32m' YELLOW = '\033[1;33m' BLUE = '\033[1;36m' DEF = '\033[0;0m' #------------------------------------------------------------------------------- def error(msg, fatal=True) : """ Print error message and exit with error code 10 ...
floooh/fips
mod/log.py
Python
mit
2,102
""" Feynman's squares Richard Phillips Feynman was a well-known American physicist and a recipient of the Nobel Prize in Physics. He worked in theoretical physics and pioneered the field of quantum computing. Recently, an old farmer found some papers and notes that are believed to have belonged to Feynman....
MrOrioleCashback/snippets
CodeWars kyu5 and 6 2016-3-18.py
Python
mit
4,931
import json from StringIO import StringIO from testtools import TestCase from testtools.matchers import ( AfterPreprocessing, ContainsDict, Equals, IsInstance, MatchesAll, MatchesListwise, MatchesStructure) from testtools.twistedsupport import failed, succeeded from treq.testing import StringStubbingResource, ...
fusionapp/txdocumint
src/txdocumint/test/test_client.py
Python
mit
15,276
from django.contrib import admin from .models import Quote class QuoteAdmin(admin.ModelAdmin): list_display = ('id', 'author', 'content', 'date') list_filter = ['date'] search_fields = ['author', 'content'] admin.site.register(Quote, QuoteAdmin)
FMF-studenti/backend
fmf/quotes/admin.py
Python
gpl-2.0
261
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python...
ceari/whyattend
whyattend/alembic/env.py
Python
bsd-2-clause
2,071
from bs4 import BeautifulSoup from django.test import TestCase from bootstrap4.exceptions import BootstrapError from .forms import TestForm from .utils import render_form, render_formset, render_template_with_form class BootstrapFormSetTest(TestCase): def test_illegal_formset(self): with self.assertRais...
zostera/django-bootstrap4
tests/test_formsets.py
Python
bsd-3-clause
6,483
from setuptools import setup setup( name='ChannelWorm', version='0.1', packages=[ 'channelworm', 'channelworm.ion_channel', 'channelworm.digitizer', 'channelworm.account', 'channelworm.web_app', 'channelworm.fitter', 'channelworm.predictor' ], ...
VahidGh/ChannelWorm
setup.py
Python
mit
555
from collections import deque class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def findBottomLeftValue(self, root: TreeNode) -> int: leftMost = None q = deque() q.append(root) while q: left...
shobhitmishra/CodingProblems
LeetCode/Session3/BottomLeftTreeValue.py
Python
mit
929
__author__ = 'yangjiebin' from functools import wraps from flask import abort from flask.ext.login import current_user from .models import Permission def permission_required(permission): def decorator(f): @wraps(f) def decorated_function(*args,**kwargs): if not current_user.can(permiss...
rebortyang/flask_blog
app/decorators.py
Python
mit
525
# -*- coding: utf-8 -*- from suds.client import Client from pandas import Series #Create a new object named NWIS for calling the web service methods (https://fedorahosted.org/suds/wiki/Documentation) NWIS = Client("http://river.sdsc.edu/wateroneflow/NWIS/UnitValues.asmx?WSDL").service #Call the GetValuesObject method...
goodalljl/hydroinformatics_class
Class19_InClassExample2.py
Python
mit
1,079
__author__ = 'Thygrrr' import os import re import pygit2 from urlparse import urlparse import logging logger = logging.getLogger(__name__) from PyQt4 import QtCore, QtGui class Repository(QtCore.QObject): transfer_progress_value = QtCore.pyqtSignal(int) transfer_progress_maximum = QtCore.pyqtSignal(int) ...
HaraldWeber/client
src/git/repository.py
Python
gpl-3.0
5,301
# -*- coding: utf-8 -*- # config public key and private key public_key = "" private_key = "" # base url for api request base_url = "https://api.ucloud.cn"
hsiun/yoyo
api/python2.x-api-demo/config.simple.py
Python
apache-2.0
158
# -*- coding: utf-8 -*- class Charset(object): common_name = 'NotoSansDevanagariUI-Bold' native_name = '' def glyphs(self): chars = [] chars.append(0x0000) #uni0000 ???? chars.append(0xA8E4) #uniA8E4 COMBINING DEVANAGARI DIGIT FOUR chars.append(0xA8E7) #uniA8E7 COMBININ...
davelab6/pyfontaine
fontaine/charsets/noto_chars/notosansdevanagariui_bold.py
Python
gpl-3.0
16,550
""" Functions related to writing to and retrieving from cache files """ import os import numpy as np from log_yatsm import logger _image_ID_str = 'image_IDs' def get_line_cache_name(dataset_config, n_images, row, nbands): """ Returns cache filename for specified config and line number Args: dataset_...
jmorton/yatsm
yatsm/cache.py
Python
mit
8,031
#coding=utf-8 from admin import admin, AdminCtrl class Admin_ConfsCtrl(AdminCtrl): @admin def get(self): pager = {} pager['qnty'] = min(int(self.input('qnty', 10)), 50) pager['page'] = max(int(self.input('page', 1)), 1) pager['list'] = 0; cur = self.dbase('confs').curs...
wolfelee/luokr.com
www.luokr.com/app/ctrls/admin/confs.py
Python
bsd-3-clause
3,028
#!/usr/bin/python # vi: ts=4 expandtab # # Copyright (C) 2012 Canonical Ltd. # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # # This program is free software: you can redistribute it and...
oourfali/cloud-init-fedora
cloudinit/netinfo.py
Python
gpl-3.0
3,816
#!/usr/bin/env python # -*- coding: utf-8 -*- # Euler's Totient Function from __future__ import print_function, division import math import timeit try: range = xrange except NameError: pass def is_prime(x): if x == 2: return True if x % 2 == 0 or x == 1: return False for i in ...
tijko/Project-Euler
py_solutions_61-70/Euler_69.py
Python
mit
1,206
from will.plugin import WillPlugin from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template from will import settings class MonthlyGoalsPlugin(WillPlugin): @respond_to("Set my monthly goals to (?P<goals>.*)", multiline=True) def set_goals(self, message, goals=""): pri...
skoczen/my-will
plugins/monthly_goals.py
Python
mit
1,091
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
DavidAndreev/indico
indico/util/rules.py
Python
gpl-3.0
4,887
# Copyright (C) 2017 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 or agreed to in writ...
google/agi
kokoro/macos/dmg-settings.py
Python
apache-2.0
994
# Copyright 2019 BIG-Consulting GmbH(<http://www.openbig.org>) # Copyright 2019 Onestein (<https://www.onestein.eu>) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import fields, models class VatStatementConfig(models.Model): _name = 'l10n.de.tax.statement.config' _description = '...
OCA/l10n-germany
l10n_de_tax_statement/models/l10n_de_tax_statement_config.py
Python
agpl-3.0
3,119
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else [] PROJECT_CATKIN_DEPENDS = "".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else [] PROJECT_NAME = "beginner_tutorials" PROJECT_SPACE_DIR...
ESILV-CFR-2016/ros_raspi_pkg
build_isolated/beginner_tutorials/catkin_generated/pkg.installspace.context.pc.py
Python
gpl-3.0
389
from __future__ import unicode_literals from django.db import models from django_extensions.db.models import TimeStampedModel from django.core import urlresolvers NO = 0 YES = 1 UNKNOWN = 3 STATUS_CHOICES = ( (YES, 'Yes'), (NO, 'No'), (UNKNOWN, 'Unknown'), ) class DataSource(TimeStampedModel): name ...
jmason-ebi/pdx
web/models.py
Python
apache-2.0
5,106
import unittest import numpy as np import speed_run as sr class TestPythonLists(unittest.TestCase): def setUp(self): self.python_list = [[0,1,2], [0,1,2], [0,1,2]] self.power_list = [[0,1,4], [0,1,4], [0,1,4]] def test_python_looping(self): self.output_grid = sr.square_2d_li...
cgoodale/IEPUG_Numpy_Intro
test_speed_run.py
Python
apache-2.0
1,330
# test _thread.get_ident() function # # MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd import _thread def thread_entry(): tid = _thread.get_ident() print('thread', type(tid) == int, tid != 0, tid != tid_main) global finished finished = True tid_main = _thread.get_ident() prin...
AriZuu/micropython
tests/thread/thread_ident1.py
Python
mit
473
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2009 Christopher Lenz # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Utility code for managing design documents.""" from copy import deepcopy from inspect import get...
ryanolson/couchdb-python
couchdb/design.py
Python
bsd-3-clause
8,106
from django.core.management import call_command from django.test import TestCase from advisers import models, tasks class SeedTest(TestCase): def test_seed_loads_models_with_organisation_type(self): tasks.clear_db() call_command("seed") # OrganisationType model loaded from initial_categor...
ministryofjustice/laa-legal-adviser-api
laalaa/apps/advisers/tests/test_seed.py
Python
mit
522
# -*- coding: utf-8 -*- # Copyright 2014 Foxdog Studios # # 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 l...
foxdog-studios/pyddp
ddp/messages/server/removed_message_parser.py
Python
apache-2.0
1,055
""" this file does variant calling for RNAseq """ #============= import required packages ================= import os import sys import subprocess sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) # disable buffer from Modules.f00_Message import Message from Modules.f01_list_trim_fq import list_files_human,Trimmoma...
shl198/Pipeline
VariantCall/Human_GATK_RNA_vari_call.py
Python
mit
7,218
#!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 # A script to generate a list of tests that have changed or added and create an # arguments file for sanitycheck to allow running those tests with --all import os import sh import logging import argparse if "ZEPHYR_BASE" not in os.environ: logging.erro...
GiulianoFranchetto/zephyr
scripts/ci/get_modified_tests.py
Python
apache-2.0
1,989
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2014 René Kijewski <rene.kijewski@fu-berlin.de> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
daniel-k/RIOT
boards/qemu-i386/dist/term.py
Python
lgpl-2.1
4,344
import _importer from gtkmvc3 import Model, View, Controller from gi.repository import Gtk # Shows how a group of radio actions can be adapted to a # unique OP. The integer value of the OP is the value of the # actions. The setting is bi-directional, but to set the # active radio the exacct match is required, or the r...
roboogle/gtkmvc3
gtkmvco/tests/adapter_radio_value.py
Python
lgpl-2.1
1,482
# Copyright 2020 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 agreed to in writing, ...
google/article-recommender
recommender/models.py
Python
apache-2.0
40,296
import sys from decimal import Decimal import numpy as np from numpy.testing import * from numpy.testing.utils import WarningManager import warnings class TestEinSum(TestCase): def test_einsum_errors(self): # Need enough arguments assert_raises(ValueError, np.einsum) assert_raises(ValueErr...
lthurlow/Network-Grapher
proj/external/numpy-1.7.0/numpy/core/tests/test_einsum.py
Python
mit
19,922
# -*- coding: utf-8 -*- """ Created on Mon Feb 01 16:31:53 2016 @author: thomas.douenne """ from __future__ import division import os import pkg_resources import pandas as pd def add_area_dummy(dataframe): areas = ['rural', 'villes_petites', 'villes_moyennes', 'villes_grandes', 'agglo_paris'] for area in a...
thomasdouenne/openfisca-france-indirect-taxation
openfisca_france_indirect_taxation/almost_ideal_demand_system/utils.py
Python
agpl-3.0
4,691
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
crmccreary/openerp_server
openerp/addons/sale_margin/sale_margin.py
Python
agpl-3.0
4,000
# -*- coding: utf-8 -*- # # MetaTerm - A terminology management application written in Python # Copyright (C) 2013 Diego Beraldin # # 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...
diegoberaldin/MetaTerm
src/view/enum.py
Python
gpl-3.0
3,464
# -*- coding: utf-8 -*- # Copyright (c) 2016, Pierre Saikaly (saikalypierre@gmail.com) # 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/. #=======================...
PierSaik/RTE-MSDS
ProjectionDomain.py
Python
mpl-2.0
15,416
#/usr/bin/env python # author: Mylene Campana (mcampana@laas.fr) # Script which goes with hpp-rbprm-corba package. from hpp.corbaserver.rbprm.rbprmbuilder import Builder from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.corbaserver.rbprm.problem_solver import ProblemSolver from hpp.gepetto import Viewe...
mylene-campana/hpp-rbprm-corba
script/tests/kangaroo_desert_interp.py
Python
lgpl-3.0
10,460
""" Test the ProxyPlugin class""" import unittest import mock from DIRAC import S_OK, S_ERROR from DIRAC.Resources.Catalog.ConditionPlugins.ProxyPlugin import ProxyPlugin def mock_getProxyInfo(): return S_OK( { "VOMS": ["/lhcb/Role=user"], "chain": "[/DC=ch/DC=cern/OU=Organic Units...
DIRACGrid/DIRAC
src/DIRAC/Resources/Catalog/ConditionPlugins/test/Test_ProxyPlugin.py
Python
gpl-3.0
5,712
from copy import copy from . import compute __all__ = ['feature_importances'] def extend_to(list_, n): needed = n - len(list_) if needed > 0: to_add = [None] * needed return list(list_) + to_add else: return copy(list_) def fixed_length_lists(lists): max_length = max([len(...
edublancas/sklearn-evaluation
src/sklearn_evaluation/table.py
Python
mit
2,502
#!/usr/bin/env python """Utilities to generate HTML from an image. Can be called from commandline. Usage: gen_html.py image.png """ from PIL import Image import os import sys import image, dmc_colors import color_map import color def _GetTextColor(bg_color): average = sum(bg_color) / float(len(bg_color)) aver...
nanaze/pystitch
pystitch/gen_html.py
Python
apache-2.0
3,100
import re class cJsUnpacker: def unpackByString(self, sJavascript): aSplit = sJavascript.split(";',") if ";'," in sJavascript else sJavascript.split("}',") p = str(aSplit[0]) aSplit = aSplit[1].split(",") a = int(aSplit[0]) c = int(aSplit[1]) k = aSplit[2].split(".")[0].replace("'", '').split('|') ...
LaryLoose/laryloose.xbmc-addons
plugin.video.szenestreams/jsunpacker.py
Python
gpl-2.0
764
# -*- coding: utf-8 -*- """" This script summerizes how the classes structure must be, whether with mongodb or couchdb. It's not to be implemented """ """ from manage_db import * class Connection(ManageConnection): def __init__(self,db_server): pass def connect(self): pass ...
azotdata/azot-event-extractor
interface.py
Python
gpl-3.0
1,131
""" .. module:: prometheus :synopsis: Prometheus output .. moduleauthor:: Colin Alston <colin@imcol.in> """ import json import base64 from twisted.internet import defer from twisted.internet import reactor, endpoints from twisted.web.server import Site from twisted.web.resource import Resource from duct.objects...
ducted/duct
duct/outputs/prometheus.py
Python
mit
2,315
#!/usr/bin/env python # -*- coding: utf-8 -*- # -*- mode: python -*- # This file is part of opensearch. # Copyright © 2009, Dansk Bibliotekscenter a/s, # Tempovej 7-11, DK-2750 Ballerup, Denmark. CVR: 15149043 # # opensearch is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
DBCDK/opensearch
tools/check_repair_package.py
Python
gpl-3.0
18,072
from frowns import Smiles from frowns import Smarts from frowns.perception import sssr from frowns.perception import RingDetection ## '*' is ok mol=Smiles.smilin("SCCCCSCCCC",transforms=[RingDetection.sssr]) #pattern=Smarts.compile("S*CC") ##!! '~' has problem pattern=Smarts.compile("S~C~C") ##!! pattern can't match...
tuffery/Frog2
frowns/test/test_smarts_wildcards.py
Python
gpl-3.0
685
#! /usr/bin/env python """ ******************************************************************************* * * $Id: SecureDocXMLRPCServer.py 4 2008-06-04 18:44:13Z yingera $ * $URL: https://xxxxxx/repos/utils/trunk/tools/SVNRPCServer.py $ * * $Date: 2008-06-04 13:44:13 -0500 (Wed, 04 Jun 2008) $ * $Author: yin...
ActiveState/code
recipes/Python/573444_Threaded_Documenting_XML_RPC_server_over/recipe-573444.py
Python
mit
9,769