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
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' from tinycss.css21 import CSS21Parser from tinycss.parsing import remove_whit...
nozuono/calibre-webserver
src/tinycss/media3.py
Python
gpl-3.0
4,645
import math from ..df import DocumentFrequencyVectorCreator from . import InverseDocumentFrequencyVector class InverseDocumentFrequencyVectorCreator(DocumentFrequencyVectorCreator): """Creates inverse-document-frequency vectors Inherits from :class:`recommender.vector.abstractvector.VectorCreator` :par...
dustywind/bachelor-thesis
impl/recommender/vector/idf/inversedocumentfrequencyvectorcreator.py
Python
mit
2,882
# # Copyright 2013 Quantopian, 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 wr...
licco/zipline
zipline/errors.py
Python
apache-2.0
4,242
# $Id: saslprofile.py,v 1.8 2004/09/28 01:19:20 jpwarren Exp $ # $Revision: 1.8 $ # # BEEPy - A Python BEEP Library # Copyright (c) 2002-2004 Justin Warren <daedalus@eigenmagic.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public...
Wurldtech/beepy
beepy/profiles/saslprofile.py
Python
lgpl-2.1
3,491
# -*- coding: utf-8 -*- from datetime import datetime import bcrypt import hashlib import os import uuid from flask import current_app as app from flask.ext.sqlalchemy import SQLAlchemy from itsdangerous import (BadSignature, SignatureExpired, TimedJSONWebSignatureSerializer as Serializer) fr...
maurodelazeri/shiva-server
shiva/models.py
Python
mit
15,321
# -*- coding:utf-8 -*- ## @package JsMVA.JsMVAMagic # @author Attila Bagoly <battila93@gmail.com> # IPython magic class for JsMVA from IPython.core.magic import Magics, magics_class, line_magic from IPython.core.magic_arguments import argument, magic_arguments, parse_argstring @magics_class class JsMVAMagic(Magics...
Y--/root
bindings/pyroot/JsMVA/JsMVAMagic.py
Python
lgpl-2.1
1,182
# # Copyright 2014 Grupo de Sistemas Inteligentes (GSI) DIT, UPM # # 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 # # Unles...
gsi-upm/senpy
senpy/version.py
Python
apache-2.0
1,082
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from rasa_core.featurizers import Featurizer, BinaryFeaturizer, \ ProbabilisticFeaturizer import numpy as np def test_fail_to_load_non_existent_featurizer(): as...
deepak02/rasa_core
tests/test_featurizer.py
Python
apache-2.0
1,453
import unittest2 as unittest from mock import Mock, patch from time import time import sys from os.path import dirname, abspath sys.path.insert(0, dirname(dirname(abspath(__file__))) + '/src') sys.path.insert(0, dirname(dirname(abspath(__file__))) + '/src/analyzer') import algorithms import settings class TestAlgo...
sdgdsffdsfff/skyline
tests/algorithms_test.py
Python
mit
3,680
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2013 jmesteve All Rights Reserved # https://github.com/jmesteve # <jmesteve@me.com> # # This program is...
jmesteve/openerpseda
openerp/addons_extra/purchase_draft/__init__.py
Python
agpl-3.0
1,129
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from canvas.redis_models import redis, RedisSet class Migration(DataMigration): def forwards(self, orm): User = orm['auth.User'] for x in range(40): day =...
canvasnetworks/canvas
website/canvas/migrations/0138_populate_daily_signup_uniques.py
Python
bsd-3-clause
19,964
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Author: Enrique Henestroza Anguiano # """ DTBParser utility constants, dictionaries, etc. """ import re import unicodedata import copy import sys import os # Enumerate CONLL fields (with some added ones) CONLLNUM = 15 ID,TOK,LEM,CPS,FPS,FEAT,GOV,LAB,MAP,GOLD,LCH,RCH,...
enhean/fredist
src/fredist/dtbutils.py
Python
gpl-3.0
11,833
__author__ = 'sibirrer' import numpy as np import pickle import os.path from scipy import integrate import astrofunc.util as util class BarkanaIntegrals(object): def I1(self, nu1, nu2, s_, gamma): """ integral of Barkana et al. (18) :param nu2: :param s_: :param gamma: ...
sibirrer/astrofunc
astrofunc/LensingProfiles/barkana_integrals.py
Python
mit
6,043
#!/usr/bin/python3 # -*- coding: utf-8 -*- # superuser.py file is part of slpkg. # Copyright 2014-2021 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # All rights reserved. # Slpkg is a user-friendly package manager for Slackware installations # https://gitlab.com/dslackw/slpkg # Slpkg is free software: you can redi...
dslackw/slpkg
slpkg/superuser.py
Python
gpl-3.0
1,096
## Copyright 2003-2006 Luc Saffre ## This file is part of the Lino project. ## Lino 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...
MaxTyutyunnikov/lino
obsolete/src/lino/adamo/ddl.py
Python
gpl-3.0
1,364
import theano import theano.tensor as T import numpy as np import sys sys.path.insert(0, '../data_loader/') import load from theano.tensor.nnet.conv import conv2d from theano.tensor.signal.downsample import max_pool_2d # load data x_train, t_train, x_test, t_test = load.cifar10(dtype=theano.config.floatX, grayscale=F...
JBed/Simple_Theano
4_simple_conv_net/better_conv_net.py
Python
apache-2.0
2,609
#!/usr/bin/python #-*- encoding: utf8 -*- import random import json import threading import rospy from std_msgs.msg import String from geometry_msgs.msg import PointStamped from mhri_msgs.msg import RaisingEvents, GazeCommand from mhri_msgs.srv import ReadData, ReadDataRequest GAZE_CONTROLLER_PERIOD = 0.2 GLANCE_TI...
mhri/mhri
behaviors/src/gaze_node.py
Python
apache-2.0
9,941
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-10 10:45 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('channels', '0067_auto_20170306_2042'), ] operations = [ migrations.AlterFie...
onaio/rapidpro
temba/channels/migrations/0068_junebug_ussd_channel_type.py
Python
agpl-3.0
1,381
# Copyright (c) 2011 OpenStack, LLC # Copyright (c) 2015 Rushil Chugh # Copyright (c) 2015 Clinton Knight # 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 # # ...
NetApp/manila
manila/tests/scheduler/test_host_manager.py
Python
apache-2.0
39,720
import _plotly_utils.basevalidators class XValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="x", parent_name="bar", **kwargs): super(XValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, anim=kwargs.pop("...
plotly/python-api
packages/python/plotly/plotly/validators/bar/_x.py
Python
mit
480
# -*- coding: utf-8 -*- # # Copyright (c) 2014-2015 Université Catholique de Louvain. # # This file is part of INGInious. # # INGInious 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 o...
layus/INGInious
frontend/custom/tasks_code_boxes.py
Python
agpl-3.0
3,326
############################################################################## # 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/fastphase/package.py
Python
lgpl-2.1
1,682
# -*- coding: UTF-8 -*- """Common Python2/3 compatibility functions. """ from six import binary_type, string_types, text_type, u from .constants import PYTHON3 __all__ = __features__ = ["b", "binary_type", "byteindex", "execfile", "ensure_binary", "ensure_str", "iterbytes", ...
dhondta/tinyscript
tinyscript/helpers/compat.py
Python
agpl-3.0
2,210
from __future__ import unicode_literals # -*- coding: utf-8 -*- # # pypackager documentation build configuration file, created by # sphinx-quickstart on Wed May 29 12:34:22 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are pr...
fcurella/python-packager
pypackager/template/docs/conf.py
Python
mit
8,109
# del name x = 1 print(x) del x try: print(x) except NameError: print("NameError") try: del x except: # NameError: # FIXME uPy returns KeyError for this print("NameError") class C: def f(): pass
rubencabrera/micropython
tests/basics/del_name.py
Python
mit
229
# Copied from django with some modifications import copy class MultiValueDict(dict): """ A subclass of dictionary customized to handle multiple values for the same key. >>> d = MultiValueDict({'name': ['Adrian', 'Simon'], 'position': ['Developer']}) >>> d['name'] 'Simon' >>> d.getlist('na...
RaceList/tours
util.py
Python
mit
5,548
import os import codecs from setuptools import setup def read(*parts): filename = os.path.join(os.path.dirname(__file__), *parts) with codecs.open(filename, encoding='utf-8') as fp: return fp.read() setup( name="django-queued-storage", use_scm_version=True, setup_requires=['setuptools_sc...
melfelr/django-queued-storage
setup.py
Python
bsd-3-clause
1,198
"""Functions for handling encoded word headers. Copyright 2012 Steve Jones This file is part of mdtools. mdtools 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 opti...
SteveJones/mdtools
encoded_word.py
Python
gpl-3.0
1,556
from decimal import Decimal from django.apps import apps from django.core import checks from django.db import models from django.test import TestCase, skipIfDBFeature from django.test.utils import isolate_apps from .models import Bar, FkToChar, Foo, PrimaryKeyCharModel class ForeignKeyTests(TestCase): def test...
reinout/django
tests/model_fields/test_foreignkey.py
Python
bsd-3-clause
3,762
import os import logging from collections import defaultdict from fs.errors import ResourceNotFound from lml.plugin import PluginManager from moban import constants, exceptions from moban.core import utils from moban.externals import reporter, file_system from moban.deprecated import deprecated_moban_path_notation fr...
chfw/moban
moban/core/moban_factory.py
Python
mit
12,277
#!/usr/bin/env python import ConfigParser, os, smtplib, time try: from email.mime.text import MIMEText except ImportError: from email.MIMEText import MIMEText config = ConfigParser.ConfigParser({'expectedRunningTime' : '-1', 'mailServer' : '', 'runningTimeAllowedDelay' : '0'}) config.read([ os.path.join(os.pa...
ctb/pygr
tests/tools/send_megatest_email.py
Python
bsd-3-clause
3,607
### # Use functions that contain SELECT. INSERT, UPDATE, DELETE # on a table for which the USER has GRANTs (possible). ### import os, sys try: from MonetDBtesting import process except ImportError: import process clt = process.client('sql', user = 'my_user', passwd = 'p1', stdin = open(os...
zyzyis/monetdb
sql/test/Users/Tests/test_privs2_p1.SQL.py
Python
mpl-2.0
527
# coding=utf-8 """Episode classes.""" from __future__ import unicode_literals import logging import os.path import re import time import traceback import warnings from builtins import str from datetime import date, datetime import knowit from medusa import ( app, db, helpers, network_timezones, ...
pymedusa/Medusa
medusa/tv/episode.py
Python
gpl-3.0
87,172
""" ydf/utils ~~~~~~~~~ Contains utility functions that have no better home. """ def merge_maps(*maps): """ Merge the given a sequence of :class:`~collections.Mapping` instances. :param maps: Sequence of mapping instance to merge together. :return: A :class:`dict` containing all merged m...
ahawker/ydf
ydf/utils.py
Python
apache-2.0
411
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
cherrygirl/micronaet7
production_line/product.py
Python
agpl-3.0
16,351
import hashlib import string import random class Security(object): def __init__(self, dependencies): self.config = dependencies.getConfiguration() def hashPassword(self, password, secret=None): if secret is None: secret = self.config.password_secret secretpw = secret + pa...
ilogue/scrolls
scrolls/security.py
Python
mit
1,232
#!/usr/bin/env python """ master script to control different operations in training examples generating pipeline. usage: python experiment_run.py <YAML config> -h sample yaml config file located at config/ requirement: pygridtools for distributed computing packages/modules depends on the operation...
vipints/genomeutils
experiment_run.py
Python
bsd-3-clause
29,698
from .admin_dev_i18n import * from .update_to_db import *
vinoth3v/In
In/stringer/admin/page/__init__.py
Python
apache-2.0
58
# Copyright 2010-2012 RethinkDB, all rights reserved. import os import socket import time import socket # pythonic discriminated union I guess, this is kind of retarded. # actually 0 need for a base class it's really more like a comment # that happens to be runable code class RunError(Exception): def __init__(se...
KSanthanam/rethinkdb
scripts/VirtuaBuild/vm_build.py
Python
agpl-3.0
10,209
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ firebat-manager.test.models ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Objects mapping for blueprint """ from datetime import datetime from sqlalchemy import * from .. import db class Status(db.Model): __tablename__ = 'status' id = Column(Integer, primary_key=True) ...
greggyNapalm/firebat-manager
firemanager/test/models.py
Python
bsd-3-clause
986
from firehose.model import Issue, Message, File, Location, Point import re LINE_EXPR = re.compile(r"(?P<path>.*): (?P<severity>.*): (?P<msg>.*)") def parse_desktop_file_validate(lines): for line in lines: info = LINE_EXPR.match(line).groupdict() path = info['path'] message = info['msg'] ...
paultag/ethel
ethel/wrappers/desktop_file_validate.py
Python
mit
735
#!/usr/bin/python # Compresses the core Blockly files into a single JavaScript file. # # Copyright 2012 Google Inc. # http://blockly.googlecode.com/ # # 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 Licen...
sernaleon/charlie
Others/BlocklyProbatinas/hello/www/build.py
Python
apache-2.0
14,864
# Copyright 2018 The TensorFlow Probability 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 o...
tensorflow/probability
tensorflow_probability/python/bijectors/rational_quadratic_spline.py
Python
apache-2.0
17,963
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import sys import csv import json import random from elasticsearch import Elasticsearch, RequestsHttpConnection from datetime import datetime import sys import csv from requests_aws4auth import AWS4Auth from awsconfig import ESHOST, REGION from nocheckin import aws_acc...
taosheng/jarvis
chatbot/src/esBible.py
Python
apache-2.0
1,837
print input() + -input()
cantora/pyc
p0tests/grader_tests/input_1.py
Python
gpl-3.0
25
''' A Recurrent Neural Network (LSTM) implementation example using TensorFlow library. This neural network is used to compress the state matrix into a representation that is useful for the actor and the critic. The weights of this network should be trained along with the actor and the critic. Author: Max Ferguson ''...
maxkferg/smart-city-model
modules/collision/dqn/oracle.py
Python
gpl-3.0
2,075
#!/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...
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/google/appengine/tools/api_server.py
Python
bsd-3-clause
33,071
""" Provides common functions for the CVE-Builder script. The script provides functionality for both TAXII inboxing aswell as using NCSC's custom adapter inbox. """ import json import requests from cabby import create_client def _construct_headers(): headers = { 'Content-Type': 'application/xml', ...
cwtaylor/cve-builder
functions.py
Python
gpl-3.0
1,023
# (c) 2018, NetApp Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import json from ansible.modules.storage.netapp.netapp_e_alerts import Alerts from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args __metaclass__ = type from...
caphrim007/ansible
test/units/modules/storage/netapp/test_netapp_e_alerts.py
Python
gpl-3.0
7,496
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Utilities for retrieving revision information from a project's git repository. """ # Do not remove the following comment; it is used by # astropy_helpers.version_helpers to determine the beginning of the code in # this module # BEGIN import os imp...
eteq/astropy-helpers
astropy_helpers/git_helpers.py
Python
bsd-3-clause
3,411
if 'variavel' in locals(): if 'variavel' in globals(): if hasattr(objeto, 'variavel'): #https://pt.stackoverflow.com/q/50206/101
maniero/SOpt
Python/Reflection/Variable.py
Python
mit
136
import asyncio import logging import uuid from zope.interface import implementer import aioamqp from aioamqp.exceptions import (AmqpClosedConnection, ChannelClosed, ConsumerCancelled) from apium import registry from apium.interfaces import IBroker, ISeri...
mardiros/apium
apium/broker/amqp.py
Python
bsd-3-clause
7,312
#!/usr/bin/env python # # mallard2man.py # # Copyright (C) 2014 MongoDB, Inc. # # 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 ...
mschoenlaub/mongo-c-driver
doc/mallard2man.py
Python
apache-2.0
13,664
# -*- coding: utf-8 -*- # # cloudtracker documentation build configuration file, created by # sphinx-quickstart on Fri Aug 5 12:45:40 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
freedryk/cloudtracker
doc/conf.py
Python
bsd-2-clause
7,125
import unittest # O(n) class Solution: def isOneBitCharacter(self, bits): """ :type bits: List[int] :rtype: bool """ is_one_bit = False i = 0 while i < len(bits): is_one_bit = not bits[i] i += 1 if is_one_bit else 2 return is_...
chrisxue815/leetcode_python
problems/test_0717.py
Python
unlicense
639
import numpy import pylab from scipy.optimize import curve_fit import math import scipy.stats f, V, dV, I, dI = pylab.loadtxt("C:\\Users\\marco\\Desktop\\Laboratorio3\\Fotoelettrico\\datiBluasintoto.txt", unpack = True) def ff(x, a ,b): return a*x + b popt = (0, -2) pars, covm = curve_fit(ff, V, I, popt, dI, abs...
fedebell/Laboratorio3
Fotoelettrico/fitasintotoretta.py
Python
gpl-3.0
794
#----------------------------------------------------------------------------- # Copyright 2012-2016 Claude Zervas # email: claude@utlco.com #----------------------------------------------------------------------------- """ 2D geometry package. Parts of this library where inspired by planar, a 2D geometry library for ...
utlco/tcnc
tcnc/geom/__init__.py
Python
lgpl-3.0
725
# Copyright 2017 AT&T 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/licenses/LICENSE-2.0 # # Unless required by ap...
openstack/tempest
tempest/tests/lib/services/identity/v3/test_endpoint_filter_client.py
Python
apache-2.0
10,199
import argparse import sys from os import listdir, system from os.path import isfile, join from timeit import default_timer as timer def list_only_files(src_dir): return filter(lambda f: f[0] != ".", [f for f in listdir(src_dir) if isfile(join(src_dir, f))]) def remove_txt_files(file_list): return filter(lambda f: f[...
mindcont/OpenSource
Facebook/Surround360/surround360_render/scripts/arrange_dataset.py
Python
cc0-1.0
3,410
from amqpstorm import Channel from amqpstorm import exception from amqpstorm.queue import Queue from amqpstorm.tests.utility import FakeConnection from amqpstorm.tests.utility import TestFramework class QueueExceptionTests(TestFramework): def test_queue_declare_invalid_parameter(self): channel = Channel(0...
eandersson/amqpstorm
amqpstorm/tests/unit/queue/test_queue_exception.py
Python
mit
4,192
from cactusbot.packets import MessagePacket from cactusbot.services.beam.parser import BeamParser def test_parse_message(): assert BeamParser.parse_message({ 'channel': 2151, 'id': '7f43cca0-a9c5-11e6-9c8f-6bd6b629c2eb', 'message': { 'message': [ {'data': 'Hell...
CactusBot/CactusBot
tests/services/test_beam.py
Python
gpl-3.0
9,641
# -*- coding: utf-8 -*- __author__ = 'David Gowers' __email__ = 'finticemo@gmail.com' __version__ = '0.1.0'
0ion9/tmsoup
tmsoup/__init__.py
Python
lgpl-3.0
109
#!/usr/bin/env python """ here i wanna implement several helper functions for displaying calendar on user's terminal screen. """ from datetime import date from datetime import timedelta import shlex import subprocess class CommandStderrException(Exception): pass def get_output_from_command(command): parsed_c...
littleq0903/git-calendar
git_calendar/utils.py
Python
mit
3,829
from functools import wraps def lazy(func): cache = {} @wraps(func) def wrap(*args, **kwargs): key = (args, tuple(kwargs.items())) if key not in cache: cache[key] = func(*args, **kwargs) return cache[key] return wrap def lazy_property(func): canary = object...
dacjames/croi
croi/decorators.py
Python
mit
643
# -*- coding: utf-8 -*- import pytest import threading from .test_client import service def test_read_write(service, servicename, keyword_name): """Test a write method.""" from Cauldron.ktl.procedural import read, write write(servicename, keyword_name, "10") assert read(servicename, keyword_name)...
alexrudy/Cauldron
Cauldron/tests/test_client_procedural.py
Python
bsd-3-clause
2,094
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jul 2 18:59:49 2017 @author: Cezar """ import csv import pandas from sklearn.ensemble import RandomForestClassifier from sklearn.preprocessing import LabelEncoder from sklearn.cross_validation import train_test_split from sklearn.metrics import accura...
darknerd/SIN5017-Data-Mining
methods/RF.py
Python
mit
2,829
# -*- coding: utf-8 -*- """ Created on Wed Nov 02 18:04:05 2016 @author: Viktor """ import numpy as np from skimage.io import imread from skimage.io import imshow from skimage.color import rgb2gray from skimage.filters.rank import otsu from skimage.morphology import opening, closing import matplotlib.pyplot as plt fr...
vsanca/soft-computing-sandbox
assignments/level 0/lvl0.py
Python
gpl-3.0
2,058
from droneapi import connect from droneapi.lib import VehicleMode from droneapi.tools import with_sitl from pymavlink import mavutil import time import sys import os from nose.tools import assert_equals def current_milli_time(): return int(round(time.time() * 1000)) @with_sitl def test_timeout(connpath): v = ...
trishhyles/dronekit-python
tests/sitl/test_12.py
Python
apache-2.0
786
import sys, os, yaml, glob import subprocess import argparse def main(args): workingDir = os.getcwd() assemblers = sum(args.assemblers, []) samples_data_dir = args.sample_data_dir checkSupportedAssemblers(assemblers, args.global_config) #The specified assembler are supported, at least they are pr...
senthil10/NouGAT
utils/prepare_de_novo_assembly.py
Python
mit
6,340
import shutil import tempfile import numpy as np import os from os.path import getsize import pytest import yaml from util import PATH_TO_TESTS, seed, dummy_predict_with_threshold PATH_TO_ASSETS = os.path.join(PATH_TO_TESTS, 'assets') PATH_TO_RETINA_DIR = os.path.join(PATH_TO_ASSETS, 'recordings', 'retina') PATH_TO_R...
paninski-lab/yass
tests/conftest.py
Python
apache-2.0
2,794
#!/usr/bin/env python ######################################################################################################################## # Simple Logging System # ######################################################################################################################## # ...
sahmri/simpleBackup
logger.py
Python
apache-2.0
2,246
"""\ This module is deprecated. Please update your code to use ``authkit.authorize.pylons_adaptors`` instead of this module. """ import warnings warnings.warn( """This module is deprecated. Please update your code to use ``authkit.authorize.pylons_adaptors`` instead of this module.""", DeprecationWarning, ...
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/AuthKit-0.4.0-py2.5.egg/authkit/pylons_adaptors.py
Python
bsd-3-clause
374
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 通过三个关键字IP,URL和访问状态来对nginx日志进行排序,找出访问次数最高的十个访问记录输出出来 ----------------------...
51reboot/actual_09_homework
03/huxianglin/filter_nginx.py
Python
mit
1,385
# -*- coding: utf-8 -*- # # Sideboard documentation build configuration file, created by # sphinx-quickstart on Tue Jul 16 09:17:02 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
binary1230/sideboard
docs/source/conf.py
Python
bsd-3-clause
9,856
from django.conf import settings from django.conf.urls.defaults import patterns, url urlpatterns = patterns('') # The following is used to serve up local media files like images, css, js # Use __file__ to find the absolute path to this file. This can be used to # determine the path to the static directory which co...
dannyman/ganeti_webmgr
ganeti_webmgr/muddle/urls.py
Python
gpl-2.0
656
# Time: O(n^2) # Space: O(1) # Given an array consists of non-negative integers, # your task is to count the number of triplets chosen # from the array that can make triangles # if we take them as side lengths of a triangle. # # Example 1: # Input: [2,2,3,4] # Output: 3 # Explanation: # Valid combinations are: # 2,3...
yiwen-luo/LeetCode
Python/valid-triangle-number.py
Python
mit
987
"""Allows to serve Sphinx generated docs from django.""" __version__ = '0.1.2'
svfat/django-docs
docs/__init__.py
Python
bsd-3-clause
80
import string import random def random_string(length, upper=True, lower=True, digit=True, symbol=True): chars = '' if upper: chars += string.ascii_uppercase if lower: chars += string.ascii_lowercase if digit: chars += string.digits if symbol: chars += string.punctuat...
James1345/white-noise
whitenoise/random/random_string.py
Python
mit
509
#!/usr/bin/env python # -*- coding: utf-8 -*- """ How many Sundays fell on the first of the month during the twentieth century? """ from datetime import date def pe19(n=2000): """ >>> pe19() 171 """ s = 0 for y in range(1901, n + 1): for m in range(1, 13): d = date(y, m, 1)...
kittttttan/pe
py/pe/pe19.py
Python
mit
646
import os import threading from System.Core.Global import * from System.Core.Colors import * from System.Core.Modbus import * from System.Lib import ipcalc class Module: info = { 'Name': 'Read Coils Exception Function', 'Author': ['@enddo'], 'Description': ("Fuzzing Read Coils Exception Function"), ...
enddo/smod
Application/modules/modbus/function/readCoilsException.py
Python
gpl-2.0
2,116
import numpy as np tansig = lambda n: 2 / (1 + np.exp(-2 * n)) - 1 sigmoid = lambda n: 1 / (1 + np.exp(-n)) hardlim = lambda n: 1 if n >= 0 else 0 purelin = lambda n: n relu = lambda n: np.fmax(0, n) square_error = lambda x, y: np.sum(0.5 * (x - y)**2) sig_prime = lambda z: sigmoid(z) * (1 - sigmoid(z)) relu_pr...
alexvlis/shape
nnmath.py
Python
gpl-3.0
518
from apps.userfeeds.models import UserFeed, UserFeedEntry from apps.userfeeds.services import FeedWriteService, FeedInformationService from celery.canvas import group from djangofeeds.tasks import refresh_feed from logging import getLogger from feedreader.celery import app logger = getLogger(__name__) def update_fee...
jo-soft/jadfr
jadfr/apps/userfeeds/tasks.py
Python
gpl-3.0
3,462
""" =========================== Covertype dataset benchmark =========================== Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART (decision tree), RandomForest and Extra-Trees on the forest covertype dataset of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ...
ankurankan/scikit-learn
benchmarks/bench_covertype.py
Python
bsd-3-clause
7,233
"""Weak reference support for Python. This module is an implementation of PEP 205: http://www.python.org/dev/peps/pep-0205/ """ # Naming convention: Variables named "wr" are weak reference objects; # they are called this instead of "ref" to avoid name collisions with # the module-global ref() function imported from ...
google/grumpy
third_party/stdlib/weakref.py
Python
apache-2.0
13,741
import requests import sys def chat_post_request(token, channel, message): """Post a message to a Slack channel""" # See https://api.slack.com/methods/chat.postMessage chat_api_url = 'https://slack.com/api/chat.postMessage' data = { 'token': token, 'channel': channel, ...
otherjoel/SlackFileCleanup
slack_utils.py
Python
gpl-3.0
1,385
#!/usr/bin/python # # Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.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 = {'metadata_version': '1.1', ...
dagwieers/ansible
lib/ansible/modules/cloud/azure/azure_rm_servicebusqueue.py
Python
gpl-3.0
12,388
# This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.utils.translation import ugettext_laz...
suutari-ai/shoop
shuup/default_tax/__init__.py
Python
agpl-3.0
695
#!/usr/bin/env python3 """ Encode MP3 audio using ffmpeg (libmp3lame). """ import argparse import glob import logging import os import re import shutil import signal import sys from typing import Generator, List, Tuple import command_mod import logging_mod import subtask_mod logger = logging.getLogger(__name__) cons...
drtuxwang/system-config
bin/mp3.py
Python
gpl-2.0
13,459
from basic_models_behaviors.models import PublishableModel, SoftDeletableModel, TimestampableModel class PublishableMock(PublishableModel): pass class SoftDeletableMock(SoftDeletableModel): pass class TimestampableMock(TimestampableModel): pass
wo0dyn/django-basic-models-behaviors
tests/models.py
Python
bsd-3-clause
263
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, api, fields, _ from odoo.exceptions import UserError class AccountInvoice(models.Model): _inherit = "account.invoice" @api.multi def action_move_create(s...
ddico/account-financial-tools
account_invoice_constraint_chronology/model/account_invoice.py
Python
agpl-3.0
2,514
import urllib import urllib2 from django.conf import settings from django.template.loader import render_to_string from django.utils import simplejson as json from django.utils.safestring import mark_safe DEFAULT_API_SSL_SERVER = "https://www.google.com/recaptcha/api" DEFAULT_API_SERVER = "http://www.google.com/recapt...
ckprice/bedrock
vendor-local/src/django-recaptcha/captcha/client.py
Python
mpl-2.0
3,705
# -*- coding: utf-8 -*- ############################################################################## # # Modulo realizzato da Andrea Cometa (info@andreacometa.it) # Compatible with OpenERP release 6.1.X # Copyright (C) 2012 Andrea Cometa. All Rights Reserved. # Email: info@andreacometa.it # Web sit...
odoousers2014/LibrERP
account_due_list/reports/parser.py
Python
agpl-3.0
1,214
#------------------------------------------------------------------------------ # pycparser: c_parser.py # # CParser class: Parser and AST builder for the C language # # Copyright (C) 2008-2013, Eli Bendersky # License: BSD #------------------------------------------------------------------------------ import re from ...
BartoszCichecki/onlinepython
onlinepython/pypy-2.4.0-win32/lib_pypy/cffi/_pycparser/c_parser.py
Python
gpl-2.0
59,384
def extractThatbadtranslatorWordpressCom(item): ''' Parser for 'thatbadtranslator.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'transla...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractThatbadtranslatorWordpressCom.py
Python
bsd-3-clause
574
#!/usr/bin/env python # external import numpy as np from sympy import symbols from numpy.testing import assert_allclose # local from ..shapes import * def test_shape(): shape = Shape(name='shape', color='blue') assert shape.name == 'shape' assert shape.__str__() == 'Shape shape color:blue' assert s...
nouiz/pydy
pydy/viz/tests/test_shapes.py
Python
bsd-3-clause
17,023
# coding=utf-8 from __future__ import absolute_import, division, print_function __metaclass__ = type import os import sys import shutil import hashlib from copy import deepcopy try: # noinspection PyCompatibility from StringIO import StringIO # python2 except ImportError: from io import StringIO # python...
majkelx/astwro
astwro/exttools/Runner.py
Python
mit
18,414
# Created By: Virgil Dupras # Created On: 2011-04-19 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-...
arsenetar/dupeguru
hscommon/debug.py
Python
gpl-3.0
834
#!/usr/bin/python # # ==-- process-stats-dir - summarize one or more Swift -stats-output-dirs --==# # # This source file is part of the Swift.org open source project # # Copyright (c) 2014-2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://s...
OscarSwanros/swift
utils/process-stats-dir.py
Python
apache-2.0
22,063
import sys def luhn_checksum(card_number): def digits_of(n): return [int(d) for d in str(n)] digits = digits_of(card_number) odd_digits = digits[-1::-2] even_digits = digits[-2::-2] checksum = 0 checksum += sum(odd_digits) for d in even_digits: checksum += sum(digits_of(d*2)...
steffzahn/test
luhn.py
Python
apache-2.0
488
""" Helper methods for testing cohorts. """ import factory from factory import post_generation, Sequence from factory.django import DjangoModelFactory import json from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.modulestore.django import modulestore from xmodule.modulestore import ModuleStore...
ahmadiga/min_edx
openedx/core/djangoapps/course_groups/tests/helpers.py
Python
agpl-3.0
6,550