code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from config.shared import *
# Unique config for the Dutch language here:
pdf_documents = [
('index', u'SendCloud OpenCart 2 Extension Documentatie - NL', u'SendCloud OpenCart 2 Extension Documentation - Nederlands', u'SendCl... | Whazor/SendCloud-OpenCart | docs/nl/conf.py | Python | mit | 331 |
<<<<<<< HEAD
<<<<<<< HEAD
"""distutils.fancy_getopt
Wrapper around the standard getopt module that provides the following
additional features:
* short and long options are tied together
* options have help strings, so fancy_getopt could potentially
create a complete usage summary
* options set attributes of ... | ArcherSys/ArcherSys | Lib/distutils/fancy_getopt.py | Python | mit | 53,492 |
from .base.dev import Device
class Sev_seg_dp(Device):
def __init__(self, dev, size=8, dev_id=0):
self.buf = [""] * size
self.is_shutdown = None
self.dev = dev
self.dev_id = dev_id
super().__init__()
def write(self, txt, pos=0, dot=0):
"""print text at pos"""
... | icve/liv-Ard | hostscripts/lib/sev_seg_dp.py | Python | mit | 2,571 |
"""
Created on 19 Nov 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
https://opensensorsio.helpscoutdocs.com/article/84-overriding-timestamp-information-in-message-payload
"""
import optparse
from scs_core.osio.config.project import Project
# ------------------------------------------------------... | south-coast-science/scs_dev | src/scs_dev/cmd/cmd_osio_topic_publisher.py | Python | mit | 2,751 |
from turbogears import controllers, expose, identity, flash, config
import cherrypy
from subcontrollers.site import SiteController
from cherrypy import request, response
from calabro.model import Sites
import siterouter
class Root(controllers.RootController):
@expose()
def default(self, site_name, *path,... | CarlosGabaldon/calabro | calabro/controllers.py | Python | mit | 549 |
from django.apps import AppConfig
class ResourcecenterConfig(AppConfig):
name = 'apps.resourcecenter'
verbose_name = 'Resource center'
| dotKom/onlineweb4 | apps/resourcecenter/appconfig.py | Python | mit | 145 |
# Copyright (c) 2008 Brian Zimmer <bzimmer@ziclix.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, m... | bzimmer/pysmug | pysmug/smugtool.py | Python | mit | 8,264 |
# -*- encoding: utf-8 -*-
from supriya.tools.ugentools.BEQSuite import BEQSuite
class BPeakEQ(BEQSuite):
r'''A parametric equalizer.
::
>>> source = ugentools.In.ar(0)
>>> bpeak_eq = ugentools.BPeakEQ.ar(
... frequency=1200,
... gain=0,
... reciprocal_of_q... | andrewyoung1991/supriya | supriya/tools/ugentools/BPeakEQ.py | Python | mit | 4,652 |
# Copyright (c) 2015-2020 Rocky Bernstein
# Copyright (c) 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com>
#
# Copyright (c) 1999 John Aycock
# 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 ... | TeamSPoon/logicmoo_workspace | packs_web/butterfly/lib/python3.7/site-packages/uncompyle6/parsers/parse2.py | Python | mit | 28,339 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource.py | Python | mit | 1,617 |
digits = [
" 000000000 \n 00:::::::::00 \n 00:::::::::::::00 \n0:::::::000:::::::0\n0::::::0 0::::::0\n0:::::0 0:::::0\n0:::::0 0:::::0\n0:::::0 0:::::0\n0:::::0 0:::::0\n0:::::0 0:::::0\n0:::::0 0:::::0\n0::::::0 0::::::0\n0:::::::000:::::::0\n 00:::::::::::::00 \n 00::::::::... | jaysbays/digit-recognition | src/digitASCII.py | Python | mit | 3,305 |
import sys
from ccv import PY_CCV_IO_GRAY, DenseMatrix, ClassifierCascade, detect_objects
matrix = DenseMatrix()
#from PIL import Image
#img = Image.open(sys.argv[1])
#matrix.set_buf(img.tostring(), img.mode, img.size[0], img.size[1], PY_CCV_IO_GRAY)
matrix.set_file(sys.argv[1], PY_CCV_IO_GRAY)
cascade = ClassifierC... | yihuang/pyccv | test.py | Python | mit | 397 |
# filewriter.py
"""Write a dicom media file."""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from struct import pack
import logging
logger... | njvack/yadda | dicom/filewriter.py | Python | mit | 13,586 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/subnets_operations.py | Python | mit | 18,375 |
"""CMS app-hook for the ``good_practice_examples`` app."""
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class GoodPracticeExamplesApphook(CMSApp):
name = _("Good practice examples")
urls = ["good_practice_examples.urls"]
app... | bitmazk/django-good-practice-examples | good_practice_examples/cms_app.py | Python | mit | 368 |
# image datasets enxtend by image data generator
# should genereate one type/class by one type/class
# the folder structure as blow
# note only one type in the train folder for one time.
# the code need reflector in future
"""directory structure:
```
dataset/
train/
Type_1/
001.jpg
... | samleoqh/machine-ln | src/py/img_generator.py | Python | mit | 1,107 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'SnapToGridWidget.ui'
#
# Created: Tue Sep 1 12:58:50 2015
# by: PyQt4 UI code generator 4.11.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
exce... | allspatial/vertex-tools | view/Ui_SnapToGridWidget.py | Python | mit | 10,208 |
from scipy import misc
from skimage import color
import numpy
import sompy
import pickle
for mapsize in [[3,3],[5,5],[10,10],[20,20]]:
somFile = open ('pkls/trainedSOM' + str(mapsize[0]) +'x'+str(mapsize[1])+'.pkl','rb')
som = pickle.load (somFile)
somFile.close()
codebook = som._normalizer.denormaliz... | mrichart/NNcoloring | src/printSom.py | Python | mit | 633 |
# Re-aligner small RNA sequence from SAM/BAM file (miRBase annotation)
from __future__ import print_function
import os.path as op
import re
import shutil
import pandas as pd
import pysam
import argparse
from seqcluster.libs import do
from seqcluster.libs.utils import file_exists
import seqcluster.libs.logger as mylog... | lpantano/seqcluster | seqcluster/seqbuster/__init__.py | Python | mit | 18,893 |
from flask import Blueprint, render_template, request, abort, flash, redirect, url_for
from flask_babel import lazy_gettext
from c3bottles import db
from c3bottles.model.drop_point import DropPoint
from c3bottles.model.report import Report
from c3bottles.model.visit import Visit
from c3bottles.views import needs_repor... | der-michik/c3bottles | c3bottles/views/action.py | Python | mit | 2,365 |
import os
from os.path import abspath, dirname
from sys import path
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
SITE_ROOT = dirname(dirname(abspath(__file__)))
path.append(SITE_ROOT)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings")
application = Dj... | krunal10/aves | aves/wsgi.py | Python | mit | 359 |
from datetime import datetime
from decimal import Decimal
from time import mktime
from flask import request, current_app
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, class_mapper
from sqlalchemy.orm.collections import InstrumentedList
from sqlalchemy.ext.declarative import declarative... | mythmon/piper | piper/database.py | Python | mit | 2,210 |
# -*- coding: utf-8 -*-
# Scrapy settings for cookpad project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest... | tahazayed/cookpadscraper | cookpad/settings.py | Python | mit | 4,097 |
from scipy import misc
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import randint
import math
import cv2
from keras.layers import Input, Dense, Dropout, Flatten, Activation, BatchNormalization, Reshape
from keras.layers import Conv2D, MaxPooling2D, UpSampling2D, Lambda
from keras.layers.noise i... | Elch123/geometricerasure | multimodel.py | Python | mit | 5,753 |
# -*- coding: utf-8 -*-
"""
.. module:: models
"""
import logging
import os
# pylint: disable=unused-import
import uuid
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models import F
from django.utils import timezone
logger = logging.getLogge... | mlipa/volontulo | backend/apps/volontulo/models.py | Python | mit | 10,634 |
#Coded by SpzY
#Version 1.1.1
import random
RollList = []
autoadd = [0]
def d20():
return random.randint(1,20)
def d12():
return random.randint(1,12)
def d10():
return random.randint(1,10)
def d8():
return random.randint(1,8)
def d6():
return random.randint(1,6)
def d4():
return random.randint... | Sp4zzy/DDRoller | DDRollerV1.1.1.py | Python | mit | 8,041 |
import pyglet
import sys
import math
import random
import settings
from itertools import chain
import entity
import sounds
import music
import cart
import ruby
import scene
import track
import level
import obstacle
from collections import namedtuple
from utils import Point, Vec2d, Rect
glevels = []
class GameLevel(... | rozifus/TeamStrong13_4 | por/gamelevel.py | Python | mit | 11,368 |
# Generated by Django 2.0 on 2018-02-08 11:49
from django.db import migrations
def forwards(apps, schema_editor):
"""
Change all Movie objects into Work objects, and their associated
data into WorkRole and WorkSelection models, then delete the Movie.
"""
Movie = apps.get_model("spectator_events",... | philgyford/django-spectator | spectator/events/migrations/0030_movies_to_works.py | Python | mit | 1,362 |
#!/usr/bin/env python
"""
Copyright (C) 2010-2013, Ryan Fan
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Thi... | rfancn/myprojects | getlogs/jobs/jobinit.py | Python | mit | 1,550 |
from django.urls import path
from . import views
urlpatterns = [
path(
'data_release',
views.DataReleaseView.as_view(),
name='data_release'
),
path(
'data_release/<slug:site>/<slug:job>',
views.DataReleaseJobView.as_view(),
name='data_release_job'
),
]
| kingsdigitallab/tvof-django | tvof/data_release/urls.py | Python | mit | 319 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\contrast_ctrl_template.ui'
#
# Created: Mon Jul 06 15:31:42 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromU... | mgraupe/acq4 | acq4/util/imaging/contrast_ctrl_template.py | Python | mit | 7,059 |
from setuptools import setup, find_packages
VERSION = '0.3.16'
LONG_DESCRIPTION = open('README.rst').read()
setup(name='virtstrap',
version=VERSION,
description="virtstrap - Making repeatable environments easy!",
long_description=LONG_DESCRIPTION,
keywords='',
author='Reuven V. Gonzales',
aut... | ravenac95/virtstrap | virtstrap/setup.py | Python | mit | 1,017 |
# -*- coding: utf-8 -*-
"""Pibooth base states.
"""
import traceback
from pibooth.utils import LOGGER, BlockConsoleHandler
class StateMachine(object):
def __init__(self, plugins_manager, configuration, application, window):
self.states = set()
self.failsafe_state = None
self.active_stat... | werdeil/pibooth | pibooth/states.py | Python | mit | 3,595 |
from lxml import etree
from mathmlcontent_to_string import MathML2String
s1 = """<semantics xml:id="m52.1a" xref="m52.1.pmml">
<apply xml:id="m52.1.7" xref="m52.1.7.pmml">
<eq xml:id="m52.1.2" xref="m52.1.2.pmml"/>
<qvar xmlns:mws="http://search.mathweb.org/ns" name="A"/>
... | frozstone/mcatunification | mathmlcontent_to_string_test.py | Python | mit | 3,296 |
'''
Write a program that prompts for a file name, then opens that file and reads through the file,
and print the contents of the file in upper case.
'''
fileName = raw_input('Enter file name : ')
openFile = open(fileName)
readFile = openFile.read().upper().strip()
print readFile
| rahulbohra/Python-Basic | 55_file_problem_statement.py | Python | mit | 280 |
from file_preprocess_js_subset import FilePreProcessJsSubset
from file_preprocess_regex import FilePreProcessRegex
class FilePreProcessorFactory(object):
def get_preprocessor(self, name):
classes = (FilePreProcessJsSubset, FilePreProcessRegex)
for clazz in classes:
if clazz.get_name() ... | markdrago/caboose | src/files/file_preprocessor_factory.py | Python | mit | 482 |
from definitions import names
from objects import tiles
import random
class Town (object):
def __init__ (self, seed=None):
self.seed = seed
self.name = self.generate_name(self.seed)
self.shop = False
self.shop_items = []
def generate_name (self, seed=None):
random.seed(self.seed)
name = []
length... | rekyuu/rpyg | src/objects/towns.py | Python | mit | 801 |
__author__ = 'cody'
from dbapi.test.testing_utils import *
import json
class UserTest(DbapiTestCase):
def test_get_user_success(self):
return_value = self.app.get("/user/{}".format(self.test_user.username))
self.assertEqual(self.test_user.todict(), json.loads(return_value.data.decode())["data"])
... | codyharrington/todolist | dbapi/test/user_test.py | Python | mit | 4,887 |
from geodata.addresses.numbering import NumberedComponent
from geodata.encoding import safe_decode
class PostCode(NumberedComponent):
@classmethod
def phrase(cls, postcode, language, country=None):
if postcode is None:
return None
return cls.numeric_phrase('postcodes.alphanumeric',... | openvenues/libpostal | scripts/geodata/addresses/postcodes.py | Python | mit | 420 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
from hwt.hdl.statements.assignmentContainer import HdlAssignmentContainer
from hwt.hdl.statements.statement import HdlStatement
from hwtLib.examples.axi.oooOp.counterHashTable import OooOpExampleCounterHashTable
from hwtLib.examples.mem.ram import SimpleA... | Nic30/hwtLib | hwtLib/tests/synthesizer/rtlLevel/statements_consystency_test.py | Python | mit | 2,701 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from config import config
from glob import glob
import importlib
import os
import re
from slackclient import SlackClient
import sys
import time
import traceback
import random
from plugins.botlib import BotLib
curdir = os.path.dirname(os.p... | storyhe/playWithBot | slask.py | Python | mit | 3,367 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_service_providers_operations.py | Python | mit | 4,238 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('barsystem', '0036_auto_20150721_1314'),
]
operations = [
migrations.AlterModelOptions(
name='productcategory',
... | TkkrLab/barsystem | barsystem/src/barsystem/migrations/0037_auto_20150721_1500.py | Python | mit | 581 |
#!/usr/bin/python3
import unittest
from botocore.exceptions import ClientError
import sys
import datetime
import threading
from queue import Queue
from . import util
class LambdaTaskTestCase(unittest.TestCase):
# ========================================================================
# ======... | groboclown/pipit | test/integration/boto3/swf/lambdas.py | Python | mit | 7,493 |
# -*- coding: utf-8 -*-
"""
Created on Thu May 4 16:04:25 2017
@author: Antonio
La biblioteca externas es re
"""
import re
"""
* Clase que se encarga de encapsular todos los atributos de un objeto json
* para almacenar los datos de un libro
"""
class JElement:
"""
* Método constructor de la clase
* Recib... | silviaegt/bdcv_metadata | Comparador/JElement.py | Python | mit | 3,201 |
import Utilities
from tkinter import *
from random import randint
from random import uniform
from collections import deque
from collections import OrderedDict
import numpy as np
from hillClimbing import hillClimbing_basic
from hillClimbing import hillClimbing_randomStart
from hillClimbing import getValueFunction
from h... | lj9707/CourseWork | cs440/Local Search/population_based.py | Python | mit | 4,218 |
# coding: UTF-8
'''Generic functions used by several modules. Primarily data validation.'''
import os
import sys
# The directory that project-specific files are located in.
# Assumes we read the non project-specific files, set directory, then open
# only project-specific files.
directory = ""
test_mode = False
clas... | Enthalpy-AC/catalysis | catalysis_globals.py | Python | mit | 10,145 |
from .pydialog import Dialog
__all__ = ['Dialog']
| nicr9/pydialog | pydialog/__init__.py | Python | mit | 50 |
SOURCES = {
"vogue_india": {
"NAME": "vogue_india",
"ALLOWED_DOMAINS": "http://www.vogue.in/",
"START_URLS": [
"http://www.vogue.in/fashion/fashion-trends/"
],
"BASE_URL": "http://www.vogue.in/",
"LIST_PAGE_XPATH": "//*[@id='eight_grid_block0']/section/div... | rksaxena/crawler_templates | crawler_type2/crawler_type2/config.py | Python | mit | 2,412 |
'''
Created on Mar 16, 2012
@author: mchrzanowski
'''
from math import log10
from time import time
class FibGenerator(object):
''' super-quick memoized fib calculator exploiting the fact that we need to calculate each fib number,
yet we don't need to store all previous numbers.'''
def __init__(self):
... | mchrzanowski/ProjectEuler | src/python/Problem104.py | Python | mit | 1,982 |
from IRC import IRC
from CMDParser import CMDParser
import sys, time, os, datetime
from pykeyboard import PyKeyboard
class TwitchPlay:
def start(self, mode):
os.popen("vba 大聯盟棒球賽.gba")
irc = IRC("irc.twitch.tv", "ji01", "oauth:kx5f1v4wi8ni4fkmayta7ov9mzzy")
irc.connect()
try:
... | joshua5201/NATwitchPlay | TwitchPlay.py | Python | mit | 1,906 |
from utils import fio
import matplotlib.pyplot as plt
from mlp.neural_network import MLPClassifier # Using copies of dev branch from sklearn, since these classes are not yet released.
from sklearn.preprocessing import MinMaxScaler
# different learning rate schedules and momentum parameters
#params = [{'algorithm': 'sg... | dwettstein/pattern-recognition-2016 | mlp_main.py | Python | mit | 6,307 |
import json
from django.test import TestCase
from package.repos import get_repo_for_repo_url
from package.repos.bitbucket import repo_handler as bitbucket_handler
from package.repos.github import repo_handler as github_handler
from package.repos.base_handler import BaseHandler
from package.repos.unsupported import Un... | pydanny/djangopackages | package/tests/test_repos.py | Python | mit | 9,307 |
import os
import collections
import lamnfyc.context_managers
import lamnfyc.settings
import lamnfyc.decorators
import lamnfyc.packages.base
import subprocess
@lamnfyc.decorators.check_installed('bin/python')
def two_seven_installer(package, temp, env):
command = '''LDFLAGS="-L{path}/lib"
CPPFLAG... | kingbuzzman/lamnfyc | lamnfyc/packages/python/__init__.py | Python | mit | 4,356 |
##################################################
######scikit_learn to do the classifications######
##################################################
##################################################
from sklearn import svm
from sklearn.naive_bayes import GaussianNB
###############################################... | doylew/detectionsc | format_py/n_gram_nb.py | Python | mit | 5,595 |
from securitylib.crypto import *
from nose.tools import ok_, eq_, with_setup
from test_utils import setup_seeded_random, teardown_seeded_random, assert_raises_with_message
def test_generate_authenticator():
eq_(generate_authenticator('KJxyKJaV06', '5f07ec7a02bb0d7dc92d8aae1e0817e2a64a1265797b45f4780b49af11df61e1'... | sapo/securitylib-python | tests/test_crypto.py | Python | mit | 3,513 |
#!/usr/bin/env python
from euler import *
result = sum(primes_less_than(2000000))
print result
| kerkeslager/sandbox | euler/py/euler-0010.py | Python | mit | 98 |
import random
from behave import given, when, then
from howabout import get_levenshtein
@given('two long strings')
def step_two_long_strings(context):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
random_str = lambda size: [random.choice(alphabet) for _ in range(0, size)]
context.first = random_str(1024)
c... | clibc/howabout | features/steps/levenshtein_steps.py | Python | mit | 1,581 |
#! /usr/bin/env python
"""
Given a list of files, find all video files and classify them by their base directory:
foo_file1 /foo/bar/baz (index 1)
foo_file2 /foor/bar/bay (index 2)
foo_file3 /foo/bar/baz (index 1, same dir as foo_file1)
"""
import argparse
parser = argparse.ArgumentParser()
parser.a... | capusta/handyAutomation | tensorflow/processdata.py | Python | mit | 555 |
# -*- coding: utf-8 -*-
import sys
import six
from django.core.exceptions import ValidationError
from ..models import Driver, Competition, Team, Season, Circuit
from ..models import TeamSeason, Seat, GrandPrix, Race, Result, ContenderSeason, CompetitionTeam
def retro_encode(text):
if sys.version_info < (3, 0):
... | SRJ9/django-driver27 | driver27/tests/common.py | Python | mit | 4,985 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Models for user, blog, comment.
'''
__author__ = 'Shawling'
import time
import uuid
from orm import BooleanField, FloatField, Model, StringField, TextField, IntegerField
# 通过拼接时间戳与Python内置的uuid算法保证id的唯一性
def next_id():
return '%015d%s000' % (int(time.time() * ... | Shawling/STAMS | www/models.py | Python | mit | 2,265 |
#!/usr/bin/env python
"""GUI for Mine Sweeper.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
from __future__ import print_function
import argparse
try:
from PyQt4 import QtGui, QtCore
from PyQt4.QCore import QWidget, QApplication, QGridLayout
except ImportError:
from PyQt5 import QtCore
from Py... | duguyue100/minesweeper | scripts/ms-gui.py | Python | mit | 3,092 |
import os
def main():
folders = os.listdir('Input_TS/')
for foldername in folders:
for i in range(200):
if not os.path.exists('out/' + foldername):
os.makedirs('out/' + foldername)
os.system('python detectanoms.py Input_TS/' + foldername +'/'+str(i) + '.csv out1/' + foldername+ '/'+str(i) + '.txt')
if... | cs60050/TeamGabru | 3-Time-Series-Analysis/3-AnomalyDetection/runner.py | Python | mit | 353 |
# Definition of the version number
__all__ = ["__version__"]
# major, minor, patch, -extra
version_info = 0, 8, 1
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
| lrq3000/fdict | fdict/_version.py | Python | mit | 194 |
"""
"""
import time
import numpy as np
import scipy as sp
import pandas as pd
import xgboost as xgb
import re
from sklearn.datasets import make_classification
from sklearn.cross_validation import StratifiedShuffleSplit
def get_leaf_values(tree_str):
# To find 'leaf=0.123\n'
prog=re.compile(r"(?<=leaf\=)(.+)\... | tks0123456789/XGB_experiments | multiclass_test.py | Python | mit | 6,257 |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | pkess/beets | beets/library.py | Python | mit | 54,095 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os, sys
import numpy as np
def determine_path(root=__file__):
"""Borrowed from wxglade.py"""
try:
# root = __file__
if os.path.islink(root):
root = os.path.realpath(root)
return os.path.dirname(os.path.abspath(root))
... | tainstr/misura.canon | misura/canon/tests/__init__.py | Python | mit | 4,285 |
PARAMETER_TYPES = [(1, 'query'), (2, 'user')]
TRANSFORMATION_TYPES = [(1, 'Transpose'), (2, 'Split'), (3, 'Merge')]
COLUMN_TYPES = [(1, 'dimension'), (2, 'metric')]
| devashishsharma2302/testing-heroku-deployment | squealy/constants.py | Python | mit | 165 |
import unittest
from betago import scoring
from betago.dataloader import goboard
class ScoringTestCase(unittest.TestCase):
def test_identify_territory(self):
board = goboard.from_string('''
...b..w..
...b..w..
bbbb..w..
wwwww.www
wwbbw..w.
... | maxpumperla/betago | tests/scoring_test.py | Python | mit | 863 |
import OOMP
newPart = OOMP.oompItem(9136)
newPart.addTag("oompType", "LEDS")
newPart.addTag("oompSize", "0603")
newPart.addTag("oompColor", "W")
newPart.addTag("oompDesc", "STAN")
newPart.addTag("oompIndex", "01")
OOMP.parts.append(newPart)
| oomlout/oomlout-OOMP | old/OOMPpart_LEDS_0603_W_STAN_01.py | Python | cc0-1.0 | 243 |
import json
import re
import glob
class ChapterDependency(object):
def __init__(self, other_chapter, other_quest):
self.other_chapter = other_chapter
self.other_quest = other_quest
class DependencyGraph(object):
def __init__(self):
self.chapters = []
self.dependencies = {}
... | rockobonaparte/bfsr | scripts/hqm_chapter_deps.py | Python | cc0-1.0 | 1,953 |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL1006230002.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... | biomodels/MODEL1006230002 | MODEL1006230002/model.py | Python | cc0-1.0 | 427 |
import os, glob, cv2
import numpy as np
import pylab
im_simple = '/home/faedrus/Documents/au_trap/20141031/1414763725.88.png'
im_complex = '/home/faedrus/Documents/au_trap/20141031/1414769658.04.png'
img = cv2.imread(im_simple)
(height, width, depth) = img.shape
cv2.namedWindow('original', cv2.WINDOW_NORMAL)
cv2.imsh... | jfindleyderegt/au_trap | test_harris.py | Python | cc0-1.0 | 743 |
import argparse
import codecs
import hashlib
import logging
try:
import requests_cache
requests_cache.install_cache('fr_cache')
except ImportError:
# If the cache library isn't present, do nothing -- we'll just make full
# HTTP requests rather than looking it up from the cache
pass
from regparser... | jmcarp/regulations-parser | build_from.py | Python | cc0-1.0 | 4,170 |
# -*- coding: utf-8 -*-
# bontempo.py
# author : Antoine Passemiers
import numpy as np
class BeatDetector:
def __init__(self):
self.frame_size = 128
def detect(self, signal):
n_slides = len(signal) / self.frame_size
ste = np.empty(n_slides, dtype = np.double)
beats = np.empty(n... | AntoinePassemiers/Neuhon | python/bontempo.py | Python | epl-1.0 | 672 |
# Use of this source code is governed by the MIT license.
__license__ = "MIT"
try:
from collections.abc import Callable # Python 3.6
except ImportError as e:
from collections import Callable
import re
import sys
import warnings
try:
import thlib.side.soupsieve as soupsieve
except ImportError as e:
soup... | listyque/TACTIC-Handler | thlib/side/bs4/element.py | Python | epl-1.0 | 81,090 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
### These unit tests were moved here from agent_location_choice_model to remove
### a circular dependency with household_location_choice_model_creator.
from opus_core.tests import opus_unittest
... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim/tests/test_agent_location_choice_model.py | Python | gpl-2.0 | 20,625 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def initial_data(apps, schema_editor):
SA = apps.get_model('ship', 'ShipArmour')
SA(name='None', structure=0, armour=0).save()
class Migration(migrations.Migration):
dependencies = [
('ship', '0008... | dwagon/pymoo | moo/ship/migrations/0009_populate_armour.py | Python | gpl-2.0 | 416 |
"""Current version string"""
__version__ = "0.3.2"
| sneakypete81/pylint-patcher | pylint_patcher/_version.py | Python | gpl-2.0 | 51 |
import subprocess
import numpy as np
import pysftp
from cblparallel.config import * # Various constants such as USERNAME
# Load list of machines
with open('../data/machines.csv', 'r') as f:
machines = [line.strip() for line in f]
# Ask each machine how much CPU is being used
cpus = -np.ones(len(machines))
for... | jamesrobertlloyd/div-f-fear | web/python/cpu.py | Python | gpl-2.0 | 1,646 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# guider.py
import time
import threading
import win32com.client
class CameraThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.cam = None
def run(self):
win32com.client.pythoncom.CoInitialize()
self.cam... | bamford/control | control/minimal_com_test.py | Python | gpl-2.0 | 994 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2017 CERN.
#
# INSPIRE 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... | rikirenz/inspire-json-merger | tests/integration/test_json_merger.py | Python | gpl-2.0 | 1,443 |
#!/usr/bin/env python3
# This is in its own file rather than inside meson.build
# because a) mixing the two is ugly and b) trying to
# make special characters such as \n go through all
# backends is a fool's errand.
import sys, os, subprocess
h_array = ['--fhead',
"#ifndef __PB_UTILS_ENUM_TYPES_H__\n#defi... | jpakkane/gstreamer-plugins-base | gst-libs/gst/pbutils/pbutils_mkenum.py | Python | gpl-2.0 | 1,522 |
import subprocess as sub
from sys import argv
import re
if len(argv) != 2:
print "Please enter a time as argv[1]"
exit()
output = open('/var/log/kern.log', 'r').read()#.split('\n')
regex = "(Mar [1-9]+\s[0-9]+:[0-9]+:[0-9]+).*Connection Limit Reached.*SRC=([0-9]*.[0-9]*.[0-9]*.[0-9]*) DST=([0-9]*.[0-9]*.[0-9]*.[0-... | ucsb-seclab/ictf-framework | router/iptables_log_parse.py | Python | gpl-2.0 | 734 |
__author__ = 'wacax'
#libraries
from os import getcwd, chdir, system
from numpy import exp
from pandas import read_csv
from numpy import vstack
#Add user defined functions
from csv2vw import csv_to_vw
from rankEnsemble import kaggle_rank_avg
def sigmoid(x):
return 1 / (1 + exp(-x))
#directories; change director... | wacax/CRITEO | CriteoMain.py | Python | gpl-2.0 | 11,207 |
import datetime
import pandas_datareader.data as web
#Clase para procesos basicos de acciones
class Stock():
"""Tipo de datos basico para calculo estadistico de acciones"""
def __init__(self):
fecha = datetime.datetime.now()
anio_anterior = int(fecha.strftime("%Y"))-1
fecha_anteri... | supermpm/c2monac | stockdefs.py | Python | gpl-2.0 | 2,369 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | ljx0305/ice | python/test/Ice/operations/Server.py | Python | gpl-2.0 | 1,428 |
import glob
import os
from pathlib import Path
import platform
import re
import shutil
import subprocess
from rpmlint.config import Config
from rpmlint.pkg import FakePkg, Pkg
import rpmlint.spellcheck
def testpath():
return Path(os.environ.get('TESTPATH', Path(__file__).parent))
TEST_CONFIG = [testpath() / 'c... | rpm-software-management/rpmlint | test/Testing.py | Python | gpl-2.0 | 1,744 |
"""
resolveurl Kodi Addon
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 ... | repotvsupertuga/tvsupertuga.repository | script.module.resolveurl/lib/resolveurl/plugins/streamango.py | Python | gpl-2.0 | 5,637 |
#!/usr/bin/python
import os
import getpass
from selenium import webdriver
import login
import training
import squad
########################################################################################
driver = webdriver.PhantomJS("lib/phantomjs")
###################################################################... | Mariusz-v7/MZCreeper | main.py | Python | gpl-2.0 | 985 |
from qgis.gui import QgsMapMouseEvent
from qgis.core import QgsWkbTypes, QgsPointXY
def point_from_event(event: QgsMapMouseEvent, snapping: bool) -> QgsPointXY:
"""
Returns the point from the mouse canvas event. If snapping is enabled it will be
snapped using the settings.
:param event: The map mouse ... | DMS-Aus/Roam | src/roam/maptools/maptoolutils.py | Python | gpl-2.0 | 1,092 |
from ConfigParser import SafeConfigParser
from webradio.xdg import get_config_filename
import os
class Configuration(object):
def __init__(self):
self.__parser = SafeConfigParser()
self.__parser.add_section('WebRadio')
self.read()
def read(self, target=None):
if target is Non... | hasselmm/webradio | webradio/config.py | Python | gpl-2.0 | 1,517 |
"""SCons.SConf
Autoconf-like configuration support.
In other words, SConf allows to run tests on the build machine to detect
capabilities of system and do some things based on result: generate config
files, header files for C/C++, update variables in environment.
Tests on the build system can detect if compiler sees... | IljaGrebel/OpenWrt-SDK-imx6_HummingBoard | staging_dir/host/lib/scons-2.3.5/SCons/SConf.py | Python | gpl-2.0 | 39,620 |
# Copyright (C) 2008-2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | exaile/exaile | plugins/dist_plugin.py | Python | gpl-2.0 | 3,754 |
import os
import re
import logging
import base64
from virttest.utils_test import libvirt
from autotest.client.shared import error
from autotest.client import utils
from virttest import aexpect
from virttest import remote
from virttest import virt_vm
from virttest import virsh
from virttest.libvirt_xml import vm_xml
fro... | PandaWei/tp-libvirt | libvirt/tests/src/virtual_disks/virtual_disks_iscsi.py | Python | gpl-2.0 | 9,567 |
import itertools
class Drawable_Object(object):
newid = itertools.count().next
def __init__(self, surface, visible = True):
# Get a unique object ID
self._id = Drawable_Object.newid()
# Surface where the Object will be drew
self._surface = surface
# True indicates that the object will be dr
self._visibl... | fbarrios/navemer | navigation/Drawable_Objects/Drawable_Object.py | Python | gpl-2.0 | 612 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
# Copyright (c) 2009 Jendrik Seipp
#
# RedNotebook 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 ver... | tomka/rednotebook | rednotebook/gui/categories.py | Python | gpl-2.0 | 20,312 |
# -*- coding: utf-8 -*-
import unittest
from httplib import BAD_REQUEST
from httplib import FORBIDDEN
from httplib import NOT_FOUND
from httplib import NOT_IMPLEMENTED
from datetime import datetime
from tcms.core.contrib.linkreference.models import LinkReference
from tcms.xmlrpc.api import testcaserun
from tcms.xmlr... | MrSenko/Nitrate | tcms/xmlrpc/tests/test_testcaserun.py | Python | gpl-2.0 | 41,136 |
# parse the attrs
import re
import pprint
f =open ('attrs.txt')
types = {}
for x in f:
x = re.sub(r' attrs attrs '," ATTRLIST ",x)
x = re.sub(r' ATTRLIST attrs '," ATTRLIST ",x)
x = re.sub(r' ATTRLIST ATTRLIST '," ATTRLIST ",x)
parts = x.split(" . ")
stack = parts[0].split(" ")
last = parts[... | h4ck3rm1k3/gcc_py_introspector | utils/parse_attrs.py | Python | gpl-2.0 | 1,800 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011, 2012 CERN.
##
## Invenio 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 opt... | jrbl/invenio | modules/bibauthorid/lib/bibauthorid_frontinterface.py | Python | gpl-2.0 | 8,992 |