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
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2022, 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. # ------------------------------------------------...
qiime2/qiime2
qiime2/metadata/io.py
Python
bsd-3-clause
17,510
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
jrleeman/MetPy
metpy/_version.py
Python
bsd-3-clause
18,449
from __future__ import division from . import opnames def parseInstructions(bytestream, isConstructor): data = bytestream assert(data.off == 0) instructions = {} while data.size() > 0: address = data.off inst = getNextInstruction(data, address) #replace constructor invocations...
alexkasko/krakatau-java
krakatau-lib/src/main/resources/Lib/Krakatau/bytecode.py
Python
gpl-3.0
7,976
#!/usr/bin/env python # Copyright (c) 2007 Ruben Reifenberg # # 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, m...
shful/python-rrlog
doc/demo/demo_xmlrpcserverfiles.py
Python
mit
1,657
# -*- coding: utf-8 -*- """Utility functions to get information about the git or mercurial repository in the working directory """ import subprocess import os def get_current_git_branch(): command = ["git", "symbolic-ref", "--short", "-q", "HEAD"] try: proc = subprocess.Popen(command, stdout=subproces...
sloria/doitlive
doitlive/version_control.py
Python
mit
1,805
from pyedas.portal.edas import * request_port = 5670 response_port = 5671 edas_server = "localhost" portal = None try: portal = EDASPortal( edas_server, request_port, response_port) rId = portal.sendMessage( "quit", [] ) except Exception, err: traceback.print_exc() finally: if( portal ): portal.sh...
nasa-nccs-cds/EDAS
python/src/pyedas/shutdownServer.py
Python
gpl-2.0
332
import hashlib from functools import wraps from flask import request, Response, current_app def check_auth(username, password): pwd_hash = hashlib.md5(password.encode()).hexdigest() return ( username == current_app.config['USERNAME'] and pwd_hash == current_app.config['PASSWORD_HASH'] ) ...
MrLeeh/flaskhab
app/auth.py
Python
mit
816
import typing from falsy.netboy.curl_loop import CurlLoop from falsy.netboy.fetch import net_boy from falsy.netboy.run import run import pycurl class NetBoy: class Exception(Exception): pass class Dict(typing.Dict[str, typing.Any]): def __getattr__(self, name): # type: (str) -> A...
pingf/falsy
falsy/netboy/netboy.py
Python
mit
2,251
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Script for a testing an existing SDK. This script is normally run immediately after build_sdk.py. """ import argparse import o...
heke123/chromium-crosswalk
native_client_sdk/src/build_tools/test_sdk.py
Python
bsd-3-clause
8,061
#!/usr/bin/env python2 """poisson.py Author: Jonah Miller (jonah.maxwell.miller@gmail.com) Time-stamp: <2017-06-28 20:27:28 (jmiller)> This is an example script that solves the Poisson equation using pyballd. """ from __future__ import print_function import matplotlib as mpl mpl.use("Agg") from matplotlib import pyp...
Yurlungur/pyballd
examples/poisson_vec.py
Python
lgpl-3.0
2,537
__doc__ = """ An easy to use app that provides Stack Overflow style badges with a minimum ammount of effort in django See the README file for details, usage info, and a list of gotchas. """ from setuptools import setup setup( name='django-badges', version='0.1.9', author='James Robert', author_email=...
igorkramaric/django-badges
setup.py
Python
gpl-3.0
1,215
#!/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
arenadata/ambari
ambari-agent/src/test/python/ambari_agent/TestHeartbeat.py
Python
apache-2.0
11,829
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """The deep heap profiler script for Chrome.""" import copy import datetime import json import logging import optparse import os import re import subpro...
hujiajie/pa-chromium
tools/deep_memory_profiler/dmprof.py
Python
bsd-3-clause
68,768
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
alfasin/st2
st2client/st2client/models/core.py
Python
apache-2.0
11,745
""" Tests for the snoozy package. """ import unittest import snoozy class TestSnoozy(unittest.TestCase): def test_evaluate(self): # Attributes should be evaluated on access. called = [] class Foo(object): @snoozy.lazy_property def foo(self): ca...
cngo-github/snoozy
snoozy/tests/test_snoozy.py
Python
mit
2,478
# -*- coding: utf-8 -*- # # The Biologist's Guide to Computing documentation build configuration file, created by # sphinx-quickstart on Sun Oct 11 03:59:07 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 ...
tjelvar-olsson/biologists-guide-to-computing
source/conf.py
Python
cc0-1.0
11,737
from hooks import hookutils hiddenimports = ["PyQt4.QtCore", "PyQt4.QtGui", "PyQt4.QtSvg"] if hookutils.qwt_numpy_support(): hiddenimports.append("numpy") if hookutils.qwt_numeric_support(): hiddenimports.append("Numeric") if hookutils.qwt_numarray_support(): hiddenimports.append("numarray")
pdubroy/kurt
build/MacOS/PyInstaller/pyinstaller-svn-r812/hooks/hook-PyQt4.Qwt5.py
Python
gpl-2.0
307
#!/usr/bin/env python # -*- coding: utf-8 -*- # ############################################################################ ## ## ## This file is part of DPAPIck ## ## Windows DPAPI decryption & forensic...
newsoft/dpapick
DPAPI/Core/crypto.py
Python
gpl-3.0
14,519
# I will rewrite this file soon. import os import re from re import findall from string import replace, lower import dbus import threading import cPickle def dbus_name_running(name): try: session = dbus.SessionBus().get_object('org.freedesktop.DBus', '/') names = session.ListNames() retur...
solos/Lyriczilla
lyriczilla/util.py
Python
gpl-2.0
3,773
# -*- coding: utf-8 -*- # Copyright (C) 2015-2019 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # # Authors: Haochen Wu (wuhaochen42@gmail.com) """Algorithms to calculate reciprocity in a directed graph."""...
sserrot/champion_relationships
venv/Lib/site-packages/networkx/algorithms/reciprocity.py
Python
mit
3,089
# Copyright (c) 2018 PaddlePaddle 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 app...
Canpio/Paddle
python/paddle/fluid/tests/unittests/decorators.py
Python
apache-2.0
1,266
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The freesurfer module provides basic functions for interfacing with freesurfer tools. Currently these tools are supported: * Dicom2Nifti: using mri_convert * Resample: using mri_convert Exam...
mick-d/nipype_source
nipype/interfaces/freesurfer/base.py
Python
bsd-3-clause
4,569
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterf...
valentin-krasontovitsch/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_igw.py
Python
gpl-3.0
9,196
from __future__ import division import math import os import platform import sys from collections import deque from contextlib import contextmanager from threading import Event, Thread from time import sleep import pyinfra IS_WINDOWS = platform.system() == 'Windows' WAIT_TIME = 1 / 5 WAIT_CHARS = deque(('-', '/', ...
Fizzadar/pyinfra
pyinfra/progress.py
Python
mit
4,111
######################################################################## # File name: test_structs.py # This file is part of: aioxmpp # # LICENSE # # This program 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 Fou...
horazont/aioxmpp
tests/test_structs.py
Python
lgpl-3.0
46,947
from django.contrib import admin from polls.models import Choice, Poll class ChoiceInline(admin.TabularInline): model = Choice extra = 3 class PollAdmin(admin.ModelAdmin): list_display = ('question', 'pub_date', 'was_published_recently') #fieldsets = [ # (None, {'fields': ['question'...
minaevmike/praktica
Diplom/mysite/polls/admin.py
Python
gpl-2.0
481
from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash # To ensure security of users' info from app import db, login_manager # Models for my database class Users(UserMixin, db.Model): """ User table for user signup info """ # Retains plural ...
Maxwell-Icharia/bc-14-pairprog
app/models.py
Python
gpl-3.0
1,572
class Role(RoleMixin, db.Model): __tablename__ = 'role' id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(80), unique=True) description = db.Column(db.String(255)) def __eq__(self, other): return (self.name == other or self.name == getattr(other, '...
Elpieich/teamwork
crm/models/role.py
Python
mit
638
## CSC320 Winter 2016 ## Assignment 2 ## (c) Kyros Kutulakos ## ## DISTRIBUTION OF THIS CODE ANY FORM (ELECTRONIC OR OTHERWISE, ## AS-IS, MODIFIED OR IN PART), WITHOUT PRIOR WRITTEN AUTHORIZATION ## BY THE INSTRUCTOR IS STRICTLY PROHIBITED. VIOLATION OF THIS ## POLICY WILL BE CONSIDERED AN ACT OF ACADEMIC DISHONESTY...
ericxyan/ImageInpainting
code/inpaintingui/viewer.py
Python
mit
11,637
import time def main(request, response): delay = float(request.GET.first("ms", 500)) time.sleep(delay / 1E3); return [("Content-type", "text/plain")], "TEST_DELAY"
xiaojunwu/crosswalk-test-suite
webapi/tct-xmlhttprequest-w3c-tests/xmlhttprequest-py/w3c/resources/delay.py
Python
bsd-3-clause
177
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
wfxiang08/Nuitka
nuitka/nodes/OutlineNodes.py
Python
apache-2.0
4,590
import cmath import numpy as np import numpy.testing as npt import pandas as pd import scipy.special from numpy.testing._private.utils import assert_equal from pymwm.cutoff import Cutoff def test_cutoffs(): co = Cutoff(2, 2) num_rr = len(co.r_ratios) assert co.num_n == 2 assert co.num_m == 2 ass...
mnishida/PyMWM
tests/test_cutoff.py
Python
mit
3,542
for _ in range(int(input())): print(2**32 - 1 - int(input()))
csixteen/HackerRank_Python
Algorithms/flipping_bits.py
Python
mit
66
# main.py # # Copyright 2011 Hugo Teso <hugo.teso@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 2 of the License, or # (at your ...
8l/bokken
ui/main.py
Python
gpl-2.0
14,679
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
HybridF5/hybrid-jacket
wormhole/i18n.py
Python
apache-2.0
2,126
""" Discussion API internal interface """ from collections import defaultdict from urllib import urlencode from urlparse import urlunparse from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.http import Http404 from rest_framework.exceptions import PermissionDen...
shubhdev/openedx
lms/djangoapps/discussion_api/api.py
Python
agpl-3.0
19,008
import json import docker import sys import subprocess import re def run(cmd, returncode=False, echo=True, **kargs): """ Executes a shell command and prints out STDOUT / STDERROR, exits on failure by default """ process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, ...
vormund/web-stack
scripts/dns.py
Python
mit
2,304
from setuptools import setup, find_packages requirements = ["pytz"] setup( name = "cubes-mixpanel", version = '0.1', install_requires = requirements, packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data = { }, classifiers = [ 'Development ...
DataBrewery/cubes-mixpanel
setup.py
Python
mit
1,039
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # (c) Con Radchenko mailto:lankier@gmail.com # # $Id: fb2desc.py,v 1.10 2008/09/15 04:18:45 con Exp con $ # import sys, os import locale import getopt import codecs import zipfile from cStringIO import StringIO import xml.sax import shutil import traceback ...
vasnake/fb2tools
fb2tools/fb2desc.py
Python
gpl-3.0
24,174
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
uclouvain/osis
ddd/logic/encodage_des_notes/soumission/domain/service/encoder_notes_en_lot.py
Python
agpl-3.0
6,960
wsgi_app = "weasyl.wsgi:make_wsgi_app()" proc_name = "weasyl" preload_app = False secure_scheme_headers = { 'X-FORWARDED-PROTO': 'https', } forwarded_allow_ips = '*'
Weasyl/weasyl
gunicorn.conf.py
Python
apache-2.0
173
from collections import OrderedDict from src.models import FlashscoreMatch from src.settings import match_cache, Colors @match_cache def is_available(match: FlashscoreMatch) -> bool: return ( match.ah_0_1_current_odds is not None and match.ah_0_2_current_odds is not None and match.home_dr...
vapkarian/soccer-analyzer
src/versions/f4.py
Python
mit
3,131
import os import multiprocessing as mp from PyQt4.QtCore import * from PyQt4.QtGui import * from logger import Logger class LogListener(QThread): def __init__(self, *log_paths, parent=None): QThread.__init__(self, parent) self.log_paths = [] for elem in log_paths: self.log_p...
mvwicky/ScotusScraper
log_listener.py
Python
mit
375
############################################################################### # lazyflow: data flow based lazy parallel computation framework # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/o...
stuarteberg/lazyflow
lazyflow/utility/chunkHelpers.py
Python
lgpl-3.0
2,235
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
alexgorban/models
official/r1/mnist/mnist.py
Python
apache-2.0
8,798
""" Dataset for images and related functionality. This module does not have dependencies inside pyl2extra package, so you can just copy-paste it inside your source tree. To use this dataset prepare a .csv file with targets (integers or real numbers) on first column and file paths on the second column: .. code:: ...
TNick/pyl2extra
pyl2extra/datasets/images.py
Python
bsd-3-clause
13,590
import argparse import os from joblib import Parallel, delayed import numpy as np import autosklearn import autosklearn.data import autosklearn.data.competition_data_manager from autosklearn.pipeline.classification import SimpleClassificationPipeline parser = argparse.ArgumentParser() parser.add_argument('input') pa...
automl/ChaLearn_Automatic_Machine_Learning_Challenge_2015
004_helena.py
Python
bsd-2-clause
22,816
from openid.consumer import consumer from openid.consumer.discover import DiscoveryFailure from openid.extensions import ax, pape, sreg from . import util PAPE_POLICIES = [ 'AUTH_PHISHING_RESISTANT', 'AUTH_MULTI_FACTOR', 'AUTH_MULTI_FACTOR_PHYSICAL', ] AX_REQUIRED_FIELDS = { 'firstname' : 'http:/...
benadida/helios-server
helios_auth/auth_systems/openid/view_helpers.py
Python
apache-2.0
5,049
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can redistribute it and/or mo...
gam-phon/taiga-back
taiga/users/models.py
Python
agpl-3.0
12,446
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
KaranToor/MA450
google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/name_generator.py
Python
apache-2.0
1,239
""" HasBreak detects if a loop has a direct break """ from pythran.passmanager import NodeAnalysis class HasBreak(NodeAnalysis): def __init__(self): self.result = False super(HasBreak, self).__init__() def visit_For(self, _): return def visit_Break(self, _): self.result...
hainm/pythran
pythran/analyses/has_break.py
Python
bsd-3-clause
328
# MIT License # # Copyright (c) 2017, Stefan Webb. All Rights Reserved. # # 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 us...
stefanwebb/tensorflow-models
tensorflow_models/trainers/emvb_final.py
Python
mit
7,499
from setuptools import setup, find_packages from setuptools.command.install import install def get_version(): version_fh = open("CHANGES", "r") first_line = version_fh.readline().strip() version_fh.close() version = first_line.split()[1] return version setup( name='pride', version=get_vers...
ihmpdcc/anadama-pride
setup.py
Python
mit
793
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-05 15:25 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('pictures', '0002_auto_20161005_1501'), ] operation...
photoboard/photoboard-django
pictures/migrations/0003_auto_20161005_1525.py
Python
mit
988
import requests, base64, hmac, hashlib from Exception import CasperException requests.packages.urllib3.disable_warnings() class CasperAgent(object): USER_AGENT = "Casper-API-Python/1.0.0" URL = "https://api.casper.io" def __init__(self, apiKey = None, apiSecret = None): self.apiKey = apiKey self.apiSecret = ap...
rxw/snapy
snapy/Agent.py
Python
mit
2,329
import array import numbers real_types = [numbers.Real] int_types = [numbers.Integral] iterable_types = [set, list, tuple, array.array] try: import numpy except ImportError: pass else: real_types.extend([numpy.float32, numpy.float64]) int_types.extend([numpy.int32, numpy.int64]) iterable_types.app...
DailyActie/Surrogate-Model
01-codes/OpenMDAO-Framework-dev/openmdao.util/src/openmdao/util/typegroups.py
Python
mit
558
#*************************************************************************** #* * #* Copyright (c) 2014 Sebastian Hoogen <github@sebastianhoogen.de> * #* * #* This p...
timthelion/FreeCAD_sf_master
src/Mod/Sandbox/exportDRAWEXE.py
Python
lgpl-2.1
34,509
from datetime import date, timedelta, datetime from django.db import models from django.db.models.signals import pre_save, post_save from django.contrib.auth.models import User from django.conf import settings def next_week(): return datetime.now() + timedelta(days=7) class JSLibraryGroup(models.Model): """ ...
chriswong/mooshell
models.py
Python
mit
7,839
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This file contains routines to verify the correctness of UCD strings. """ # STDLIB import re # LOCAL from astropy.utils import data __all__ = ['parse_ucd', 'check_ucd'] class UCDWords: """ Manages a list of acceptable UCD words. Work...
aleksandr-bakanov/astropy
astropy/io/votable/ucd.py
Python
bsd-3-clause
5,662
# !/usr/bin/env python # -*- coding: utf-8 -*- import vtk def main(): cellName = get_program_parameters() # Store the cell class names in a dictionary. cellMap = dict() cellMap[vtk.vtkCellTypes.GetClassNameFromTypeId(vtk.VTK_LINE)] = vtk.VTK_LINE cellMap[vtk.vtkCellTypes.GetClassNameFromTypeId(v...
lorensen/VTKExamples
src/Python/GeometricObjects/CellTypeSource.py
Python
apache-2.0
6,235
# coding=utf-8 # # Copyright © 2011-2015 Splunk, 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 ...
Teisei/TaxiRobot
lib/splunklib/searchcommands/reporting_command.py
Python
apache-2.0
9,668
# -*- coding: UTF-8 -*- __all__ = ['EMOJI_CARACTER','EMOJI_CARACTER_NEW'] EMOJI_CARACTER_NEW = {} EMOJI_CARACTERteste = { ':heavy_black_heart:':'<3', ':simple_smile:':':)' } EMOJI_CARACTER = { ':soccer_ball:':' ', ':smile:':':)', ':simple_smile:':':)', ':kissing_closed_eyes:':'', ':kis...
beatrizChagas/scrm-solutions
extracao/rsoservices/preprocessing_dict.py
Python
gpl-3.0
1,198
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
skosukhin/spack
var/spack/repos/builtin.mock/packages/a/package.py
Python
lgpl-2.1
2,262
# Time: O(n) # Space: O(n) # Given an unsorted array, find the maximum difference between # # the successive elements in its sorted form. # # Try to solve it in linear time/space. # # Return 0 if the array contains less than 2 elements. # # You may assume all elements in the array are non-negative integers # # ...
yiwen-luo/LeetCode
Python/maximum-gap.py
Python
mit
2,326
#!/usr/bin/env python3 # Copyright (c) 2013-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Generate seeds.txt from Pieter's DNS seeder # import re import sys import dns.resolver import collect...
wellenreiter01/Feathercoin
contrib/seeds/makeseeds.py
Python
mit
5,457
# Copyright (c) 2001-2015, 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...
CanalTP/navitia
source/jormungandr/tests/routing_tests_experimental.py
Python
agpl-3.0
55,937
from setuptools import setup setup(name='scitools', version='0.1', description='The funniest joke in the world', url='http://github.com/storborg/funniest', author='Flying Circus', author_email='flyingcircus@example.com', license='MIT', packages=['scitools'], zip_safe=Fal...
binghongcha08/pyQMD
setup.py
Python
gpl-3.0
324
from __future__ import unicode_literals __author__ = "Pymatgen Development Team" __email__ ="pymatgen@googlegroups.com" __maintainer__ = "Shyue Ping Ong" __maintainer_email__ ="shyuep@gmail.com" __date__ = "Nov 19 2015" __version__ = "3.2.7" # Useful aliases for commonly used objects and modules. # Allows from pymat...
migueldiascosta/pymatgen
pymatgen/__init__.py
Python
mit
650
from flask import Blueprint from werkzeug.exceptions import NotFound from skylines.api.schemas import ClubSchema from skylines.model import Club from skylines.api.views.json import jsonify clubs_blueprint = Blueprint('clubs', 'skylines') club_schema = ClubSchema() @clubs_blueprint.route('/clubs/<int:club_id>') def ...
kerel-fs/skylines
skylines/api/views/clubs.py
Python
agpl-3.0
479
import pytest class TestStrace: @pytest.mark.complete("strace -", require_cmd=True) def test_1(self, completion): assert completion
scop/bash-completion
test/t/test_strace.py
Python
gpl-2.0
150
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dannysite_web.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
manyunkai/dannysite4
src/manage.py
Python
apache-2.0
256
from plex.interfaces.core.base import Interface class PluginInterface(Interface): path = ':/plugins' def reload_services(self, plugin_id): response = self.http.get(plugin_id, 'services/reload') return response.status_code == 200 def restart(self, plugin_id): response = self.http....
fuzeman/plex.py
plex/interfaces/plugin/__init__.py
Python
mit
389
# -*- coding: utf-8 -*- # @author: vuolter from __future__ import absolute_import, unicode_literals import os import re from future import standard_library from pyload.utils import convert, purge, web from pyload.utils.convert import to_str from pyload.utils.layer.legacy import hashlib from pyload.utils.time import...
pyblub/pyload
pyload/utils/parse.py
Python
agpl-3.0
4,211
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.contrib.auth.models import AbstractUser from django.db import models # from django.utils.translation import ugettext_lazy as _ class User(AbstractUser): def __unicode__(self): return self.username twitter_fo...
henryfjordan/django_beginnings
django_beginnings/users/models.py
Python
bsd-3-clause
526
# -*- coding: utf-8 -*- import xbmc import guitables from base import WindowReaderBase from lib import util class PVRWindowReaderBase(WindowReaderBase): def controlIsOnView(self,controlID): return not xbmc.getCondVisibility('ControlGroup(9000).HasFocus(0)') def init(self): self.mode = False ...
ruuk/service.xbmc.tts
lib/windows/pvr.py
Python
gpl-2.0
8,135
from django.utils.functional import wraps from rest_framework import exceptions from ESSArch_Core.configuration.models import Feature def feature_enabled_or_404(name): def decorator(view_func): @wraps(view_func) def _wrapped_view(request, *args, **kwargs): try: Feature...
ESSolutions/ESSArch_Core
ESSArch_Core/configuration/decorators.py
Python
gpl-3.0
586
""" Support for Homekit number ranges. These are mostly used where a HomeKit accessory exposes additional non-standard characteristics that don't map to a Home Assistant feature. """ from __future__ import annotations from aiohomekit.model.characteristics import Characteristic, CharacteristicsTypes from homeassistan...
mezz64/home-assistant
homeassistant/components/homekit_controller/number.py
Python
apache-2.0
3,940
from .lims_calibratorsAndMixes_postgresql_models import * from .lims_calibratorsAndMixes_query import lims_calibratorsAndMixes_query from SBaaS_base.sbaas_template_io import sbaas_template_io # Resources from io_utilities.base_importData import base_importData from io_utilities.base_exportData import base_exportData ...
dmccloskey/SBaaS_LIMS
SBaaS_LIMS/lims_calibratorsAndMixes_io.py
Python
mit
1,217
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # Copyright (c) 2015 Asumi Kamikaze Inc. # Licensed under the MIT License. # Author: Alejandro M. Bernardis # Email: alejandro (dot) bernardis (at) asumikamikaze (dot) com # Created: 08/Jun/2015 12:42
alejandrobernardis/tornado-heroku
settings_example.py
Python
mit
251
""" Created on 27 May 2019 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) South Coast Science PID Digital Single Interface (DSI) Type 1 Compatible with: https://github.com/south-coast-science/scs_dsi_t1_f1 """ import time from scs_core.data.datum import Decode from scs_dfe.gas.isi.dsi import DSI from...
south-coast-science/scs_dfe_eng
src/scs_dfe/gas/isi/pid_dsi_t1.py
Python
mit
3,404
# gimbal_macro.py # the macro to generate a gimbal, a mechanism with the roll-pitch angles as degrees of freedom # created by charlyoleg on 2013/12/11 # # (C) Copyright 2013 charlyoleg # # This file is part of the Cnc25D Python package. # # Cnc25D is free software: you can redistribute it and/or modify # it under the ...
charlyoleg/Cnc25D
cnc25d/tests/gimbal_macro.py
Python
gpl-3.0
15,143
""" WSGI config for demo project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` set...
Alem/django-jfu
demo/demo/wsgi.py
Python
bsd-3-clause
1,208
import logging logging.basicConfig(level=logging.INFO) # Create objects to manipulate - they hold your data # from ImageD11 import peakmerge, indexing, transformer mypeakmerger = peakmerge.peakmerger() mytransformer = transformer.transformer() myindexer = indexing.indexer() # # Your work starts here: # mypeakmerge...
jonwright/ImageD11
test/demo/test.py
Python
gpl-2.0
1,286
#!/usr/bin/python import socket import platform import time import sys import smtplib import os from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email import encoders class Mail: def __init__(self,user_defined=None): self.user_de...
tuxfux-hlp/Python-examples
logging/sending_mail.py
Python
gpl-2.0
4,045
ann = MLP(2, 10, 1) %timeit -n 1 -r 1 ann.train(zip(X,y), iterations=2) plot_decision_boundary(ann) plt.title("Our next model with 10 hidden units")
leriomaggio/deep-learning-keras-tensorflow
solutions/sol_111.py
Python
mit
149
import numpy as np from random import shuffle from past.builtins import xrange def svm_loss_naive(W, X, y, reg): """ Structured SVM loss function, naive implementation (with loops). Inputs have dimension D, there are C classes, and we operate on minibatches of N examples. Inputs: ...
UltronAI/Deep-Learning
CS231n/assignment1/cs231n/classifiers/linear_svm.py
Python
mit
5,478
from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_settings from django.core import exceptions from iprestrict import models from iprestrict import restrictor from iprestrict.middleware import IPRestrictMiddleware LOCAL_IP = '192.168.1.1' PROXY = '1....
whyflyru/django-iprestrict
tests/test_middleware.py
Python
bsd-3-clause
5,362
""" .. module:: bottle_utils.http :synopsis: HTTP decorators .. moduleauthor:: Outernet Inc <hello@outernet.is> """ from __future__ import unicode_literals import os import time import functools from bottle import (HTTPResponse, HTTPError, parse_date, parse_range_header, request, response) M...
Outernet-Project/bottle-utils
bottle_utils/http.py
Python
bsd-2-clause
6,569
# -*- coding: utf-8 -*- import os import KBEngine from KBEDebug import * """ loginapp进程主要处理KBEngine服务端登陆、创建账号等工作。 目前脚本支持几种功能: 1: 注册账号检查 2:登陆检查 3:自定义socket回调,参考interface中Poller实现 """ def onLoginAppReady(): """ KBEngine method. loginapp已经准备好了 """ INFO_MSG('onLoginAppReady: bootstrapGroupIndex=%...
Orav/kbengine
assets/scripts/login/kbemain.py
Python
lgpl-3.0
2,617
# encoding: utf-8 # module unicodedata # from (built-in) # by generator 1.135 """ This module provides access to the Unicode Character Database which defines character properties for all Unicode characters. The data in this database is based on the UnicodeData.txt file version 5.2.0 which is publically available from f...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/unicodedata.py
Python
gpl-2.0
8,480
# Copyright (C) 2011, CloudCaptive # # 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 i...
Yonnick/userinfuser
serverside/analytics.py
Python
gpl-3.0
18,276
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
keras-team/keras
keras/benchmarks/benchmark_util_test.py
Python
apache-2.0
1,610
# Copyright 2019 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
GoogleCloudPlatform/keras-idiomatic-programmer
zoo/senet/se_resnext.py
Python
apache-2.0
8,772
""" Test module for rendering funcweb (We can remove this module once other modules are instrumented) """ import func_module class EchoTest(func_module.FuncModule): version = "0.0.1" api_version = "0.0.1" description = "Module that all of its methods returns back the same thing it recieves!" def run...
pombredanne/func
func/minion/modules/echo.py
Python
gpl-2.0
3,646
# # # This module provide a loop delayer modeled as a FIFO list # import numpy as np class LoopDelayer(object): def __init__(self, delay, step_time, initial_value = np.array([0.0, 0.0])): ''' initialize the loop delayer. delay: time that is needed for the loop to run s...
Bellaz/ModuleSimulator
python/loop_delay.py
Python
gpl-3.0
809
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Laurawly/tvm-1
tests/python/unittest/test_tir_transform_lower_init_block.py
Python
apache-2.0
3,928
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
huggingface/pytorch-transformers
src/transformers/models/transfo_xl/__init__.py
Python
apache-2.0
3,221
# Vortex panel method module import numpy from matplotlib import pyplot # velocity component functions def get_u( x, y, S, gamma ): return gamma/(2*numpy.pi)*(numpy.arctan((x-S)/y)-numpy.arctan((x+S)/y)) def get_v( x, y, S, gamma ): return gamma/(4*numpy.pi)*(numpy.log(((x+S)**2+y**2)/((x-S)**2+y**2))) # vort...
ultiyuan/test0
lessons/VortexPanel.py
Python
gpl-2.0
5,764
from lxml import etree from lxml.html import fromstring, tostring import cookielib import mechanize class XRoxy(object): def __init__(self): self._br = mechanize.Browser() # Cookie Jar cj = cookielib.LWPCookieJar() self._br.set_cookiejar(cj) # Browser...
LeoCBS/xroxy-rest
xroxy.py
Python
mit
1,411
from nltk import word_tokenize from marmot.features.feature_extractor import FeatureExtractor from marmot.exceptions.no_data_error import NoDataError class PseudoReferenceFeatureExtractor(FeatureExtractor): ''' A feature that extracts the pseudo-reference feature for pseudo-references provided in a file...
qe-team/marmot
marmot/features/pseudo_reference_feature_extractor.py
Python
isc
953