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 from core.redditrover import RedditRover if __name__ == "__main__": rr = RedditRover()
DarkMio/RedditRover
main.py
Python
gpl-2.0
107
def makefastqdumpScript(sraFileNameListFileName, outputDirectory, scriptFileName): # Make a script that will run fastq-dump on each of a list of SRA files sraFileNameListFile = open(sraFileNameListFileName) scriptFile = open(scriptFileName, 'w+') for line in sraFileNameListFile: # Iterate through the SRA ...
imk1/IMKTFBindingCode
makefastqdumpScript.py
Python
mit
788
# Copyright 2013 # # 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 writi...
FNST-OpenStack/horizon
openstack_dashboard/dashboards/project/routers/extensions/routerrules/tabs.py
Python
apache-2.0
8,803
# -*- coding: utf-8 -*- # Copyright (C) 2013-2014 Avencall # # 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 p...
wazo-pbx/xivo-tools
visualplan/src/visualplan/dialplan.py
Python
gpl-3.0
4,796
import dbus as _dbus from razer.client.device import RazerDeviceFactory as _RazerDeviceFactory from razer.client import constants __version__ = '1.1.13' class DaemonNotFound(Exception): pass class DeviceManager(object): """ DeviceManager Class """ def __init__(self): # Load up the DBus ...
z3ntu/razer-drivers
pylib/razer/client/__init__.py
Python
gpl-2.0
3,290
""" 2D-Fourier Magnitude Coefficients --------------------------------- .. autosummary:: :toctree: generated/ Segmenter """ from .config import * from .segmenter import *
urinieto/msaf
msaf/algorithms/fmc2d/__init__.py
Python
mit
180
from MapCombiner import MapCombiner
hiuwo/acq4
acq4/analysis/modules/MapCombiner/__init__.py
Python
mit
36
# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE # # This library 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 2.1 of the License, or (at your option) any later version. # #...
FedoraScientific/salome-geom
src/GEOM_SWIG/GEOM_example7.py
Python
lgpl-2.1
2,133
# -*- coding: utf-8 -*- import os import re from froide.settings import Base, ThemeBase, German rec = lambda x: re.compile(x, re.I | re.U) class FragDenStaatBase(German, ThemeBase, Base): gettext = lambda s: s LANGUAGES = ( ('de', gettext('German')), ) FROIDE_THEME = 'fragdenstaat_de.theme...
catcosmo/fragdenstaat_de
fragdenstaat_de/settings.py
Python
mit
4,056
#~~~~~~~GLOBAL IMPORTS~~~~~~~# # Standard library packages import import gzip from os import close, remove, path from multiprocessing import cpu_count from time import time from tempfile import mkstemp # Local library packages from pyDNA.Utilities import run_command, file_basename, fgunzip from BlastHit import BlastHi...
a-slide/pyDNA
Blast/BlastnWrapper.py
Python
gpl-2.0
4,335
import sys secs_per_year = (60 * 60 * 24 * 365) secs_per_day = (60 * 60 * 24) secs_per_hour = (60 * 60) secs_per_minute = 60 # Takes a number of seconds and returns a list in the following format: # [seconds, minutes, hours, days, years] # Length of the returned list is variable - if the function is passed '65', [...
davidfic/linux-dash-flask
app/utility.py
Python
mit
1,073
import datetime import json import mock import pytest from django.core.urlresolvers import reverse from django.conf import settings from django.utils import timezone from crashstats.crashstats.tests.test_views import BaseTestViews, Response from crashstats.crashstats.models import CrontabberState from crashstats.sup...
Tayamarn/socorro
webapp-django/crashstats/monitoring/tests/test_views.py
Python
mpl-2.0
6,622
__author__ = 'mark' # StarbaseMini Staribus/Starinet Client for the British Astronomical Association Staribus Protocol # Copyright (C) 2015 Mark Horn # # This file is part of StarbaseMini. # # StarbaseMini is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
mhorn71/StarbaseMini
utilities/staribus_address.py
Python
gpl-2.0
1,396
# -*- coding: utf-8 -*- # Copyright (C) 2014-present Taiga Agile LLC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later ver...
taigaio/taiga-back
taiga/base/utils/logs.py
Python
agpl-3.0
2,323
# -*- coding: UTF-8 -*- """ ``Gassst`` ----------------------- :Authors: Liron Levin :Affiliation: Bioinformatics core facility :Organization: National Institute of Biotechnology in the Negev, Ben Gurion University. .. Note:: This module was developed as part of a study led by Dr. Jacob Moran Gilad Short Descriptio...
bioinfo-core-BGU/neatseq-flow_modules
neatseq_flow_modules/Liron/Gassst_module/Gassst.py
Python
gpl-3.0
14,125
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django_emailsupport.utils.imap import get_unread_messages, mark_seen from django_emailsupport.settings import NOTIFICATION_EMAIL_LIST from django_emailsupport.tasks import send_mail from models import Email, Submitt...
rosti-cz/django-emailsupport
django_emailsupport/processor.py
Python
mit
1,527
"""Provides PoseRegNet class that implements deep CNNs. PoseRegNet provides interface for building the CNN. PoseRegNetParams is the parametrization of these CNNs. Copyright 2015 Markus Oberweger, ICG, Graz University of Technology <[email protected]> This file is part of DeepPrior. DeepPrior is free software:...
moberweger/deep-prior
src/net/poseregnet.py
Python
gpl-3.0
7,467
""" Image Sequence Asset Plugins """
david-cattermole/assetQC
tests/test/standardAssets/imageSequence/__init__.py
Python
lgpl-3.0
37
# Greedy layerwise training of a 2 layer autoencoder (MLP) on Fashion MNIST # Code is based on # https://github.com/ageron/handson-ml2/blob/master/17_autoencoders_and_gans.ipynb import superimport import numpy as np import matplotlib.pyplot as plt import os figdir = "../figures" def save_fig(fname): plt.savefig(os....
probml/pyprobml
scripts/ae_layerwise_fashion_tf.py
Python
mit
3,215
import os from gi.repository import GObject, Caja class ColumnExtension(GObject.GObject, Caja.ColumnProvider, Caja.InfoProvider): def __init__(self): pass def get_columns(self): return Caja.Column(name="CajaPython::block_size_column", attribute="block_size",...
mate-desktop/python-caja
examples/block-size-column.py
Python
gpl-2.0
691
# # This is a Construct library which represents an # LC_CODE_SIGNATURE structure. Like all Construct # libraries, can be used for parsing or emitting # (Construct calls it 'building') # from construct import * import plistlib class PlistAdapter(Adapter): def _encode(self, obj, context): return plistlib...
CiNC0/Cartier
cartier-python-resign-linux/isign/macho_cs.py
Python
apache-2.0
7,340
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from django.shortcuts import render # Create your views here. from rest_framework import viewsets # from suggestions.serializers import SentenceSerializer from rest_framework.response import Response from rest_framework.views import APIView ...
lahdo/sentence-suggester
back-end/suggestions/views.py
Python
mit
1,593
""" Copyright (c) 2015 Michael Bright and Bamboo HR LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
BambooHR/rapid
rapid/release/data/models.py
Python
apache-2.0
4,322
"""Tests for closures.""" from pytype.tests import test_inference class ClosuresTest(test_inference.InferenceTest): """Tests for closures.""" def testBasicClosure(self): with self.Infer(""" def f(): x = 3 def g(): return x return g def caller(): return f...
pombredanne/pytype
pytype/tests/test_closures.py
Python
apache-2.0
3,855
from django.forms import widgets from rest_framework import serializers from app.models import Address, Company, Crime, House, Job, JobRating, JobSalary class AddressSerializer(serializers.ModelSerializer): class Meta: model = Address fields = ('street_address', 'city', 'country', 'longitude', 'latitude') cla...
Ommy/Intern-Project
django/app/serializers.py
Python
mit
1,322
"""Multi-layer Perceptron """ # Authors: Issam H. Laradji <[email protected]> # Andreas Mueller # Jiyuan Qian # License: BSD 3 clause import numpy as np from abc import ABCMeta, abstractmethod from scipy.optimize import fmin_l_bfgs_b import warnings from ..base import BaseEstimator, Classifi...
jblackburne/scikit-learn
sklearn/neural_network/multilayer_perceptron.py
Python
bsd-3-clause
49,978
from paste.util import doctest24 as doctest from paste.util.import_string import simple_import import os filenames = [ 'tests/test_template.txt', ] modules = [ 'paste.util.template', 'paste.util.looper', # This one opens up httpserver, which is bad: #'paste.auth.cookie', #'paste.auth.multi...
yongshengwang/builthue
desktop/core/ext-py/Paste-1.7.2/tests/test_doctests.py
Python
apache-2.0
1,568
""" node for 2 conv's paired together, which allows more flexible combinations of filter size and padding - specifically even filter sizes can have "same" padding """ import numpy as np import theano import theano.tensor as T import treeano import treeano.nodes as tn import canopy fX = theano.config.floatX @treeano...
diogo149/treeano
treeano/sandbox/nodes/paired_conv.py
Python
apache-2.0
2,082
# -*- coding: utf-8 -*- # Dactylo -- A datasets activity streams logger # By: Emmanuel Raviart <[email protected]> # # Copyright (C) 2013 Etalab # http://github.com/etalab/dactylo # # This file is part of Dactylo. # # Dactylo is free software; you can redistribute it and/or modify # it under the terms of the GNU A...
etalab/dactylo
dactylo/controllers/states.py
Python
agpl-3.0
10,349
from __future__ import unicode_literals import os from os import environ import sys import tempfile import psycopg2 import psycopg2.extras import urllib.parse as urlparse import json from oauth2client.service_account import ServiceAccountCredentials from openpyxl import Workbook, load_workbook import cmd2 from flask i...
monhustla/line-bot-sdk-python
prestigetest.py
Python
apache-2.0
7,144
# # Solve a multi-commodity flow problem as python package. # # Implement core functionality needed to achieve modularity. # 1. Define the input data schema # 2. Define the output data schema # 3. Create a solve function that accepts a data set consistent with the input # schema and (if possible) returns a data set ...
opalytics/opalytics-ticdat
examples/expert_section/ampl_original_examples/netflow/netflow.py
Python
bsd-2-clause
5,373
import json import math import urlparse from httplib import HTTPConnection, HTTPSConnection from urlparse import urlsplit from django.conf import settings from django.utils.http import is_safe_url from django.http.request import validate_host from django.contrib.auth.decorators import login_required from django.core.e...
cga-harvard/worldmap
wm_extra/views.py
Python
gpl-3.0
19,072
import sys import numpy as np from numpy import pi, sin, cos from scipy.optimize import leastsq import scipy, scipy.fftpack import six import cv2 if cv2.__version__[0] == "2": import cv2.cv as cv from pocpy.logpolar_opencv2 import * else: from pocpy.logpolar_opencv3 import * def zero_padding(src, dstsh...
daisukekobayashi/phase-only-correlation
pocpy/poc.py
Python
apache-2.0
3,384
from __future__ import absolute_import from openpyxl.descriptors import Integer, String, Typed from openpyxl.descriptors.serialisable import Serialisable from openpyxl.styles import ( Font, Fill, GradientFill, PatternFill, Border, Alignment, Protection, ) from openpyxl.xml.functions im...
Darthkpo/xtt
openpyxl/styles/differential.py
Python
mit
1,571
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
ubuntu-core/snapcraft
snapcraft/internal/sources/_tar.py
Python
gpl-3.0
4,273
import json import pytest from units.compat.mock import patch from ansible.modules.notification import slack from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args from ansible import module_utils class TestSlackModule(ModuleTestCase): def setUp(self): super(Tes...
shepdelacreme/ansible
test/units/modules/notification/test_slack.py
Python
gpl-3.0
3,084
import calendar import functools import json import sys import tempfile import time import urllib import urllib2 from datetime import datetime from xml.dom import Node from xml.dom import minidom from xml.sax.saxutils import escape, quoteattr import httplib2 from sit_youtrack import youtrack def urlquote(s): ret...
softintouch/python-youtrack-api
sit_youtrack/youtrack/connection.py
Python
apache-2.0
48,679
from __future__ import absolute_import from __future__ import with_statement """ This module contains the component responsible for consuming messages from the broker, processing the messages and keeping the broker connections up and running. * :meth:`~Consumer.start` is an infinite loop, which only iterates agai...
WoLpH/celery
celery/worker/consumer.py
Python
bsd-3-clause
23,217
# coding: utf-8 """ KubeVirt API This is KubeVirt API an add-on for Kubernetes. OpenAPI spec version: 1.0.0 Contact: [email protected] Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest i...
kubevirt/client-python
test/test_v1_secret_volume_source.py
Python
apache-2.0
943
"""Graphical user interface to Delta-Elektronika SM-700 Series controllers.""" import sys import pyhard2.driver as drv import pyhard2.driver.virtual as virtual import pyhard2.driver.deltaelektronika as delta import pyhard2.ctrlr as ctrlr def createController(): """Initialize controller.""" config = ctrlr.Co...
Synss/pyhard2
pyhard2/ctrlr/deltaelektronika.py
Python
mit
1,159
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import orderedSet class CTVNewsIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?ctvnews\.ca/(?:video\?(?:clip|playlist|bin)Id=|.*?)(?P<id>[0-9.]+)' _TESTS = [{ 'url': 'http://www.ctvn...
linglung/ytdl
youtube_dl/extractor/ctvnews.py
Python
unlicense
2,276
# # Copyright (c) 2013-2018 Quarkslab. # This file is part of IRMA project. # # 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 in the top-level directory # of this distribution and at: # # http:...
quarkslab/irma
frontend/api/common/ftp.py
Python
apache-2.0
2,432
# coding=utf-8 """**SAFE (Scenario Assessment For Emergencies) - API** The purpose of the module is to provide a well defined public API for the packages that constitute the SAFE engine. Modules using SAFE should only need to import functions from here. Contact : [email protected] .. note:: This program i...
drayanaindra/inasafe
safe/defaults.py
Python
gpl-3.0
2,781
# -*- coding: utf-8 -*- # Copyright (c) 2013 Federico Ruiz-Ugalde # Author: Federico Ruiz Ugalde <memeruiz at gmail.com> # # 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...
arcoslab/arcospyu
lib/arcospyu/pmanager/pmanager.py
Python
gpl-3.0
3,054
#! /usr/bin/env python # Replaced references to re module # Replaced long with int # Workaround for missing "".translate() # Workaround for missing string muliplication # Workaround for javascript bit shifting is 32 bits (and behind the scenes on floats) """RFC 3548: Base16, Base32, Base64 Data Encodings""" # Modifi...
emk/pyjamas
pyjs/src/pyjs/lib/base64.py
Python
apache-2.0
12,139
# -*- coding: utf-8 -*- # # OpenERP Rent documentation build configuration file, created by # sphinx-quickstart on Tue Jun 21 10:14:21 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. # ...
WE2BS/openerp-rent
docs/source/conf.py
Python
gpl-3.0
7,193
""" OAuth2 and OpenID Connect settings """ from __future__ import absolute_import, division, print_function, unicode_literals import provider.constants import provider.oauth2.forms import provider.scope from django.conf import settings # REQUIRED Issuer Identifider (the `iss` field in the `id_token`) OAUTH_OIDC_ISSU...
edx/edx-oauth2-provider
edx_oauth2_provider/constants.py
Python
agpl-3.0
2,938
# encoding: utf8 from __future__ import unicode_literals # Source: collected from different resource on internet STOP_WORDS = set(""" ثھی خو گی اپٌے گئے ثہت طرف ہوبری پبئے اپٌب دوضری گیب کت گب ثھی ض...
aikramer2/spaCy
spacy/lang/ur/stop_words.py
Python
mit
5,898
from lacore.source.chunked import ChunkedFile as BaseChunkedFile class ChunkedFile(BaseChunkedFile): maxchunk = 20971520
longaccess/longaccess-client
lacli/source/chunked.py
Python
apache-2.0
127
from unittest import TestCase from scrapy.contrib.spidermiddleware.depth import DepthMiddleware from scrapy.http import Response, Request from scrapy.spider import Spider from scrapy.statscol import StatsCollector from scrapy.utils.test import get_crawler class TestDepthMiddleware(TestCase): def setUp(self): ...
ofanoyi/scrapy
scrapy/tests/test_spidermiddleware_depth.py
Python
bsd-3-clause
1,300
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from rest_framework import serializers from s_analyzer.apps.analyzers.machine_learning.models import SecurityDailyMachineLearningPrediction from s_analyzer.apps.analyzers.moving_average.models import SecurityDailyMovingAv...
iaga84/securities-analyzer
src/s_analyzer/apps/rest/serializers.py
Python
mit
2,242
import os import time import signal import py.test from ..scheduler import TaskFinished, TaskSleep, TaskPause, TaskCancel from ..scheduler import Scheduler, Task from ..scheduler import PeriodicTask, ProcessTask, PidTask, GroupTask THIS_PATH = os.path.dirname(os.path.abspath(__file__)) SAMPLE_PROC = os.path.join(TH...
schettino72/serveronduty
sodd/tests/test_scheduler.py
Python
mit
15,515
""" Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad extra spaces ' ' when necessary so that each line has exactly L cha...
dichen001/Go4Jobs
JackChen/Facebook/68. Text Justification.py
Python
gpl-3.0
1,757
# Playhouse: Making buildings into interactive displays using remotely controllable lights. # Copyright (C) 2014 John Eriksson, Arvid Fahlström Myrman, Jonas Höglund, # Hannes Leskelä, Christian Lidström, Mattias Palo, # Markus Videll, Tomas Wickman, Emil Öhman. # # This progra...
smab/playhouse-web
src/config.py
Python
agpl-3.0
24,018
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc.textTools import safeEval from fontTools.misc.fixedTools import fixedToFloat as fi2fl, floatToFixed as fl2fi from .otBase import ValueRecordFactory import logging log = logging.getLogger(__name__) ...
MitchTalmadge/Emoji-Tools
src/main/resources/PythonScripts/fontTools/ttLib/tables/otConverters.py
Python
gpl-3.0
14,704
# -*- coding: utf-8 -*- """ netvisor.schemas.customers.get ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2013-2016 by Fast Monkeys Oy. :license: MIT, see LICENSE for more details. """ from marshmallow import Schema, fields from ..common import StringSchema from ..fields import Decimal class Custome...
fastmonkeys/netvisor.py
netvisor/schemas/customers/get.py
Python
mit
2,408
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozilla.org/MPL/ # # Softwa...
twobraids/configman_orginal
configman/value_sources/for_configparse.py
Python
bsd-3-clause
6,143
"""The tests for the Apache Kafka component.""" from collections import namedtuple import pytest import homeassistant.components.apache_kafka as apache_kafka from homeassistant.const import STATE_ON from homeassistant.setup import async_setup_component from tests.async_mock import patch APACHE_KAFKA_PATH = "homeass...
robbiet480/home-assistant
tests/components/apache_kafka/test_init.py
Python
apache-2.0
5,851
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('zerver', '0008_preregistrationuser_upper_email_idx'), ] operations = [ migrations.AlterField( model_name='userpr...
sonali0901/zulip
zerver/migrations/0009_add_missing_migrations.py
Python
apache-2.0
630
# Copyright: Damien Elmes <[email protected]> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import socket import time import traceback import gc from aqt.qt import * import aqt from anki import Collection from anki.sync import Syncer, RemoteServer, FullSyncer, MediaSyncer, \ RemoteMe...
Stvad/anki
aqt/sync.py
Python
agpl-3.0
18,494
"""Holds all pytee logic."""
KonishchevDmitry/pytee
pytee/__init__.py
Python
gpl-3.0
29
import numpy as np import tensorflow as tf from keras.models import Sequential from keras.layers import Dense, Dropout, Activation from keras.layers import Convolution2D, MaxPooling2D, Flatten from keras.optimizers import SGD, Adam, RMSprop from keras.utils import np_utils from keras.layers.normalization import BatchN...
thomasantony/CarND-Projects
Exercises/Term1/transfer-learning-lab/cifar10_test.py
Python
mit
2,442
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
fnordahl/nova
nova/tests/unit/api/openstack/compute/test_multinic.py
Python
apache-2.0
7,864
resolution = (1920, 1080) FPS = 1/60 # 60 FPS master race or whatever
brooks42/LegendOfDuckHat
window/config.py
Python
gpl-3.0
71
"""Monitors home energy use for the ELIQ Online service.""" import asyncio from datetime import timedelta import logging import eliqonline import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import CONF_ACCESS_TOKEN, CONF_NAME, POWER_WATT from ho...
kennedyshead/home-assistant
homeassistant/components/eliqonline/sensor.py
Python
apache-2.0
2,820
import unittest import types from rest_framework_ccbv.inspector import Inspector, Attribute, Method from rest_framework import generics class TestInspector(unittest.TestCase): def setUp(self): self.klass = 'GenericAPIView' self.module = 'rest_framework.generics' self.inspector = Inspector...
aericson/cdrf.co
tests/test_inspector.py
Python
mit
4,310
"""Write initial TrueGrid files for one Sandia blade station. Usage ----- start an IPython (qt)console with the pylab flag: $ ipython qtconsole --pylab or $ ipython --pylab Then, from the prompt, run this script: |> %run sandia_blade_lib/prep_stnXX_mesh.py or |> import sandia_blade_lib/prep_stnXX_mesh Au...
perryjohnson/biplaneblade
sandia_blade_lib/prep_stn20_mesh.py
Python
gpl-3.0
24,630
#!/usr/bin/env python2 # -*- coding: utf-8 -* #The MIT License (MIT) # Copyright (c) 2015 daite # 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 limitat...
daite/JAVImageDownloader
jav_image_download.py
Python
mit
3,951
# Names scores # Problem 22 # Using names.txt (right click and 'Save Link/Target As...'), a 46K text file # containing over five-thousand first names, begin by sorting it into # alphabetical order. Then working out the alphabetical value for each name, # multiply this value by its alphabetical position in the list to o...
rolandwong212/projecteuler
022.py
Python
gpl-3.0
1,315
from __future__ import print_function try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages import io import codecs import os import sys import iAnnotateSV here = os.path.abspath(os.path.dirname(__file__)) def read(*filenames, **kwargs): enc...
mskcc/iCallSV
setup.py
Python
apache-2.0
1,644
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
stifoon/navitia
source/tyr/tyr/command/__init__.py
Python
agpl-3.0
1,575
from django.contrib.gis.geos import GEOSGeometry, GeometryCollection from arches.app.utils.betterJSONSerializer import JSONSerializer, JSONDeserializer class GeoUtils(object): def create_geom_collection_from_geojson(self, geojson): geoms = [] for feature in geojson['features']: geoms....
cvast/arches
arches/app/utils/geo_utils.py
Python
agpl-3.0
1,092
""" Generate a mitmproxy dump file. This script demonstrates how to generate a mitmproxy dump file, as it would also be generated by passing `-w` to mitmproxy. In contrast to `-w`, this gives you full control over which flows should be saved and also allows you to rotate files or log to multiple files in parallel. """...
mitmproxy/mitmproxy
examples/addons/io-write-flow-file.py
Python
mit
750
import os import sys try: from django.conf import settings from django.test.utils import get_runner PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) settings.configure( STATICFILES_DIRS=( os.path.join(PROJECT_DIR, 'tests', 'dummy_content'), ), DATABASES={ ...
Mediamoose/django-svg-templatetag
runtests.py
Python
mit
1,352
# Copyright (c) 2012 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 applicable law or agreed t...
hongbin/magnum
magnum/tests/fake_policy.py
Python
apache-2.0
1,487
# -*- coding: utf-8 -*- # Copyright 2017 KMEE # Hendrix Costa <[email protected]> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp.addons.financial.tests.financial_test_classes import \ FinancialTestCase class ManualFinancialProcess(FinancialTestCase): def setUp(self): ...
thinkopensolutions/l10n-brazil
financial/tests/test_financial_move.py
Python
agpl-3.0
1,651
import contextlib from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException from selenium.common.exceptions import WebDriverException from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import WebDriverWait from os.path import join, ...
malongge/selenium-pom
pages/page.py
Python
apache-2.0
6,638
import argparse from cStringIO import StringIO import json import os from shutil import rmtree from tempfile import mkdtemp import unittest import mock from cloudweatherreport.datastore import DataStore from cloudweatherreport.utils import temp_dir with mock.patch('deployer.utils.get_juju_major_version', return_valu...
seman/cloud-weather-report
tests/test_run.py
Python
apache-2.0
13,858
#!/usr/bin/env python from __future__ import print_function import freenect import matplotlib.pyplot as mp import signal import frame_convert mp.ion() image_rgb = None image_depth = None keep_running = True def display_depth(dev, data, timestamp): global image_depth data = frame_convert.pretty_depth(data) ...
tpltnt/SimpleCV
scripts/install/win/OpenKinect/freenect-examples/demo_mp_async.py
Python
bsd-3-clause
1,071
# -*- coding: ascii -*- import logging from queue import Queue from threading import Thread, Event import socket class Queued_sender(Thread): '''envoie les actions sans saturer le medium de communication''' def __init__(self, socket): Thread.__init__(self) self.running= Event( ) self.q...
7Robot/cerveau
ia/comm/queued_sender.py
Python
gpl-3.0
1,193
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
gtzilla/fastFrag-utils
app_engine/fastfrag-converter/tornado/auth.py
Python
unlicense
46,603
# -*- coding: utf-8 -*- import codecs import collections import time class WebVtt: """ Create a webvtt formatted file """ def __init__(self, filename, regions=None): self.file = codecs.open(filename, "w", "utf_8_sig") self.file.write(u"WEBVTT\n") if regions is not N...
Robert904/mumblerecbot
webvtt.py
Python
gpl-3.0
2,752
#!/usr/bin/env python # -*- coding: utf-8 -*- from dump2data import * g_program_name = 'raw2data.py' g_date_str = '2014-12-19' g_version_str = 'v0.43' ####### Main Code Below: ####### sys.stderr.write(g_program_name+' '+g_version_str+' '+g_date_str) sys.stderr.write('\n') try: data_settings = DataSettings...
andeplane/lammps
tools/moltemplate/src/raw2data.py
Python
gpl-2.0
3,484
# -*- coding: utf-8 -*- import json import requests from abc import ABCMeta, abstractmethod from . import getLogger from .common import thumbprint, newJwk log = getLogger(__name__) class KeyNotFoundError(Exception): def __str__(self): return "Encrypion key not found: " + self.args[0] class KeyStoreABC...
nicfit/Clique
clique/keystore.py
Python
lgpl-3.0
2,746
from unittest.mock import Mock, patch from .. import two_factor_gateways as mod def test_gateway_make_call(): gateway = mod.Gateway.__new__(mod.Gateway) # instantiate without __init__ gateway.from_number = "+16145551234" gateway.client = Mock(name="client") device = Mock(name="device") device.nu...
dimagi/commcare-hq
corehq/apps/hqwebapp/tests/test_two_factor_gateways.py
Python
bsd-3-clause
768
from numpy import array from explauto.utils.config import make_configuration from explauto.sensorimotor_model.nearest_neighbor import NearestNeighbor from explauto.sensorimotor_model.non_parametric import NonParametric from environment.mathEnv import MathEnvironment, mathEnv_config from agent.supervisor import...
sebastien-forestier/explaupoppydiva
explaupoppydiva/config.py
Python
gpl-3.0
6,989
import numpy as np import glob import os from mobilenets import MobileNet model = MobileNet((224, 224, 3), alpha=1.0, weights=None) weight_path = 'weights/*.npy' fns = glob.glob(weight_path) for i, fn in enumerate(fns): print("File : ", i + 1, ": ", fn) conv1_bn = fns[0:4] conv1_wb = fns[4:5] dw10 = fns[5:15...
titu1994/MobileNetworks
_weight_extraction/weight_load.py
Python
apache-2.0
3,167
#!/usr/bin/env python import spear # 1/ The tool tool = spear.tools.ISVTool # 2/ GMM Training n_gaussians = 512 iterk = 25 iterg_train = 25 end_acc = 0.0001 var_thd = 0.0001 update_weights = True update_means = True update_variances = True norm_KMeans = True # 3/ JFA Training ru = 100 # The dimensionality of the su...
guker/spear
config/tools/isv/isv_512g_u100.py
Python
gpl-3.0
542
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and # is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012) from django.test import TestCase from django.conf import settings from django.contrib.auth.models import User fro...
jaycrossler/geo-events
geoevents/core/tests.py
Python
mit
7,049
# -------------------------------------------------------------------# # Released under the MIT license (https://opensource.org/licenses/MIT) # Contact: [email protected] # Enhancement Copyright 2016, Mrinal Haloi # -------------------------------------------------------------------# import random import os impo...
n3011/deeprl
train_dqn.py
Python
mit
1,042
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sitem.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
gencelo/tlog
app/manage.py
Python
mit
248
from django.contrib import admin from .models import Device, Interface, Inventory # Register your models here. admin.site.register(Device) admin.site.register(Interface) admin.site.register(Inventory)
clay584/chuck
chuck/inventory/admin.py
Python
mit
202
#!/usr/bin/python # $Id:$ """Rewrite the license header of source files. Usage: license.py file.py file.py dir/ dir/ ... """ import optparse import os import sys license = """# pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
bitcraft/pyglet
tools/license.py
Python
bsd-3-clause
3,724
from baseclass.SDetection import SDetection from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC # from random import shuffle from sklearn.tree import DecisionTreeClassifier class DegreeSAD(SDetection): def __init__(self, conf, trainingSet=None, testSet=None, labels=None, fold='[1]'): ...
Coder-Yu/SDLib
method/DegreeSAD.py
Python
gpl-3.0
3,260
import os from . import helpers SNIPPETS_ROOT = os.path.join(os.path.dirname(__file__), 'snippets') def get_snippet_content(snippet_name, **format_kwargs): """ Load the content from a snippet file which exists in SNIPPETS_ROOT """ filename = snippet_name + '.snippet' snippet_file = os.path.join(SNIPPETS_...
ajk8/hatchery
hatchery/snippets.py
Python
mit
578
UNKNOWN = 0 def print_grid(grid): for r in range(0, 9): for c in range(0, 9): if grid[r][c] == UNKNOWN: print('.', end='') else: print(grid[r][c], end='') print() return True def find_open_pos(grid): for r in range(0, 9): for c in range(0, 9): if grid[r][c] == UNK...
brunorijsman/euler-problems-python
euler/problem096.py
Python
bsd-2-clause
1,767
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import abc import os import glob import logging import json import warnings from monty.io import zopen from pymatgen.io.vasp.inputs import Incar, Potcar, Poscar from pymatgen.io.vasp.outputs import Vasprun, O...
blondegeek/pymatgen
pymatgen/apps/borg/hive.py
Python
mit
15,762
# Copyright 2017 The Forseti Security 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 ap...
forseti-security/forseti-security
tests/scanner/scanners/blacklist_scanner_test.py
Python
apache-2.0
3,729
"""postal_codes table added Revision ID: 13673746db16 Revises: 29fc422c56cb Create Date: 2015-04-27 17:08:52.775839 """ # revision identifiers, used by Alembic. revision = '13673746db16' down_revision = '29fc422c56cb' from alembic import op import sqlalchemy as sa import geoalchemy2 as ga from sqlalchemy.dialects i...
francois-vincent/navitia
source/sql/alembic/versions/13673746db16_postal_codes_table_added.py
Python
agpl-3.0
1,346
import json import responses from keen import exceptions from keen.client import KeenClient from keen.tests.base_test_case import BaseTestCase class CachedDatasetsTestCase(BaseTestCase): def setUp(self): super(CachedDatasetsTestCase, self).setUp() self.organization_id = "1234xxxx5678" s...
keenlabs/KeenClient-Python
keen/tests/cached_datasets_tests.py
Python
mit
13,778