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 -*- """ Created on Thu Apr 18 15:37:41 2013 @author: Shreejoy """ import neuroelectro.models as m from fuzzywuzzy import fuzz, process from html_table_decode import resolveDataFloat import re import xlrd import numpy as np import csv from assign_metadata import validate_temp_list, vali...
neuroelectro/neuroelectro_org
db_functions/metadata_annotation_import.py
Python
gpl-2.0
9,457
from utils import TRUE, ERROR class Atom: # Empty default constructor def __init__(self): pass # String constructor for atoms @classmethod def fromString(self, string): newAtom = Atom() if '(' not in string: # no arguments newAtom.pred = stri...
ptsankov/bellog-analysis
code/atom.py
Python
gpl-3.0
2,277
#!/usr/bin/python #coding=utf8 # by luwei # begin:2013-9-11 # developing... import sys,os import types reload(sys) sys.setdefaultencoding('utf-8') #应该先转换成网络字节序 ''' b编码 ''' def req_ping_encode(dic): try: #请求ping编码 if dic.has_key('q') and dic['q'] == 'ping': return 'd1:ad2:id20:' + d...
zerleft/magnet_search
bcoder.py
Python
apache-2.0
5,993
# -*- coding: utf-8 -*- import sys from setuptools import setup from setuptools.command.test import test as TestCommand long_description = """ ============ Secretary ============ Take the power of Jinja2 templates to OpenOffice or LibreOffice and create reports and letters in your web applications. See full `documen...
smontoya/secretary
setup.py
Python
mit
1,694
from mieli.api import organization from django.db import transaction from django.conf import settings from agora.api import link @transaction.atomic def create(user, **kwargs): org = organization.get_by_username(user.username) if org == None: raise Exception("unknown organization for user '%s'" % user....
pirata-cat/mieli
agora/api/user.py
Python
agpl-3.0
1,722
"""Various file utilities.""" import os import fnmatch def locate(pattern, root=os.curdir): """Locate all files matching pattern in and below given root directory.""" for path, dirs, files in os.walk(os.path.abspath(root)): for filename in fnmatch.filter(files, pattern): yield os.path.joi...
oser-cs/oser-website
core/file_utils.py
Python
gpl-3.0
1,674
# exploratory-bibliography-06.py # # wjt # 2 feb 2007 # # http://digitalhistoryhacks.blogspot.com # chronological strata in recommendations # (I know this is really ugly and inefficient) import urllib, time import xml.dom.minidom from xml.dom.minidom import Node import pickle import anydbm def get_te...
williamjturkel/Digital-History-Hacks--2005-08-
exploratory-bibliography-06.py
Python
mit
2,200
from __future__ import unicode_literals from django.db import models from django.contrib.contenttypes.models import ContentType from guardian.exceptions import ObjectNotPersisted from guardian.models import Permission import warnings # TODO: consolidate UserObjectPermissionManager and GroupObjectPermissionManager c...
mozilla/captain
vendor/lib/python/guardian/managers.py
Python
mpl-2.0
4,947
# -*- coding: utf-8 -*- # This is a 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. # # ASE is distributed in the hope that it wil...
EhudTsivion/QCkit
atom.py
Python
lgpl-3.0
13,288
# -*- coding: utf-8 -*- ############################################################################## # # This module copyright (C) 2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
thinkopensolutions/server-tools
base_suspend_security/models/ir_rule.py
Python
agpl-3.0
1,346
# Copyright (C) 2015 Yahoo! Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
noironetworks/horizon
openstack_dashboard/dashboards/identity/identity_providers/protocols/views.py
Python
apache-2.0
1,791
import random class intDict(object): """A dictionary with integer keys""" def __init__(self, numBuckets): """Create an empty dictionary""" self.buckets = [] self.numBuckets = numBuckets for i in range(numBuckets): self.buckets.append([]) def ad...
parmarmanojkumar/MITx_Python
6002x/week2/lectureCode_intDict.py
Python
mit
1,482
#!/usr/bin/env python import csv import json import sys import click def score(company, sexbiases): """ Given a company record with board of directors and executive names, return our guess of the % of governance that is male. Since names are not always unambiguous determinants of sex, we also r...
hipsterware/scoreline
toys/corpscore.py
Python
agpl-3.0
2,066
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ import cgi from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils.datastructures import MultiValueDict fro...
JuliBakagianni/CEF-ELRC
lib/python2.7/site-packages/django/http/multipartparser.py
Python
bsd-3-clause
22,951
"""This module implements a serial bus class which talks to bioloid devices through a serial port. """ import serial from bus import Bus class SerialBus(Bus): """Implements a BioloidBus which sends commands to a bioloid device via a BioloidSerialPort. """ def __init__(self, port, baud=1000000, sho...
dhylands/bioloid3
bioloid/serial_bus.py
Python
mit
1,568
# -*- coding: utf-8 -*- """ Created on Thu Sep 5 16:24:58 2019 @author: beimx004 """ import numpy as np def channelEnergyFunc(par,X,gAgc): strat = par['parent']; startBin = strat['startBin']-1 # subtract 1 for python indexing nBinLims = strat['nBinLims']; nHop = strat['nHop'] nFrames = X.sha...
jabeim/AB-Generic-Python-Toolbox
GpyT/Filterbank/channelEnergy.py
Python
gpl-3.0
2,118
import os root_path = '/Users/CullenGao/LabWork/UbicompLab/data/raw/' import pandas as pd import numpy as np participants = [] for root, dirs, files in os.walk(root_path): for d in dirs: if d[0] == 'S': participants.append(d) # for par in participants: par = 'S01' print par write_path = '/Use...
CullenGao/LSTM_PittsRoutine
script/cat_participants.py
Python
mit
5,085
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of account_move_reconcile_helper, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # account_move_reconcile_helper is free software: # you can redi...
Vauxoo/account-financial-tools
account_move_reconcile_helper/models/account_move_line.py
Python
agpl-3.0
3,617
import argparse import os import shutil import time import math import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import torch.utils.data import torchvision.transforms as transforms import torchvision.datasets as datasets import torchvision.models as mo...
oyam/pytorch-DPNs
main.py
Python
mit
10,273
# -*- coding: utf-8 -*- # Copyright © 2014-2017 Felix Fontein # # 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,...
getnikola/plugins
v7/latex/latex/parser.py
Python
mit
59,047
# -*- coding: utf-8 -*- import unittest try: from terminal_text_color import * except ImportError: import os,sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) from terminal_text_color import TextColor class TexColorTestStyle(unittest.TestCase): def testStyle...
ElMijo/terminal-text-color-py
tests/text_color_test.py
Python
mit
5,022
# TODO : # [X] - load sequence from file # [] - use of the event sequence # [] - noise codes stimulus # ensure the divisions produce float if needed from random import shuffle, randint, random from math import ceil, cos, sin, pi class StimSeq : stimSeq = None # [ nEvent x nSymb ] stimulus code for each ti...
jadref/buffer_bci
python/signalProc/stimseq.py
Python
gpl-3.0
8,316
#!/usr/bin/env python import numpy from time import time import sys import os import gc os.chdir(os.path.dirname(sys.argv[0])) sys.path.insert(0, '..') from lib import mypaintlib, tiledsurface, brush, document, command, helpers import guicontrol # loadtxt is known to leak memory, thus we run it only once # http://pr...
dothiko/mypaint
tests/test_memory_leak.py
Python
gpl-2.0
7,613
""" This module implements the observer design pattern. It provides two decorators: observable_function observable_method which you use to make functions and methods observable by other functions and methods. For example: @observable_function def observed_func(x): print("observed_func called with arg %s...
DanielSank/observed
observed.py
Python
mit
25,883
#!/usr/bin/env python import numpy as np import cv2 from matplotlib import pyplot as plt img = cv2.imread('fruits.jpg', 1) cv2.imshow('image', img) # cv2.waitKey(0) # cv2.destroyAllWindows() blur = cv2.GaussianBlur(img, (75, 1), 0) cv2.namedWindow('blur', cv2.WINDOW_NORMAL) cv2.imshow('blur', blur) cv2.waitKey(0) c...
ultranaut/fuzzy
still.py
Python
mit
505
# (C) British Crown Copyright 2013 - 2015, Met Office # # This file is part of Iris. # # Iris 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 l...
decvalts/iris
lib/iris/tests/integration/format_interop/test_name_grib.py
Python
gpl-3.0
3,844
#!/usr/bin/python #Serendipity Brute Force (serendipity_admin.php) POC #Dork: "Powered by Serendipity" inurl:serendipity_admin.php #http://www.darkc0de.com #d3hydr8[at]gmail[dot]com import urllib2, sys, re, urllib print "\n d3hydr8[at]gmail[dot]com SerenBF v1.0" print "-------------------------------------------...
knightmare2600/d4rkc0de
bruteforce/serenbf.py
Python
gpl-2.0
1,418
"""Support NWS VTEC encoding""" import re from datetime import timezone, timedelta, datetime from pyiem.util import LOG VTEC_RE = ( r"(/([A-Z])\.([A-Z]+)\.([A-Z]+)\.([A-Z]+)\.([A-Z])\." r"([0-9]+)\.([0-9TZ]+)-([0-9TZ]+)/)" ) VTEC_CLASS = { "O": "Operational", "T": "Test", "E": "Experimental", ...
akrherz/pyIEM
src/pyiem/nws/vtec.py
Python
mit
9,773
# # 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 # distributed under...
faizan-barmawer/openstack_ironic
ironic/drivers/drac.py
Python
apache-2.0
1,355
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies and contributors # For license information, please see license.txt import frappe def run_webhooks(doc, method): '''Run webhooks for this method''' if frappe.flags.in_import or frappe.flags.in_patch or frappe.flags.in_install: return if frappe.fla...
mbauskar/frappe
frappe/integrations/doctype/webhook/__init__.py
Python
mit
1,894
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # 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 ANSIBLE_METADATA = { 'metadat...
cchurch/ansible
lib/ansible/modules/cloud/vmware/vmware_host_ssl_facts.py
Python
gpl-3.0
4,711
import os from distutils.core import setup def read_file_into_string(filename): path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: return open(filepath).read() except IOError: return '' def get_readme(): for name in ('README', 'README.r...
pkimber/search
setup.py
Python
apache-2.0
1,294
# Copyright (C) 2003 CAMP # Please see the accompanying LICENSE file for further information. from os import path try: from subprocess import Popen, PIPE except ImportError: from os import popen3 else: def popen3(cmd): p = Popen(cmd, shell=True, close_fds=True, stdin=PIPE, stdout...
robwarm/gpaw-symm
gpaw/svnversion_io.py
Python
gpl-3.0
1,339
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
inovtec-solutions/OpenERP
openerp/addons/hr_payroll/__openerp__.py
Python
agpl-3.0
2,526
import Gears as gears from .. import * class Gaussian(Component) : def applyWithArgs( self, patch, *, maxValue : 'Gaussian function peak [um].' = 1, variance : 'Gaussian variance [um].' ...
szecsi/Gears
GearsPy/Project/PatternYard/Shape/Gaussian.py
Python
gpl-2.0
803
from numpy import * import random from util import * from itertools import * from handEvaluator import evalHand import cardsDict def evalHandPair(handA, handB, unseenCards, size): complementSizeA = 5 - len(handA) complementSizeB = 5 - len(handB) sample = list(unseenCards) sampleSize = len(sample) w...
mosem/FiveOPoker
Program/monteCarloEvaluator.py
Python
mit
3,996
""" Module that contains simple client access to Matcher service """ from __future__ import absolute_import from __future__ import division from __future__ import print_function __RCSID__ = "$Id$" from DIRAC.Core.Base.Client import Client, createClient from DIRAC.Core.Utilities.DEncode import ignoreEncodeWarning from...
yujikato/DIRAC
src/DIRAC/WorkloadManagementSystem/Client/MatcherClient.py
Python
gpl-3.0
1,451
from .. import Provider as CompanyProvider class Provider(CompanyProvider): formats = ( "{{company_prefix}}{{last_name}}{{company_category}}", "{{last_name}}{{company_category}}{{company_prefix}}", ) company_prefixes = ("株式会社", "有限会社", "合同会社") company_categories = ( "水産", ...
joke2k/faker
faker/providers/company/ja_JP/__init__.py
Python
mit
762
from re import search, sub, match from os.path import join # import s2gc import s2gd # ########################### # LAMBDA FUNCTIONS ######## ########################### # match a certain expression at start of string match_start = lambda expr,line: match(r'\s*(%s)[^a-zA-Z0-9]'%expr,line) # ---------- # RECONSIDER # ...
tlienart/script2gle
s2gf.py
Python
mit
5,785
# Copyright (C) 2015 China Mobile Inc. # # zhangsong <zhangsong@cmss.chinamobile.com> # #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License version #2 as published by the Free Software Foundation. # #You should have received a copy of the GNU Gener...
liuy/sheepdog-ng
lib/shared/sheepdog.py
Python
gpl-2.0
7,707
#encoding=utf-8 __author__ = 'yang' import jieba import sys reload(sys) sys.setdefaultencoding('utf8') def application(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) body = environ['PATH_INFO'][1:] l = jieba.cut(body,cut_all=False) r = '--'.join(l) return [...
ningmo/pynote
fenci/fenci.py
Python
agpl-3.0
339
import array import ctypes import os import struct import sys import win32api import win32con import win32gui from pytank.Elements import ComboBox,Edit,getListboxItems,ListView,SendKeys,Control,findControls,RightClickMenu,ListBox from pytank.Applications import * from pytank.Buttons import * from pytank.SystemFunctions...
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/elan/__OLD_SCRIPTS/runnner_Upgrade.py
Python
gpl-3.0
1,481
#!/usr/bin/env python # encoding: utf-8 """Find and (optionally) delete corrupt Whisper data files""" from __future__ import absolute_import, print_function, unicode_literals import argparse import os import sys import whisper def walk_dir(base_dir, delete_corrupt=False, verbose=False): for dirpath, dirnames, f...
kerlandsson/whisper
bin/find-corrupt-whisper-files.py
Python
apache-2.0
1,830
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 5, transform = "Quantization", sigma = 0.0, exog_count = 20, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_Quantization/trend_LinearTrend/cycle_5/ar_/test_artificial_1024_Quantization_LinearTrend_5__20.py
Python
bsd-3-clause
270
# -*- coding: utf-8 -*- #---------------------------------------------------------------------------- # A modRana module providing various kinds of information. #---------------------------------------------------------------------------- # Copyright 2007, Oliver White # # This program is free software: you can redistr...
ryfx/modrana
modules/mod_info.py
Python
gpl-3.0
10,055
"Memcached cache backend" import pickle import re import time from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.utils.functional import cached_property class BaseMemcachedCache(BaseCache): def __init__(self, server, params, library, value_not_found_exception): super().__...
theo-l/django
django/core/cache/backends/memcached.py
Python
bsd-3-clause
7,977
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Example program integrating an IVP problem of van der Pol oscillator """ from __future__ import (absolute_import, division, print_function) import numpy as np from pygslodeiv2 import integrate_adaptive, integrate_predefined def get_f_and_j(mu): def f(t, y, dyd...
bjodah/pygslodeiv2
examples/van_der_pol.py
Python
gpl-3.0
1,587
from .__about__ import __version__ from .portworx import PortworxCheck __all__ = ['__version__', 'PortworxCheck']
DataDog/integrations-extras
portworx/datadog_checks/portworx/__init__.py
Python
bsd-3-clause
115
from django.template.defaultfilters import slugify from ztree.models import Node #from ztree.signals import tree_content_created, tree_content_updated from ztree.utils import filter_and_clean_fields, dispatch_request_json from ztreecrud.component.slugutils import SlugUtil from akuna.component import get_component from...
stana/django-ztree
ztreecrud/component/factories.py
Python
mit
9,111
#!/usr/bin/env python # # 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 "Lic...
centic9/subversion-ppa
tools/server-side/svnpubsub/svnpubsub/server.py
Python
apache-2.0
7,427
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
zwanli/bioconda-recipes
recipes/searchgui/2.1.4/searchgui.py
Python
mit
2,612
# Copyright 2021 The Pigweed Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
google/pigweed
pw_package/py/pw_package/packages/boringssl.py
Python
apache-2.0
2,720
# -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> A Concluder """ #<DefineAugmentation> import ShareYourSystem as SYS BaseModuleStr="ShareYourSystem.Standards.Objects.Conditioner" DecorationModuleStr="ShareYourSystem.Standards.Classors.Teste...
Ledoux/ShareYourSystem
Pythonlogy/draft/Concluder/__init__.py
Python
mit
1,598
from dream.core.tests.models import *
alumarcu/dream-framework
dream/core/tests/__init__.py
Python
gpl-3.0
38
#!/usr/bin/env python3.2 # # Copyright (c) Net24 Limited, Christchurch, New Zealand 2011-2012 # and Voyager Internet Ltd, New Zealand, 2012-2013 # # This file is part of py-magcode-core. # # Py-magcode-core is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
onlinepcwizard/dms
dms/database/zi_copy.py
Python
gpl-3.0
5,748
# -*- coding: utf-8 -*- # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import test_delivery_auto_refresh
OCA/carrier-delivery
delivery_auto_refresh/tests/__init__.py
Python
agpl-3.0
131
# -*- coding: utf-8 -*- # # test_disconnect.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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...
apeyser/nest-simulator
pynest/nest/tests/test_sp/test_disconnect.py
Python
gpl-2.0
4,073
from __future__ import division, print_function, unicode_literals from tech_const import * screen_scale = 2 tile_names = ['floor', 'lava', 'wall', 'treasure', 'orc_weak', 'orc_strong', 'smoke', 'fly_weak', 'fly_strong'] hero_stat = ['health', 'int', 'exp'] heroes = ['wizard', 'priest', 'warrior', 'rogue'] Exp...
PFML239/Dungeon-defenders
const.py
Python
mit
4,310
import six import logging from driver.connection import Connection from driver.exceptions import * from driver.protocol import * log = logging.getLogger(__name__) class Client(object): """ Memcached client implementation with simple get and set methods Args: server: Connection parameters Prov...
mgobec/python-memcached
driver/client.py
Python
apache-2.0
5,424
import sys import numpy as np from ..pakbase import Package from ..utils import Util3d class Mt3dRct(Package): """ Chemical reaction package class. Parameters ---------- model : model object The model object (of type :class:`flopy.mt3dms.mt.Mt3dms`) to which this pac...
bdestombe/flopy-1
flopy/mt3d/mtrct.py
Python
bsd-3-clause
26,430
import re from models.contact import Contact def test_all_contacts_on_homepage(app, db): if app.contact.count() == 0: app.contact.add(Contact(first_name="Mister", last_name="Muster", mobile_phone="123", email_1="test@test.com")) contacts_from_homepage = sorted(app.contact.get_contact_list(), key = Cont...
rgurevych/python_for_testers
tests/test_contacts_data_compliance.py
Python
apache-2.0
3,163
from hazelcast.future import ImmediateFuture, Future from hazelcast.protocol.codec import ( ringbuffer_add_all_codec, ringbuffer_add_codec, ringbuffer_capacity_codec, ringbuffer_head_sequence_codec, ringbuffer_read_many_codec, ringbuffer_read_one_codec, ringbuffer_remaining_capacity_codec, ...
hazelcast/hazelcast-python-client
hazelcast/proxy/ringbuffer.py
Python
apache-2.0
15,194
# _logger.py import logging import _database as _db __version__ = '0.0.1' class SQLAlchemyHandler(logging.Handler): # A very basic logger that commits a LogRecord to the SQL Db def emit(self, record): session = _db.ConnectToDatabase() log = _db.Log( logger=record.__dict__['filen...
Hakugin/TimeClock
_logger.py
Python
gpl-2.0
581
# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the h...
zeratul2099/crypt_app
crypto/views.py
Python
gpl-3.0
3,975
# pyOCD debugger # Copyright (c) 2015-2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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...
mbedmicro/pyOCD
test/test_util.py
Python
apache-2.0
8,912
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
skosukhin/spack
var/spack/repos/builtin/packages/hsakmt/package.py
Python
lgpl-2.1
1,639
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyNistats(PythonPackage): """Modeling and Statistical analysis of fMRI data in Python.""" ...
LLNL/spack
var/spack/repos/builtin/packages/py-nistats/package.py
Python
lgpl-2.1
1,272
""" The Plaid API The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from plaid.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, ModelNormal...
plaid/plaid-python
plaid/model/transactions_rule_details.py
Python
mit
7,204
# ------------------------------------------------------------------------------ # Config # ------------------------------------------------------------------------------ import os class BaseConfig(): basedir = os.path.abspath(os.path.dirname(__file__)) # Should the application be in debug mode? DEBU...
wazts/user-manager
config.py
Python
gpl-2.0
663
"""image_tools.py - Various image manipulations.""" import sys import os import operator import itertools import bisect import gtk import Image import ImageEnhance import ImageOps from mcomix.preferences import prefs # File formats supported by PyGTK (sorted list of extensions) _supported_formats = sorted( [ ext...
HoverHell/mcomix-0
mcomix/image_tools.py
Python
gpl-2.0
15,226
# Copyright 2020 The Kubeflow Authors # # 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...
kubeflow/pipelines
sdk/python/kfp/compiler_cli_tests/test_data/two_step_pipeline.py
Python
apache-2.0
2,004
"""Support for Start.ca Bandwidth Monitor.""" from datetime import timedelta from xml.parsers.expat import ExpatError import logging import async_timeout import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_API_KEY, CONF_MONITORED_VARIABLES, C...
aequitas/home-assistant
homeassistant/components/startca/sensor.py
Python
apache-2.0
6,361
from setuptools import setup, find_packages setup(name='BIOMD0000000122', version=20140916, description='BIOMD0000000122 from BioModels', url='http://www.ebi.ac.uk/biomodels-main/BIOMD0000000122', maintainer='Stanley Gu', maintainer_url='stanleygu@gmail.com', packages=find_packages(...
biomodels/BIOMD0000000122
setup.py
Python
cc0-1.0
377
"""Functions to parse datetime objects.""" # We're using regular expressions rather than time.strptime because: # - They provide both validation and parsing. # - They're more flexible for datetimes. # - The date/datetime/time constructors produce friendlier error messages. import datetime import re from dj...
yephper/django
django/utils/dateparse.py
Python
bsd-3-clause
4,122
from unittest import TestCase from gtfspy.routing.profile_block_analyzer import ProfileBlockAnalyzer from gtfspy.routing.profile_block import ProfileBlock class TestProfileBlockAnalyzer(TestCase): def test_interpolate(self): blocks = [ProfileBlock(0, 1, 2, 1), ProfileBlock(1, 2, 2, 2)] analyzer =...
CxAalto/gtfspy
gtfspy/routing/test/test_profile_block_analyzer.py
Python
mit
751
""" This is not really a package init file, it is only here to simplify the packaging and installation of pubsub.core's protocol-specific subfolders by setuptools. The python modules in this folder are automatically made part of pubsub.core via pubsub.core's __path__. Hence, this should not be imported directly, it is...
garrettcap/Bulletproof-Backup
wx/lib/pubsub/core/kwargs/__init__.py
Python
gpl-2.0
646
""" Test the pipeline module. """ import numpy as np from scipy import sparse from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regex from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert...
potash/scikit-learn
sklearn/tests/test_pipeline.py
Python
bsd-3-clause
24,571
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^', include('timeslot_lottery.urls')), )
Velmont/django-timeslot-lottery
example/example/urls.py
Python
gpl-3.0
211
# -*- coding: utf-8 -*- # Copyright (c) 2010 OpenStack Foundation. # # 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 app...
openstack/neutron-vpnaas
doc/source/conf.py
Python
apache-2.0
8,813
""" WSGI config for wawhfd project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTI...
calebrash/wawhfd
wawhfd/wsgi.py
Python
mit
390
import os from AbstractRootModel import AbstractRootModel import pytumblr import PostModel from Settings import Settings class BlogModel(AbstractRootModel): def __init__(self, account): self.client = pytumblr.TumblrRestClient(Settings.OAUTH_CONSUMER, Settings.SECRET) self.account = account ...
bpeck/tumblr-display
src/models/BlogModel.py
Python
apache-2.0
2,405
import inflect import re _inflect = inflect.engine() _comma_number_re = re.compile(r'([0-9][0-9\,]+[0-9])') _decimal_number_re = re.compile(r'([0-9]+\.[0-9]+)') _pounds_re = re.compile(r'£([0-9\,]*[0-9]+)') _dollars_re = re.compile(r'\$([0-9\.\,]*[0-9]+)') _ordinal_re = re.compile(r'[0-9]+(st|nd|rd|th)') _number_re =...
keithito/tacotron
text/numbers.py
Python
mit
2,117
from rest_framework import routers from . import views router = routers.DefaultRouter(trailing_slash=False) router.register(r'complaints', views.ComplaintViewSet) urlpatterns = router.urls
danjac/ownblock
ownblock/ownblock/apps/complaints/urls.py
Python
mit
192
# 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...
annarev/tensorflow
tensorflow/python/ops/embedding_ops_test.py
Python
apache-2.0
2,458
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function """ Notes ---- Tests must be updated if wordnet file changes. Tests made for wordnet version kb69-a. """ import unittest import sys, os from ..wordnet import wn, eurown class InternalSynsetOffsetQueryTest(unittest.TestCase)...
estnltk/estnltk
estnltk/tests/test_wordnet.py
Python
gpl-2.0
6,503
#!/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...
SRabbelier/Melange
thirdparty/google_appengine/google/net/proto/ProtocolBuffer.py
Python
apache-2.0
14,205
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from foo_receiver import FooReceiver from foo_listener_bf import FooListenerBfHelper from PyCFFIlib_cffi import ffi, lib import gc class FooListenerBfImpl: def delete_fl_in_fl(self): print ("Not to b...
trafi/djinni
test-suite/handwritten-src/python/test_proxying.py
Python
apache-2.0
5,511
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/client_rpc.py # # 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...
drptbl/king-phisher
king_phisher/client/client_rpc.py
Python
bsd-3-clause
8,698
from django.shortcuts import get_object_or_404 from rest_framework.decorators import action from rest_framework.parsers import MultiPartParser, FormParser from astrobin_apps_equipment.api.filters.accessory_edit_proposal_filter import AccessoryEditProposalFilter from astrobin_apps_equipment.api.serializers.accessory_ed...
astrobin/astrobin
astrobin_apps_equipment/api/views/accessory_edit_proposal_view_set.py
Python
agpl-3.0
1,662
# -*- coding: utf-8 ; mode: python -*- # # 冗長な線を削除する # # Copyright (C) 2015 Fujitsu # Copyright (C) 2017 DA Symposium from nlcheck import NLCheck import numpy as np def distance(line_mat, xmat): "距離を数え上げる" xd = np.full( xmat.shape, -1, np.integer ) # 距離の行列。初期値-1 # 始点の距離を0とする for i in range(0, line...
dasadc/conmgr
server/nlclean.py
Python
bsd-3-clause
5,834
# Copyright (c) 2009, Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 abov...
166MMX/openjdk.java.net-openjfx-8u40-rt
modules/web/src/main/native/Tools/Scripts/webkitpy/common/system/executive.py
Python
gpl-2.0
21,626
#!/usr/bin/python import os import sys import urlparse import logging import hashlib import json import importlib import glob from optparse import OptionParser import redis from twisted.words.protocols import irc from twisted.internet import ssl, reactor, protocol from werkzeug.routing import Map, DEFAULT_CONVERT...
twexler/diatribe
diatribe/bot/__main__.py
Python
gpl-2.0
8,361
#!/usr/bin/env python import os import requests import json import sys from pprint import pprint url = 'http://api.zonza.tv:8080/v0/' def raise_invalid(): raise RuntimeError('Credentials not configured. Please set ' \ 'env variables BORK_TOKEN and BORK_USERNAME') auth = { ...
zonza/zonza-api-examples
python/download_thumbnails.py
Python
mit
955
# # toolkit.py -- module for customizing Ginga GUI toolkit version # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # toolkit = 'choose' family = None class ToolKitErro...
Rbeaty88/ginga
ginga/toolkit.py
Python
bsd-3-clause
1,327
#/usr/bin/python # # Copyright 2013 Luke Hackett # https://github.com/LukeHackett # # 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 ...
LukeHackett/python-pi-cookbook
reactor/reactor.py
Python
apache-2.0
824
"""Test event helpers.""" # pylint: disable=protected-access import asyncio from datetime import datetime, timedelta from unittest.mock import patch from astral import Astral import pytest from homeassistant.core import callback from homeassistant.setup import async_setup_component import homeassistant.core as ha fro...
jnewland/home-assistant
tests/helpers/test_event.py
Python
apache-2.0
23,251
from .. import tool def test_keygen(): def get_keyring(): WheelKeys, keyring = tool.get_keyring() class WheelKeysTest(WheelKeys): def save(self): pass class keyringTest: backend = keyring.backend class backends: ...
ARMmbed/yotta_osx_installer
workspace/lib/python2.7/site-packages/wheel/test/test_tool.py
Python
apache-2.0
819
from secret import GOOGLE_API_KEY from datetime import datetime from util.arguments import Arguments from discord.ext import commands from shlex import split from util.choices import enum from collections import namedtuple import util import re import urllib import discord class Portables: def __init__(self, bot...
duke605/RunePy
commands/portables.py
Python
mit
4,554
import unittest from conans.tools import SystemPackageTool, replace_in_file import os from conans.test.utils.test_files import temp_folder from conans import tools class RunnerMock(object): def __init__(self): self.command_called = None def __call__(self, command, output): self.command_calle...
dragly/conan
conans/test/tools_test.py
Python
mit
3,849
# -*- coding: utf-8 -*- # (c) 2012-2014 Michal Kalewski <mkalewski at cs.put.poznan.pl> # # This file is a part of the Simple Network Simulator (sim2net) project. # USE, MODIFICATION, COPYING AND DISTRIBUTION OF THIS SOFTWARE IS SUBJECT TO # THE TERMS AND CONDITIONS OF THE MIT LICENSE. YOU SHOULD HAVE RECEIVED A COP...
mkalewski/sim2net
docs/conf.py
Python
mit
7,543