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
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, unicode_literals import random from tempfile import NamedTemporaryFile from struct import pack from sqlalchemy import types as sa_types from oar.lib.compat import is_bytes, str, basestring def serialize_rows_to_csv(rows, null_value, output)...
fr0uty/oartm
oar/lib/psycopg2.py
Python
bsd-3-clause
3,566
"""Parser for bvlc caffe googlenet.""" # Authors: Michael Eickenberg # Kyle Kastner # License: BSD 3 Clause from sklearn.externals import joblib from ...datasets import get_dataset_dir, download from caffemodel import _parse_caffe_model, parse_caffe_model import os from ...utils import check_tensor from googl...
eickenberg/sklearn-theano
sklearn_theano/feature_extraction/caffe/googlenet.py
Python
bsd-3-clause
9,445
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('recipes', '0001_initial'), ] operations = [ migrations.AlterUniqueTogether( name='recipe', unique_to...
brandonw/meal_planner
meal_planner/recipes/migrations/0002_auto_20150104_1942.py
Python
bsd-3-clause
369
from pycri.plugins import Plugin, command class Help(Plugin): @command def help(self, command): '''Displays a brief explanation of a given command. Example: !help help''' try: command_documentation = self.commands[command].__doc__ except KeyError: return 'No suc...
xintron/pycri
pycri/plugins/core.py
Python
bsd-3-clause
1,760
#! /usr/bin/env python import logging from numpy import mean from pbcore.io.FastqIO import FastqReader, FastqWriter from pbrdna.arguments import args, MIN_ACCURACY ACCURACY = getattr(args, 'min_accuracy', MIN_ACCURACY) log = logging.getLogger(__name__) def quality_filter(input_fastq, output_fastq, min_accuracy=ACCU...
lufuhao/PB_rDnaTools
src/pbrdna/fastq/quality_filter.py
Python
bsd-3-clause
1,561
from __future__ import absolute_import import io import os import six import zlib import base64 import msgpack import inspect from parsimonious.grammar import Grammar, NodeVisitor from parsimonious.exceptions import ParseError from sentry import projectoptions from sentry.stacktraces.functions import set_in_app from...
beeftornado/sentry
src/sentry/grouping/enhancer.py
Python
bsd-3-clause
20,863
""" The config module holds package-wide configurables and provides a uniform API for working with them. Overview ======== This module supports the following requirements: - options are referenced using keys in dot.notation, e.g. "x.y.option - z". - keys are case-insensitive. - functions should accept partial/regex k...
jreback/pandas
pandas/_config/config.py
Python
bsd-3-clause
23,688
from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.views.generic import CreateView, UpdateView, DeleteView from django.core.urlresolvers import reverse_lazy from .models import Customer, Session, CompanyProfile from therapyinvoicing.customers.forms import Cust...
ylitormatech/terapialaskutus
therapyinvoicing/customers/views.py
Python
bsd-3-clause
10,031
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ActivationKey' db.create_table('activation_activationkey', ( ('id', self.gf('d...
django-stars/dash2011
presence/apps/activation/migrations/0001_initial.py
Python
bsd-3-clause
4,562
from setuptools import setup # Remove build status and move Gitter link under title for PyPi README = open('README.rst').read() \ .replace('|Build Status|', '', 1) \ .replace('|Gitter|', '', 1) \ .replace('===\n', '===\n\n|Gitter|\n') setup( name='django-cacheops', version='2.4.3', ...
whyflyru/django-cacheops
setup.py
Python
bsd-3-clause
1,655
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/sequencer.py __version__=''' $Id: sequencer.py 3959 2012-09-27 14:39:39Z robin $ ''' __doc__="""A Sequencer class counts things. It aids numbering ...
nakagami/reportlab
src/reportlab/lib/sequencer.py
Python
bsd-3-clause
9,555
"""`Dependency injector` setup script.""" import os import re from setuptools import setup, Extension # Defining setup variables: defined_macros = dict() defined_macros['CYTHON_CLINE_IN_TRACEBACK'] = 0 # Getting description: with open('README.rst') as readme_file: description = readme_file.read() # Getting re...
rmk135/objects
setup.py
Python
bsd-3-clause
3,901
""" tests.web ~~~~~~~~~ Unit tests for the viewer.web package. :copyright: © 2014 by Petr Zemek <s3rvac@gmail.com> and contributors :license: BSD, see LICENSE for more details """ import re import unittest from unittest import mock import viewer import viewer.web from tests.git_tests import get...
s3rvac/git-branch-viewer
tests/web_tests.py
Python
bsd-3-clause
4,998
from django.utils.translation import ugettext_lazy as _ from django.db import models from cms.models import CMSPlugin, Page from django.utils.translation import ugettext_lazy as _ from posixpath import join, basename, splitext, exists from filer.fields.folder import FilerFolderField from django.conf import settings fro...
pbs/cmsplugin-filer
cmsplugin_filer_folder/models.py
Python
bsd-3-clause
1,475
#!/usr/bin/env python """ Vision demo configuration routines. Notes ----- Information regarding the cartridges and columns that own specific neurons are not used during execution, but may be used for examining the generated LPU graphs. Genetic/neurotransmitter information included in the neuron data is artificial an...
neurokernel/vision
examples/data/vision_configuration.py
Python
bsd-3-clause
33,683
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for putting velocity differentials into SkyCoord objects. Note: the skyoffset velocity tests are in a different file, in test_skyoffset_transformations.py """ import pytest import numpy as np from ... import units as ...
funbaker/astropy
astropy/coordinates/tests/test_sky_coord_velocities.py
Python
bsd-3-clause
6,664
#! /usr/bin/python ''' Given a linked list, return the node where the cycle begins. If there is no cycle, return null. ''' from node_struct import ListNode class Solution: # @param head, a ListNode # @return a boolean def hasCycle(self, head): """ :type head: ListNode :rtype: bool ...
shub0/algorithm-data-structure
python/detec_cycle.py
Python
bsd-3-clause
2,155
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). """ Find a package. """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ impo...
aldebaran/qibuild
python/qibuild/actions/find.py
Python
bsd-3-clause
2,496
""" kombu.utils =========== Internal utilities. """ from __future__ import absolute_import, print_function, unicode_literals import importlib import numbers import random import sys from contextlib import contextmanager from itertools import count, repeat from time import sleep from uuid import uuid4 from vine.uti...
Elastica/kombu
kombu/utils/__init__.py
Python
bsd-3-clause
12,596
from auth.models import User from django.test import TestCase from registration import forms class RegistrationFormTests(TestCase): """ Test the default registration forms. """ def test_registration_form(self): """ Test that ``RegistrationForm`` enforces username constraints ...
sv1jsb/dwitter
registration/tests/forms.py
Python
bsd-3-clause
5,296
# -*- coding: utf-8 -*- # # Authors: Denis A. Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Juergen Dammers <j.dammers@fz-juelich.de> # # License: BSD-3-Clause from inspect import isfunction from collections import namedtuple from copy import deepcopy from n...
pravsripad/mne-python
mne/preprocessing/ica.py
Python
bsd-3-clause
121,210
from tornado import testing from . import base class HyperLogLogTests(base.AsyncTestCase): @testing.gen_test def test_hyperloglog(self): key1, key2, key3 = self.uuid4(3) result = yield self.client.pfadd(key1, 'foo', 'bar', 'zap', 'a') self.assertTrue(result) result = yield se...
gmr/tredis
tests/hyperloglog_tests.py
Python
bsd-3-clause
666
#!/usr/bin/env python # -*- coding: utf-8 -*- # # clustrous documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 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 # a...
eddiejessup/clustrous
docs/conf.py
Python
bsd-3-clause
8,421
from haystack.views import SearchView from haystack.query import SearchQuerySet from haystack.forms import SearchForm from django.contrib.auth.decorators import login_required from emma.interface.models import Metadata, Keyword, User from django.http import Http404 import os, sys from models import Exclude from django....
djangowebstudio/emma
emma/search/views.py
Python
bsd-3-clause
2,459
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 7, transform = "None", sigma = 0.0, exog_count = 0, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_None/trend_MovingMedian/cycle_7/ar_/test_artificial_128_None_MovingMedian_7__0.py
Python
bsd-3-clause
261
"""Various tests on satisfiability using dimacs cnf file syntax You can find lots of cnf files in ftp://dimacs.rutgers.edu/pub/challenge/satisfiability/benchmarks/cnf/ """ import os from diofant.logic.algorithms.dpll import dpll_satisfiable from diofant.logic.algorithms.dpll2 import \ dpll_satisfiable as dpll2_sa...
diofant/diofant
diofant/tests/logic/test_dimacs.py
Python
bsd-3-clause
1,087
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL 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. #...
josh-gree/u-net-polychromatic-ct
src/data/odl_fbp.py
Python
bsd-3-clause
17,560
##% Demo 7: Algorithms02 # # In this demo the usage of the algorithms on the SART family among with their options are presented. # -------------------------------------------------------------------------- # -------------------------------------------------------------------------- # This file is part of the TIGRE Tool...
CERN/TIGRE
Python/demos/d07_Algorithms02.py
Python
bsd-3-clause
6,636
# -*- coding: UTF-8 -*- import tweepy, codecs, time, sys, tkFileDialog from textwrap import TextWrapper from keys import * reload(sys) sys.setdefaultencoding('utf8') def streaming_filter(): auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) api = tw...
paredespablo/NodosApp
lib/streamingfilter.py
Python
bsd-3-clause
3,621
import os from setuptools import setup, find_packages from distutils.command.install import INSTALL_SCHEMES def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "Relo", version = '0.7-beta', author = "Cecil Woebker", author_email = "cwoebker@gmail.com",...
cwoebker/relo
setup.py
Python
bsd-3-clause
1,553
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
motord/Motorcycle-Diaries
lib/apiclient/discovery.py
Python
bsd-3-clause
12,121
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2020, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
thermokarst/qiime2
qiime2/core/testing/type.py
Python
bsd-3-clause
1,805
import numpy as np from os.path import dirname from os.path import join def bigbuckbunny(): """Test video data Returns ------- path : string Absolute path to bigbuckbunny.mp4 """ module_path = dirname(__file__) return join(module_path, 'data', 'bigbuckbunny.mp4') def fullreferenc...
beyondmetis/scikit-video
skvideo/datasets/__init__.py
Python
bsd-3-clause
974
#!/usr/bin/env python import os import sys from setuptools import find_packages, setup from django_x509 import get_version def get_install_requires(): """ parse requirements.txt, ignore links, exclude comments """ requirements = [] for line in open('requirements.txt').readlines(): # skip...
openwisp/django-x509
setup.py
Python
bsd-3-clause
2,197
#! /usr/bin/env python __author__ = 'Brett Bowman' __email__ = 'bbowman@pacificbiosciences.com' from pbmgx.io.BlasrIO import def read_hits_by_query( blasr_file ): queries = {} for hit in BlasrReader( blasr_file ): try: queries[hit.qname].append( hit ) except: queries[h...
bnbowman/MetagenomicTools
src/pbmgx/io/utils.py
Python
bsd-3-clause
358
# Copyright (c) 2015, Yahoo Inc. # Copyrights licensed under the BSD # See the accompanying LICENSE.txt file for terms. import json import os _metadata_file = os.path.join( os.path.dirname(__file__), 'package_metadata.json' ) if os.path.exists(_metadata_file): # pragma: no cover with open(_metadata_fil...
yahoo/metafs
metafs/__init__.py
Python
bsd-3-clause
498
# -*- coding: utf-8 -*- from logging_json_formatter.formatters import AppendJSONFormatter __author__ = 'Opbeat, Inc' __email__ = 'support@opbeat.com' __version__ = '0.1.0'
opbeat/python-logging-json-formatter
logging_json_formatter/__init__.py
Python
bsd-3-clause
173
import numpy as np from mirdata.datasets import rwc_classical from mirdata import annotations from tests.test_utils import run_track_tests def test_track(): default_trackid = "RM-C003" data_home = "tests/resources/mir_datasets/rwc_classical" dataset = rwc_classical.Dataset(data_home) track = dataset....
mir-dataset-loaders/mirdata
tests/datasets/test_rwc_classical.py
Python
bsd-3-clause
7,066
from flask import Flask, session, redirect, url_for, request import urllib2 import urllib import simplejson import redis app = Flask(__name__) app.debug = True app.config['APPLICATION_ROOT'] = '/go' @app.route('/set_position', methods=['GET', 'POST']) def set_position(): user = check_auth(request.form.get('access_...
adinardi/appricot
server/appricot.py
Python
bsd-3-clause
3,138
from django.test import TestCase from lfs.catalog.models import Product from lfs.catalog.models import Category class ProductsTestCase(TestCase): """ """ def setUp(self): """ """ self.client.login(username="admin", password="admin") for i in range(0, 10): prod...
diefenbach/django-lfs
lfs/tests/products.py
Python
bsd-3-clause
1,807
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Integration'] , ['PolyTrend'] , ['Seasonal_DayOfMonth'] , ['ARX'] );
antoinecarme/pyaf
tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_PolyTrend_Seasonal_DayOfMonth_ARX.py
Python
bsd-3-clause
164
# Copyright 2009 Tim Savage <tim.savage@poweredbypenguins.org> # Licensed under the terms of the BSD License (see LICENSE) VERSION = (0, 3, 1, 'beta') __version__ = '.'.join(map(str, VERSION))
timsavage/django-ajax-forms
ajax_forms/__init__.py
Python
bsd-3-clause
194
def get(route, handler): return ("GET", route, handler) def post(route, handler): return ("POST", route, handler) def put(route, handler): return ("PUT", route, handler) def patch(route, handler): return ("PATCH", route, handler) def delete(route, handler): return ("DELETE", route, handler) ...
brinkframework/brink
brink/urls.py
Python
bsd-3-clause
480
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this ...
vlegoff/tsunami
src/secondaires/botanique/types/herbe.py
Python
bsd-3-clause
1,904
from sklearn2sql_heroku.tests.regression import generic as reg_gen reg_gen.test_model("SVR_linear" , "RandomReg_100" , "mssql")
antoinecarme/sklearn2sql_heroku
tests/regression/RandomReg_100/ws_RandomReg_100_SVR_linear_mssql_code_gen.py
Python
bsd-3-clause
130
import logging import psycopg2 import psycopg2.extras connection_string = "host=localhost dbname=pgwatch2 user=pgwatch2 password=pgwatch2admin connect_timeout='3'" connection_string_metrics = "host=localhost dbname=pgwatch2_metrics user=pgwatch2 password=pgwatch2admin connect_timeout='3'" def setConnectionString(co...
cybertec-postgresql/pgwatch2
webpy/datadb.py
Python
bsd-3-clause
3,903
HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' bold='\033[1m' nobold='\033[0m' Separator="================================%s==================================" silent=0 def Str(strin0,col="red",Bold=True): if silent==1: return st...
griffinfoster/shapelets
shapelets/phs/ModColor.py
Python
bsd-3-clause
1,060
# coding=utf-8 from __future__ import absolute_import, division, print_function import pytest import math import os import sys from collections import Iterator from distutils.version import LooseVersion import partd from toolz import merge, join, filter, identity, valmap, groupby, pluck import dask import dask.bag a...
gameduell/dask
dask/bag/tests/test_bag.py
Python
bsd-3-clause
34,391
""" A set of utility classes. """ from functools import reduce from collections import defaultdict from collections.abc import Hashable class GroupBy: """ Create objects hierarchy by grouping by a list of functions/groupers. Objects are grouped by first grouper and then, within each group, by the res...
manugrandio/collectionz
collectionz/collectionz.py
Python
bsd-3-clause
5,190
import os import numpy from scopyon.samples import generate_points, move_points # from scopyon.samples import attempt_reactions from scopyon.config import Config from scopyon.epifm import EPIFMSimulator # from scopyon.image import convert_8bit, save_image def test_samples(): rndseed = 0 rng = numpy.random.R...
ecell/bioimaging
examples/legacy/samples_script.py
Python
bsd-3-clause
2,454
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2018-03-23 12:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('registrations', '0007_thirdpartyregistrationerror'), ] operations = [ migrat...
praekelt/hellomama-registration
registrations/migrations/0008_auto_20180323_1228.py
Python
bsd-3-clause
598
from django import template register = template.Library() @register.filter() def get_range(value): """ Filter - returns a list containing range made from given value Usage (in template): <ul>{% for i in 3|get_range %} <li>{{ i }}. Do something</li> {% endfor %}</ul> ...
theirc/ServiceInfo
service_info_cms/templatetags/get_range.py
Python
bsd-3-clause
576
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 5, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 12);
antoinecarme/pyaf
tests/artificial/transf_None/trend_MovingMedian/cycle_5/ar_12/test_artificial_32_None_MovingMedian_5_12_100.py
Python
bsd-3-clause
263
# Copyright (C) 2013 Lindley Graham """ This file provides a mpirun work-around for clusters that do not have the ibrun command. """ import os, stat class random_manningsn(object): """ This class is an implementation of :class:`polyadcirc.run_framework.random_manningsn` that provides a ``mpirun`` base...
UT-CHG/PolyADCIRC
polyadcirc/run_framework/no_ibrun.py
Python
bsd-3-clause
4,141
from __future__ import unicode_literals from django import forms from django.db.models.functions import Lower from django.utils.translation import ugettext_lazy as _ from dash.utils import get_month_range from tracpro.charts import filters from . import models from .tasks import sync_questions_categories class Po...
rapidpro/tracpro
tracpro/polls/forms.py
Python
bsd-3-clause
3,326
## # pytibrv/msg.py # TIBRV Library for PYTHON # # LAST MODIFIED : V1.1 20170220 ARIEN arien.chen@gmail.com # # DESCRIPTIONS # ----------------------------------------------------------------------------- # 1. Data Type # API NOT SUPPORT # TIBRVMSG_ENCRYPTED # TIBRVMSG_XML # # TibrvMsg NOT SUPPORT #...
arienchen/pytibrv
pytibrv/msg.py
Python
bsd-3-clause
106,343
#!/bin/python import glob d = {} for f in glob.glob("assets/*.txt"): print "processing " + f + " ..." fi = open(f, 'r') s = fi.read() fi.close() for c in s.decode('utf8'): if not d.has_key(c): d[c]=1 else: d[c]=d[c]+1 pass c2b={} b2c={} liuTable=["l...
alastorid/bobo
wordfreq.py
Python
bsd-3-clause
1,887
#!/usr/bin/env python ''' Quantile regression model Model parameters are estimated using iterated reweighted least squares. The asymptotic covariance matrix estimated using kernel density estimation. Author: Vincent Arel-Bundock License: BSD-3 Created: 2013-03-19 The original IRLS function was written for Matlab by...
rgommers/statsmodels
statsmodels/regression/quantile_regression.py
Python
bsd-3-clause
15,280
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division from django.contrib import admin from .models import * class MaterialEntryAdmin(admin.ModelAdmin): list_display = ( 'get_realname', 'get_username', 'title', 'is_locked', 'get_le...
team-xue/xue
xue/materials/admin.py
Python
bsd-3-clause
472
# Create your views here. from achievs.models import Achievement, Level from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.template import RequestContext def results(request, achiev_id):...
eawerbaneth/Scoreboard
achievs/views.py
Python
bsd-3-clause
629
from sympy import (Eq, Matrix, pi, sin, sqrt, Symbol, Integral, Piecewise, symbols, Float) from mpmath import mnorm, mpf from sympy.solvers import nsolve from sympy.utilities.lambdify import lambdify from sympy.utilities.pytest import raises, XFAIL from sympy.utilities.decorator import conserve_mpmath_dps @XFAIL d...
jaimahajan1997/sympy
sympy/solvers/tests/test_numeric.py
Python
bsd-3-clause
3,328
from datetime import datetime import re from django.contrib import messages from django.core.mail.message import EmailMessage from django.core.urlresolvers import reverse from django.db import transaction from django.db.models.aggregates import Count from django.http.response import Http404 from django.shortcuts import...
puttarajubr/commcare-hq
corehq/apps/hqpillow_retry/views.py
Python
bsd-3-clause
9,639
from .panels import AutoreloadPanel __version__ = '0.2.0'.split('.')
gregmuellegger/django-debug-toolbar-autoreload
debug_toolbar_autoreload/__init__.py
Python
bsd-3-clause
71
from fabric.api import run, env, cd, sudo, prefix def testing(): env.host_string = "linkfloyd.com" env.user = "miratcan" env.webapp = "/home/miratcan/webapps/linkfloyd/linkfloyd/linkfloyd/" env.activate_env = 'source /home/miratcan/envs/linkfloyd/bin/activate' def _virtualenv(command): with cd(en...
linkfloyd/linkfloyd
linkfloyd/fabfile.py
Python
bsd-3-clause
943
# From http://sankhamukherjee.blogspot.com/ ###################################### # This program is used for calculating # the bravis lattice points of a unit # cell, and displaying the results in # 3D. # # Note that, since the mathematics of # the bravis lattices are so uniform, # it is relatively easy to calculate...
katyhuff/pbfhr
bcc.py
Python
bsd-3-clause
2,283
import django.conf.global_settings as DEFAULT_SETTINGS import os, datetime, copy import getpass from pwd import getpwnam PACKAGE_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..')) PROJECT_ROOT = os.path.normpath(PACKAGE_ROOT) DEPLOYMENT_ROOT = PROJECT_ROOT PROJECT_NAME = 'fum' ADMINS = ( ...
futurice/futurice-ldap-user-manager
fum/settings/base.py
Python
bsd-3-clause
7,379
"""add x,y to markers Revision ID: 20f14f4f1de7 Revises: 21b54c24a2c8 Create Date: 2018-10-01 23:27:21.307860 """ # revision identifiers, used by Alembic. revision = '20f14f4f1de7' down_revision = '21b54c24a2c8' branch_labels = None depends_on = None import sqlalchemy as sa from alembic import op def upgrade(): ...
hasadna/anyway
alembic/versions/20f14f4f1de7_add_x_y_to_markers.py
Python
mit
747
# Name: python_postRequest.py # Haupt-Funktion: sendet die aktuelle Position mit dem Zeitstempel an den Server __author__ = "BKonstantin" __date__ = "$14.12.2015 13:29:04$" #if __name__ == "__main__": # print ("start postRequest...") # Imports: # Die Bibliothek "requests" muss vorher installiert werden. import re...
hwroitzsch/BikersLifeSaver
src/nfz_module/examples/python_postRequest.py
Python
mit
2,135
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/necklace/shared_necklace_flashy_choker.iff" result.attrib...
anhstudios/swganh
data/scripts/templates/object/tangible/wearables/necklace/shared_necklace_flashy_choker.py
Python
mit
482
# Copyright (c) 2015-2017 Cisco Systems, Inc. # # 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, merge...
kharkevich/molecule
molecule/verifier/goss.py
Python
mit
3,658
import subprocess class Jenkins: def ask(self, question): if subprocess.call(question, shell=True, stdout=FNULL, stderr=subprocess.STDOUT) == 127: print question + " is not installed, installing..." # Ask installer for installation else: # It's ok, nothing to do...
gabriellacerda/slash
source/Main/Jenkins.py
Python
mit
321
""" Command-line Interface (cli) ============================ This module provides utilities for interacting with a user from the command-line. .. autofunction:: mwapi.cli.do_login """ import getpass import sys from .errors import ClientInteractionRequest def do_login(session, for_what): """ Performs a log...
mediawiki-utilities/python-mwapi
mwapi/cli.py
Python
mit
2,155
import nmap import optparse def nmapScan(tgtHost,tgtPort): nmScan = nmap.PortScanner() nmScan.scan(tgtHost,tgtPort) state=nmScan[tgtHost]['tcp'][int(tgtPort)]['state'] print "[*] " + tgtHost + " tcp/"+tgtPort +" "+state def main(): parser = optparse.OptionParser('usage %prog '+\ ...
psb-seclab/CTFStuff
utils/violent_python_code/CH2/2-nmapScan.py
Python
mit
948
# CODECHEF - Walk # http://www.codechef.com/MARCH14/problems/WALK if __name__ == '__main__': T = int(raw_input()) for count in xrange(T): V = 0 N = int(raw_input()) W = [int(w) for w in raw_input().split()] for n in xrange(N-1, -1, -1): V+=1 if V < W[n]: ...
everyevery/programming_study
codechef/walk/walk.py
Python
mit
361
from . import proxies __all__ = ( 'proxies', )
california-civic-data-coalition/django-calaccess-processed-data
calaccess_processed_flatfiles/models.py
Python
mit
52
import json import unittest from slack_sdk.scim import SearchUsersResponse, SCIMResponse from slack_sdk.scim.v1.internal_utils import _to_snake_cased class TEstInternals(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_snake_cased(self): response_body ...
slackhq/python-slackclient
tests/slack_sdk/scim/test_response.py
Python
mit
2,245
"""Support for SMS dongle sensor.""" import logging import gammu # pylint: disable=import-error from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import SIGNAL_STRENGTH_DE...
rohitranjan1991/home-assistant
homeassistant/components/sms/sensor.py
Python
mit
2,543
from wpc import app from wpc.models import Stream, Subscriber from flask import render_template import requests import json def send_message(recipient_vars, subject, text, html): return requests.post( app.config['MAILGUN_API_URL'], auth=("api", app.config['MAILGUN_API_KEY']), data={"from...
jniebuhr/WatchPeopleCode
wpc/email_notifications.py
Python
mit
1,642
from dynamic_fixtures.fixtures.basefixture import BaseFixture # Will not be loaded class WrongFixtureClass(BaseFixture): pass
Peter-Slump/django-dynamic-fixtures
tests/fixtures/loader/apps/app_wrong_fixture_class/fixtures/003_wrong_fixture_class.py
Python
mit
132
import pickle from spacy.lang.vi import Vietnamese from ...util import make_tempdir def test_vi_tokenizer_serialize(vi_tokenizer): tokenizer_bytes = vi_tokenizer.to_bytes() nlp = Vietnamese() nlp.tokenizer.from_bytes(tokenizer_bytes) assert tokenizer_bytes == nlp.tokenizer.to_bytes() assert nlp.t...
honnibal/spaCy
spacy/tests/lang/vi/test_serialize.py
Python
mit
1,308
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/attachment/booster/shared_xwing_booster_s01_neg.iff" result.at...
obi-two/Rebelion
data/scripts/templates/object/tangible/ship/attachment/booster/shared_xwing_booster_s01_neg.py
Python
mit
470
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/terrain/tatooine/shared_pinnacle_sacred_tatooine.iff" result.attribute_...
anhstudios/swganh
data/scripts/templates/object/static/terrain/tatooine/shared_pinnacle_sacred_tatooine.py
Python
mit
461
import main import logging watcherAPI = main.PySocialWatcher if __name__ == '__main__': logging.basicConfig(level=logging.INFO) watcherAPI.load_credentials_file("credentials.csv") # watcherAPI.check_tokens_account_valid() dataframe = watcherAPI.run_data_collection("input_examples/gcc_diabetes_instagram...
CSDE-UW/paa_2017_social_media
Estimate_Facebook_Audience/pySocialWatcher/pysocialwatcher/__init__.py
Python
mit
342
# Standard import pickle, os, csv, shutil, math import xml.etree.ElementTree as ET import numpy as np from glob import glob # Installed from dbfpy import dbf # ALEM import alemobject from settings import * from utilfunctions import * def convert_5_to_dn(): string_args = {'ext':'csv', 'band':'all', 'scene':'all'...
jeromebchouinard/alem
alemutils.py
Python
mit
25,547
import sys def print_grid(grid): for i in range(len(grid)): line = '' for j in range(len(grid[0])): if( grid[i][j] == 0 ): line += '.' else: line += '#' print line def read_grid(filename): f = open(filename) words = f.readlin...
mjgrav2001/atpesc-2013
challenge/read_grid.py
Python
mit
1,350
# -*- coding: utf-8 -*- """ S3 Encoder/Decoder Base Class @copyright: 2011-2021 (c) Sahana Software Foundation @license: MIT 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 w...
flavour/eden
modules/s3/s3codec.py
Python
mit
6,332
# Copyright (c) 2019 Sean Vig # # 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, merge, publish, distribu...
zordsdavini/qtile
libqtile/command_client.py
Python
mit
11,248
import json import configparser import socket import threading import os import sys import traceback from peripherals import LocalPeripherals from iseclogger import Logger from threading import Thread from peripherals import PeripheralObject from peripherals import LocalPeripherals import time from datetime import date...
dmayrand/Clients-for-actionKATA
python/peripheralscontrol.py
Python
mit
11,964
# -*- coding: utf-8 -*- # # pyXFOIL documentation build configuration file, created by # sphinx-quickstart on Tue Aug 11 23:35:51 2015. # # 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...
leal26/AeroPy
docs/conf.py
Python
mit
10,115
from .iq_groups_create import CreateGroupsIqProtocolEntity from .iq_groups_delete import DeleteGroupsIqProtocolEntity from .iq_groups_leave import LeaveGroupsIqProtocolEntity from .iq_groups_list import ListGroupsIqProtocolEntity from .iq_groups_info import InfoGroupsIqProtocolEntity from ...
felix-dumit/campusbot
yowsup2/yowsup/layers/protocol_groups/protocolentities/__init__.py
Python
mit
534
#!/usr/bin/env python import rospy import time from barc.msg import ECU from labs.msg import Z_DynBkMdl # initialize state x = 0 y = 0 v_x = 0 v_y = 0 # ecu command update def measurements_callback(data): global x, y, psi, v_x, v_y, psi_dot x = data.x y = data.y psi = data.psi v_x = data.v_x v_y = data.v...
BARCproject/barc
workspace/src/labs/src/lab2/controller.py
Python
mit
1,813
from rllab.misc.ext import compile_function, lazydict from rllab.core.serializable import Serializable from rllab.optimizers.hf import hf_optimizer import time from rllab.optimizers.minibatch_dataset import BatchDataset class HessianFreeOptimizer(Serializable): """ Performs unconstrained optimization via Hess...
brain-research/mirage-rl-qprop
rllab/optimizers/hessian_free_optimizer.py
Python
mit
2,936
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_mercenary_messanger_hum_m.iff" result.attribute_templa...
anhstudios/swganh
data/scripts/templates/object/mobile/shared_dressed_mercenary_messanger_hum_m.py
Python
mit
458
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """ Delete all dependencies for pebblejs projects. """ orm.Dependency.objects....
thunsaker/cloudpebble
ide/migrations/0047_remove_pebblejs_dependencies.py
Python
mit
14,412
# -*- coding: utf-8 -* def format_table(table, format): if format == "xml": return table2xml(keyphrases_table) elif format == "csv": return table2csv(keyphrases_table) else: raise Exception("Unknown table format: '%s'. " "Please use one of: 'xml', 'csv'." % ...
msdubov/AST-text-analysis
east/formatting.py
Python
mit
2,765
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' needs spidev installed http://www.raspberrypi-spy.co.uk/2014/08/enabling-the-spi-interface-on-the-raspberry-pi/ ''' import sys import RPi.GPIO as GPIO import time import spidev pd = 0 #Analog in (on linker-base ADC) spi = spidev.SpiDev() spi.open(0,0) def rea...
timwaizenegger/raspberrypi-examples
extension-board/analogIn.py
Python
mit
728
'''Test our own built-in asserts''' from common import TestQless class TestAsserts(TestQless): '''Ensure our own assert methods raise the exceptions they're supposed to''' def test_assertRaisesRegexp(self): '''Make sure that our home-brew assertRaisesRegexp works''' def func(): ''...
seomoz/qless-core
test/test_asserts.py
Python
mit
886
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/food/foraged/shared_foraged_fruit_s2.iff" result.attribute_template...
anhstudios/swganh
data/scripts/templates/object/tangible/food/foraged/shared_foraged_fruit_s2.py
Python
mit
457
import logging import os from pyp2rpm import archive from pyp2rpm.dependency_parser import deps_from_pyp_format, deps_from_pydit_json from pyp2rpm.package_data import PackageData from pyp2rpm import settings from pyp2rpm import utils logger = logging.getLogger(__name__) class LocalMetadataExtractor(object): ""...
MichaelMraka/pyp2rpm
pyp2rpm/metadata_extractors.py
Python
mit
14,720
import post import questionnaire
ptr-yudai/ltkit
src/ltkit/panel/server/__init__.py
Python
mit
33