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 -*- # # 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 #...
danielvdende/incubator-airflow
airflow/contrib/hooks/bigquery_hook.py
Python
apache-2.0
66,015
# # This source file is part of the EdgeDB open source project. # # Copyright 2010-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
edgedb/edgedb
edb/pgsql/astmatch.py
Python
apache-2.0
1,119
#!/usr/bin/python import os import sys from time import time, sleep import shlex import threading import subprocess import multiprocessing import tempfile import fnmatch sys.path.append('automation/trex_control_plane/stl') from trex_stl_lib.api import * def run_server(command): return subprocess.Popen(shlex.spli...
dimagol/trex-core
scripts/simple_start_server.py
Python
apache-2.0
4,454
from django.conf.urls.defaults import patterns, include, url from mothra.settings import LOGIN_URL from mothra.settings import DEBUG, STATIC_DOC_ROOT # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'm...
janezkranjc/clowdflows
mothra/urls.py
Python
gpl-3.0
1,968
# Copyright (C) 2011 Google Inc. 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 list of conditions and the ...
Debian/openjfx
modules/web/src/main/native/Tools/Scripts/webkitpy/common/watchlist/watchlistrule_unittest.py
Python
gpl-2.0
2,944
# Copyright 2015 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...
rabipanda/tensorflow
tensorflow/contrib/rnn/python/ops/rnn_cell.py
Python
apache-2.0
115,152
# This file has to be run in pure Python mode! # Imports from the CO𝘕CEPT code from commons import * plt = get_matplotlib().pyplot # Absolute path and name of this test this_dir = os.path.dirname(os.path.realpath(__file__)) this_test = os.path.basename(os.path.dirname(this_dir)) # Begin analysis masterprint(f'Anal...
jmd-dk/concept
test/render/analyze.py
Python
gpl-3.0
2,006
# u(k) = (900-3k) r^(k-1) # u'(k) = -3 r^(k-1) + (900-3k) r^(k-1) ln r # u(n,r) = 900(1-r**n)/(1-r)-((1-r**n)/(1-r)-n*r**n)*3/(1-r) # u(n,r) = 900(1-r**n)/(1-r)-((1-r**n)/(1-r)-n*r**n)*3/(1-r) def u(n,r): return 900*(1-r**n)/(1-r)-((1-r**n)/(1-r)-n*r**n)*3/(1-r) # integer division result too large for a float #...
CroMarmot/MyOICode
ProjectEuler/p235.py
Python
gpl-3.0
671
# Bzrflag # Copyright 2008-2011 Brigham Young University # # This file is part of Bzrflag. # # Bzrflag 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 l...
sm-github/bzrflag
bzrflag/config.py
Python
gpl-3.0
9,861
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import os import sys class CreateSymlinkResolver(object): def __init__(self,resolver,dependency,symlinks_path,ctx): self.resolver=resolver self.dependency=dependency self.symlinks_path=symlink...
looopTools/sw9-source
.waf-1.9.8-6657823688b736c1d1a4e2c4e8e198b4/waflib/extras/wurf/create_symlink_resolver.py
Python
mit
1,573
import requests from bs4 import BeautifulSoup # # # get seed article # # dave_2003_doi = "10.1.1.13.2424" dave_2003 = "http://citeseerx.ist.psu.edu/viewdoc/summary?doi=" + dave_2003_doi print(dave_2003) r = requests.get(dave_2003) print(r) data = r.text soup = BeautifulSoup(data) print(soup) # # # get seed artic...
chendaniely/attitude-citation-network
analysis/chend/code/PY/01-get_csci_pages.py
Python
mit
794
########################################################################### # # Copyright 2020 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/l...
google/starthinker
starthinker/task/dcm_log/run.py
Python
apache-2.0
3,909
# -*- coding: utf8 -*- """ Demonstration of USM QE Tests Run Logging ========================================= This is just an example of usmqe flavored pytest test cases so that one can try how the reporting and logging works without setting up the whole test enviroment required for actuall tests. """ import pytest...
fbalak/usmqe-tests
usmqe_tests/demo/test_logging.py
Python
gpl-3.0
1,671
from django.conf.urls.defaults import * from .views import handle_token urlpatterns = patterns('', url(r'^token/(.*)/$', handle_token, name='token_handle'), )
redvasily/django-tokens
tokens/urls.py
Python
bsd-3-clause
165
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('finaid', '0012_updates_to_finaidreviewdata'), ] operations = [ migrations.AddField( model_name='financialaidappl...
PyCon/pycon
pycon/finaid/migrations/0013_financialaidapplication_application_type.py
Python
bsd-3-clause
778
import smtplib from osmhm import config def basic_send_mail(to, subject, msg): import os program = '/usr/sbin/sendmail' email = os.popen("%s -t" % program, "w") email.write("From: %s\n" % config.email_user) email.write("Reply-to: %s\n" % config.email_user) email.write("To: %s\n" % to) email...
ethan-nelson/osm_hall_monitor
osmhm/send_notification.py
Python
mit
3,262
""" Testing for the tree module (sklearn.tree). """ import pickle from functools import partial from itertools import product import platform import numpy as np from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.random_projection import sparse_rand...
sonnyhu/scikit-learn
sklearn/tree/tests/test_tree.py
Python
bsd-3-clause
55,494
# Copyright 2016 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...
xzturn/tensorflow
tensorflow/python/training/checkpoint_utils.py
Python
apache-2.0
19,433
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys, re, csv def copy_to_imagedrop_upload(src_filepath, destdir=None): import pycurl, os, shutil, re regex_colorstyle = re.compile(r'^.*?/[0-9]{9}[_altm0-6]{,6}?\.[jpngJPNG]{3}$') if not regex_colorstyle.findall(src_filepath): print src_file...
relic7/prodimages
python/jbmodules/image_processing/magick_processes/magicColorspaceModAspctLoad_ArgSafe.py
Python
mit
20,749
from typing import Iterable, List from gi.repository import Gtk from gaphor.core.eventmanager import EventManager from gaphor.transaction import Transaction class TxData: def __init__(self, event_manager): self.event_manager = event_manager self.txs: List[Transaction] = [] def begin(self): ...
amolenaar/gaphor
gaphor/diagram/diagramtools/txtool.py
Python
lgpl-2.1
891
"""Shared OS X support functions.""" import os import re import sys __all__ = [ 'compiler_fixup', 'customize_config_vars', 'customize_compiler', 'get_platform_osx', ] # configuration variables that may contain universal build flags, # like "-arch" or "-isdkroot", that may need customiza...
prefetchnta/questlab
bin/x64bin/python/37/Lib/_osx_support.py
Python
lgpl-2.1
20,113
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
adviti/melange
thirdparty/google_appengine/google/appengine/cron/GrocLexer.py
Python
apache-2.0
33,181
#!/usr/bin/env python from __future__ import print_function import trollius as asyncio from trollius import From import trollius_redis import logging import six if __name__ == '__main__': loop = asyncio.get_event_loop() # Enable logging logging.getLogger().addHandler(logging.StreamHandler()) logging.g...
benjolitz/trollius-redis
examples/pubsub/sender.py
Python
bsd-2-clause
1,152
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' ''' ebook-meta ''' import sys, os from calibre.utils.config import StringConfig from calibre.customize.ui import metadata_readers, metadata_writers, force_ident...
hazrpg/calibre
src/calibre/ebooks/metadata/cli.py
Python
gpl-3.0
9,166
import pygame, sys, os, random, math, time, copy, json from pygame import Rect, draw, QUIT, MOUSEMOTION, MOUSEBUTTONDOWN from chordConversions import * from display import resize_img class Hero: def __init__(self, screen, maxAmo, foodAddTo, powersToGet, speedFactor, moneyFactor, image, aimI...
zenev/charityGame
feedingGame/gameObjects.py
Python
gpl-2.0
29,777
# coding: utf-8 from setuptools import setup setup( name='pushover', packages=['pushover'], description='', long_description='', entry_points={ 'console_scripts': ['pushover = pushover.cli:main'], }, install_requires=['pyyaml', 'requests'], )
bope/pushover
setup.py
Python
bsd-2-clause
281
# Pretty-printer commands. # Copyright (C) 2010, 2011 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any l...
ptriller/dcpu-binutils
gdb/python/lib/gdb/command/pretty_printers.py
Python
gpl-2.0
14,698
from pyramid.response import Response from pyramid.view import ( view_config, view_defaults, ) import colander from sqlalchemy.exc import DBAPIError from sqlalchemy.orm import exc from pyramid.httpexceptions import (HTTPFound, HTTPNotFound,) import deform from deform import (widget, Validati...
jaduff/goodstanding
goodstanding/classviews.py
Python
bsd-3-clause
6,248
import datetime import itertools import logging import re import sys import time import threading from sgevents.loop import LoopController from .logs import log_globals from .utils import parse_interval, get_shotgun log = logging.getLogger(__name__) class Scanner(object): def __init__(self, schema, last_time...
westernx/sgcache
sgcache/scanner.py
Python
bsd-3-clause
3,935
class Node: all = [] def __init__(self, name, stepSize): Node.all.append(self) self.name = name self.stepSize = stepSize self.connections = [] class Connection: all = [] def __init__(self, pre, post, latency, maxBuffer = 1000): Connection.all.append(self) ...
favreau/music
doc/scheduling-algorithm.py
Python
gpl-3.0
4,266
# coding: utf-8 from .event import Event __all__ = ['Event']
infotim/python-libsse
src/libsse/__init__.py
Python
mit
63
import sys from datetime import datetime from threading import local from django.conf import settings from django.template import Node from django.utils import simplejson from django.utils.encoding import force_unicode, smart_str from django.utils.hashcompat import sha_constructor from debug_toolbar.utils import ms_...
viswimmer1/PythonGenerator
data/python_files/30552425/db.py
Python
gpl-2.0
4,966
import os from subprocess import call import tempfile import click from kazoo.client import KazooClient import six zk = None def init(hosts): global zk zk = KazooClient(hosts=hosts) zk.start(timeout=5) def main(): global zk cli(auto_envvar_prefix='ZEEK') if zk is not None and zk.connected: ...
krockode/zeek
zeek.py
Python
apache-2.0
3,951
import ddt from django.core.management import call_command from django.core.management.base import CommandError from mock import patch from oscar.core.loading import get_model from ecommerce.extensions.test.factories import create_order from ecommerce.tests.factories import PartnerFactory from ecommerce.tests.testca...
edx/ecommerce
ecommerce/extensions/order/management/commands/tests/test_update_order_lines_partner.py
Python
agpl-3.0
2,921
import datetime print(datetime.datetime.today().ctime())
codermoji-contrib/python
start/First steps in the library/datetime/showdate3.py
Python
mit
57
class CreationDestruction (object) : def __init__ (self) : print("constructeur") def __new__ (self) : print("__new__") return object.__new__ (self) def __del__ (self) : print("__del__") print("a") m = CreationDestruction () print("b") m2 = m print("c")...
sdpython/teachpyx
_todo/programme/new_delete.py
Python
mit
356
''' Update the CO21 and HI intensities in the dlfit.fits file, which contains fits to the Draine models for M33. The old version used an older and incomplete IRAM CO(2-1) map, and the HI are from the 14B-088 integrated intensity. ''' import numpy as np from astropy.io import fits from astropy.table import Table, Colu...
e-koch/VLA_Lband
ancillary_data/IRAM30m_CO21/update_dlfit.py
Python
mit
3,114
#!/usr/bin/env python3 import argparse import sys from ros_buildfarm.argument import add_argument_package_name from ros_buildfarm.argument import add_argument_rosdistro_name from ros_buildfarm.argument import add_argument_skip_download_sourcedeb from ros_buildfarm.argument import add_argument_sourcedeb_dir from ros_b...
mani-monaj/ros_buildfarm
scripts/release/get_sourcedeb.py
Python
apache-2.0
997
from kivy.uix.boxlayout import BoxLayout from kivy.properties import StringProperty, BooleanProperty class NamedCheckBox(BoxLayout): name = StringProperty("") is_checked = BooleanProperty(False) font_group_id = StringProperty("default_checkbox") def set_checked(self, is_checked): self.ids.chec...
Kovak/KivyNBT
uix/namedcheckbox.py
Python
mit
344
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'open_newick.ui' # # Created: Tue Jan 10 15:56:56 2012 # by: PyQt4 UI code generator 4.7.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_OpenNewick(object): def setupUi(self, Open...
khughitt/ete
ete_dev/treeview/_open_newick.py
Python
gpl-3.0
1,001
""" * The MIT License (MIT) * * Copyright (c) 2017 Chris Smolen * * 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...
smolz/Misc-Python-Projects
dash-mqtt/jsonconfig.py
Python
mit
2,576
# -*- Mode: Python; test-case-name: flumotion.test.test_component -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General ...
offlinehacker/flumotion
flumotion/component/component.py
Python
gpl-2.0
31,473
import unittest from test import test_support from contextlib import closing import gc import pickle import select import signal import subprocess import traceback import sys, os, time, errno if sys.platform in ('os2', 'riscos'): raise unittest.SkipTest("Can't test signal on %s" % sys.platform) cl...
j5shi/Thruster
pylibs/test/test_signal.py
Python
gpl-2.0
19,406
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'batch_iv_analysis/batch-iv-analysis.ui' # # Created by: PyQt5 UI code generator 5.8 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_batch_iv_analysis(object): def setupUi(sel...
greysAcademicCode/batch-iv-analysis
batch_iv_analysis/batch_iv_analysis_UI.py
Python
mit
22,939
from vrtManager import util from vrtManager.IPy import IP from vrtManager.connection import wvmConnect def network_size(net, dhcp=None): """ Func return gateway, mask and dhcp pool. """ mask = IP(net).strNetmask() addr = IP(net) gateway = addr[1].strNormal() dhcp_pool = [addr[2].strNormal(...
harry-ops/opencloud
webvirtcloud/vrtManager/network.py
Python
gpl-2.0
5,632
# -*- coding: utf-8 -*- """ Point.py - Extension of QPointF which adds a few missing methods. Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. """ from .Qt import QtCore import numpy as np def clip(x, mn, mx): if x > mx: return mx if x < mn: ...
ibressler/pyqtgraph
pyqtgraph/Point.py
Python
mit
4,271
import base64 import collections import json from io import BytesIO from unittest import mock import jira from django.conf import settings from django.core import mail from django.test import override_settings from django.urls import reverse from django.utils import timezone from rest_framework.test import APITransact...
opennode/nodeconductor-assembly-waldur
src/waldur_mastermind/support/tests/test_jira_web_hooks.py
Python
mit
13,553
#!/usr/bin/env python import server import record_data from optparse import OptionParser if __name__ == "__main__": usage = "you can find options info in server.py and record_data.py or by calling this script with -h options" parser = OptionParser(usage=usage) parser = server.add_parser_options(parser) ...
griffincalme/rpi_climate_server
run_app.py
Python
gpl-2.0
636
import os # Django settings for docusite projecit. DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', # Or path to database file if using s...
elbasti/prettymarkdown
docusite/settings.py
Python
mit
5,960
#!/usr/bin/env python # coding: utf-8 # # rede_gephi_com_ipca_csv # In[6]: ano_eleicao = '2014' rede =f'rede{ano_eleicao}' csv_dir = f'/home/neilor/{rede}' # In[7]: dbschema = f'rede{ano_eleicao}' table_edges = f"{dbschema}.gephi_edges_com_ipca_2018" table_nodes = f"{dbschema}.gephi_nodes_com_ipca_2018" table...
elivre/arfe
e2014/SCRIPTS/055-rede2014_rede_gephi_com_ipca_csv.py
Python
mit
3,896
# -*- coding: utf-8 -*- # # Tunir documentation build configuration file, created by # sphinx-quickstart on Thu Jan 15 22:45:09 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. # # All...
dustymabe/tunir
docs/conf.py
Python
gpl-2.0
8,154
import numpy as np def detrend_normalize_mat(voxels): tcn = np.zeros((voxels.shape[1], voxels.shape[0])) for i in range(voxels.shape[0]): tcn[:, i] = voxels[i] / np.std(voxels[i]) return tcn def detrend_normalize_nii(voxels): tcn = np.zeros((voxels.shape[1], voxels.shape[0])) for i in ra...
mfalkiewicz/pyTotalActivation
TotalActivation/preprocess/detrend.py
Python
mit
429
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-03-30 15:38 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('exams', '0083_add_default_theme'), ] operations =...
Zahajamaan/Fudulbank
exams/migrations/0084_shared_sessions.py
Python
agpl-3.0
792
#!/usr/bin/python3 # -*- coding: utf-8 -*- """This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ import relay import Cdf import myplot def main(): results = relay.ReadResu...
qrsforever/workspace
python/learn/thinkstats/relay_cdf.py
Python
mit
675
from Stack import Stack def infixToPostfix(infixexpr): prec = {} prec["^"] = 4 prec["*"] = 3 prec["/"] = 3 prec["+"] = 2 prec["-"] = 2 prec["("] = 1 opStack = Stack() postfixList = [] tokenList = infixexpr.split() for token in tokenList: if token in "ABCDEFGHIJKLMNO...
sookoor/PythonInterviewPrep
infixToPostfix.py
Python
mit
1,217
# # Copyright (c) 2013-2014, Scott J Maddox # # This file is part of openbandparams. # # openbandparams 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 # ...
scott-maddox/openbandparams
src/openbandparams/examples/Plot_Bandgap_vs_Lattice_Constant.py
Python
agpl-3.0
3,636
__author__ = 'Kamal.S' import datetime from haystack import indexes from .models import Sample class SampleIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.EdgeNgramField(document=True, use_template=True) company = indexes.EdgeNgramField(model_attr='company') name=indexes.EdgeNgramField(mod...
srkama/haysolr
dataview/testapi/search_indexes.py
Python
apache-2.0
527
## Copyright 2002-2003 Andrew Loewenstern, All Rights Reserved # see LICENSE.txt for license information import unittest from airhook import * from random import uniform as rand from cStringIO import StringIO if __name__ =="__main__": tests = unittest.defaultTestLoader.loadTestsFromNames(['test_airhook']) re...
csm/khashmir
test_airhook.py
Python
mit
23,088
# -*- coding: utf-8 -*- #Copyright (C) 2011 Seán Hayes #Django imports from django.contrib.auth.models import User from django.db import models from django.db.models.signals import post_save # Create your models here. class BattleRecord(models.Model): attacker = models.ForeignKey(User, related_name="battlerecord_at...
SeanHayes/swarm-war
swarm_war/battles/models.py
Python
agpl-3.0
2,273
from context import VerdictHiveContext __all__ = [ "VerdictHiveContext" ]
verdictdb/verdict
python/pyverdict/__init__.py
Python
apache-2.0
80
import os import urllib import logging import csv import StringIO from google.appengine.api import users from google.appengine.ext import ndb ##dummy entity to use as partent class Course(ndb.Model): """A main model for representing an individual coursebook entry.""" author = ndb.UserProperty(indexed=True...
pepetox/gae-angular-materialize
modelCourse.py
Python
mit
5,570
__author__ = 'tivvit' from protorpc import messages class Quest_m(messages.Message): name = messages.StringField(1) faction = messages.StringField(2) points = messages.IntegerField(3) num = messages.IntegerField(4) id = messages.IntegerField(5) factionId = messages.IntegerField(6) # inser...
gugcz/devfest-rpg
backend/cdh_m/quest_m.py
Python
mit
457
# -*- coding: utf-8 -*- # # API configuration ##################### DEBUG = False # Top-level URL for deployment. Numerous other URLs depend on this. CYCLADES_BASE_URL = "https://compute.example.synnefo.org/compute/" # The API will return HTTP Bad Request if the ?changes-since # parameter refers to a point in time ...
grnet/synnefo
snf-cyclades-app/synnefo/app_settings/default/api.py
Python
gpl-3.0
8,466
from django.contrib import admin from bootcamp.auth.models import Profile admin.site.register(Profile)
maxpinto/Ptz
bootcamp/auth/admin.py
Python
mit
104
import sys, os def stop(arv): pwd = os.getcwd() # if argv given, folders = [argv] # else, folders = pwd ### for each folder in folders ##### check pwd/folder/temp/pids for existing pid files ####### kill -15 & rm files def main(): print "Please don't try to run this script separately." if __nam...
modcracker/Tork
tork/core/manage/stop.py
Python
mit
347
import os.path from django.contrib.auth import authenticate from django.shortcuts import render from qmpy.models import Entry, Task, Calculation, Formation, MetaData from .tools import get_globals def home_page(request): data = get_globals() data.update( { "done": "{:,}".format(Formation....
wolverton-research-group/qmpy
qmpy/web/views/home.py
Python
mit
1,123
#!/usr/bin/env python # -*- coding: utf-8 -*- # Minio Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2015, 2016, 2017, 2018 Minio, 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 Lice...
NitishT/minio-py
tests/functional/tests.py
Python
apache-2.0
79,042
import string # prace se soubory #fr = open("./file.txt", "r") # read fw = open("./passwd.bak", "w") # write #fa = open("./file.txt", "a") # append fetc = open("./passwd", "r") # read, readline, readlines, xreadlines, write, writelines(pole) for line in fetc.xreadlines(): # print line records = string.strip(line)....
maiklos/python-experiments
misctasks.py
Python
apache-2.0
516
# Franca parser package # Author: Ingmar Lehmann (lehmann.ingmar@gmail.com) __version__ = '0.1' __all__ = ['franca_parser','franca_ast','franca_lexer']
ingmarlehmann/franca-tools
franca_parser/franca_parser/__init__.py
Python
mpl-2.0
156
""" Each store has slightly different semantics wrt draft v published. XML doesn't officially recognize draft but does hold it in a subdir. Old mongo has a virtual but not physical draft for every unit in published state. Split mongo has a physical for every unit in every state. Given that, here's a table of semantics...
eduNEXT/edunext-platform
common/lib/xmodule/xmodule/modulestore/xml_importer.py
Python
agpl-3.0
56,979
#!/usr/bin/env python # # Author: Alta Fang (altafang @caltech and alta @princeton) # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 1997-2015 California Institute of Technology. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/project...
jcfr/mystic
examples/test_rosenbrock3.py
Python
bsd-3-clause
2,181
""" pypebbleapi ------------ Pebble-api for python. Library to ease the access to the Pebble Timeline and the creation of Pins. """ from setuptools import setup, find_packages setup( name='pypebbleapi', version='1.0.0', url='https://github.com/youtux/pypebbleapi', license='MIT', author='Alessio B...
youtux/pypebbleapi
setup.py
Python
mit
1,105
# ----------------------------------------------------------- # demonstrates the usage of continue to skip the execution of # statements in a loop #o # (C) 2014 Frank Hofmann, Berlin, Germany # Released under GNU Public License (GPL) # email frank.hofmann@efho.de # -----------------------------------------------------...
plasmashadow/training-python
loops/while-continue.py
Python
gpl-2.0
810
#!/usr/bin/python2.4 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # # Copyright (C) 1999-2007 Keith Dart <keith@kdart.com> # # 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 Foundati...
xiangke/pycopia
audio/etc/voicemail.py
Python
lgpl-2.1
1,389
from __future__ import absolute_import import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qtqml(): """Test the qtpy.QtQml namespace""" from qtpy import QtQml assert QtQml.QJSEngine is not None assert QtQml.QJSValu...
sserrot/champion_relationships
venv/Lib/site-packages/qtpy/tests/test_qtqml.py
Python
mit
1,413
import sys import pyaudio import wave #reso_destroyed = "../audio/resonator_destroyed1.wav" #reso_deployed = "../audio/resonator_deployed1.wav" test_file = "../audio/violin-test-PCM16-48.wav" #test_file = "../audio/violin-test-PCM16.wav" CHUNK = 1024 * 16 print("wave open") wf = wave.open(test_file, 'rb') print (" ...
bbulkow/MagnusFlora
samples/sound.pyaudio.py
Python
mit
1,357
############################################################################## # Copyright (c) 2013-2018, 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...
EmreAtes/spack
var/spack/repos/builtin/packages/intel/package.py
Python
lgpl-2.1
5,555
import copy from django.conf.urls import * from django.conf import settings from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe from haystack.views import SearchView from haystack.forms import SearchForm as DefaultSearchForm from pages.models import Page, slugify from map...
evangeline97/localwiki-backend-server
localwiki/search/urls.py
Python
gpl-2.0
5,842
# Written by Bram Cohen # see LICENSE.txt for license information from cStringIO import StringIO from binascii import b2a_hex from socket import error as socketerror from urllib import quote from traceback import print_exc from BitTornado.BTcrypto import Crypto try: True except: True = 1 False = 0 boo...
Cclleemm/FriendlyTorrent
src/tornado/BitTornado/BT1/Encrypter.py
Python
apache-2.0
22,211
# -*- coding: utf-8 -*- # # # File to preform some standard tasks on a neuroConstruct project # # Author: Padraig Gleeson # # This file has been developed as part of the neuroConstruct project # This work has been funded by the Medical Research Council and the # Wellcome Trust # # import sys im...
rgerkin/neuroConstruct
pythonNeuroML/nCUtils/ncutils.py
Python
gpl-2.0
66,510
#!/usr/bin/python # # Copyright 2014 Huawei Technologies Co. Ltd # # 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...
baigk/compass-core
ez_setup.py
Python
apache-2.0
9,482
# Copyright 2011 The greplin-exception-catcher Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Cue/greplin-exception-catcher
python/logging/greplin/gec/logHandler.py
Python
apache-2.0
5,815
from ... import BaseProvider class Provider(BaseProvider): """ Provider for Philippine IDs that are related to social security There is no unified social security program in the Philippines. Instead, the Philippines has a messy collection of social programs and IDs that, when put together, serves as ...
danhuss/faker
faker/providers/ssn/en_PH/__init__.py
Python
mit
2,596
import sys import time import logging from decimal import * logger = logging.getLogger("faircoins") from django.conf import settings from django.db.models import Q import faircoin_nrp.electrum_fair_nrp as efn from django_rea.valueaccounting.models import EconomicAgent, EconomicEvent, EconomicResource from django_re...
django-rea/nrp
django_rea/valueaccounting/process_faircoin_requests.py
Python
agpl-3.0
6,876
from django.conf import settings from django.utils.translation import ugettext_lazy as _ from pressgang.core.exceptions import PressGangConfigurationError # The prefix that a user must use in their settings.py file before any variables # that directly control a PressGang setting _SETTINGS_PREFIX = "PRESSGANG_" def ...
oberlin/pressgang
pressgang/settings.py
Python
bsd-3-clause
3,526
#!/usr/bin/python # # Copyright 2010 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 b...
donspaulding/adspygoogle
tests/adspygoogle/adwords/alltests.py
Python
apache-2.0
1,393
#!/usr/bin/python # # :Author: PB # :Date: 4 Aug 2015 # :License: GPL v2 # # motor controller for k Hats with a list of motors on each Hat # # Todo: # -- add polling for sensors on ADC (see cmtd code) # -- what process for determining presence? average last second? # -- write poll result to sensor file # -- switch ...
slobberchops/rop
controls/controllers.py
Python
gpl-3.0
6,303
# Copyright 2018 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, ...
googleapis/python-ndb
google/cloud/ndb/stats.py
Python
apache-2.0
15,713
from django.db import models # Create your models here. class Course(models.Model): created_at = models.DateTimeField(auto_now_add=True) title = models.CharField(max_length=255) description = models.TextField() def __str__(self): return self.title class Step(models.Model): title = models....
davejlin/treehouse
python/django/learning_site/courses/models.py
Python
unlicense
616
import pyquaternion # Create a quaternion representing a rotation of +90 degrees about positive y axis. my_quaternion = pyquaternion.Quaternion(axis=[0, 1, 0], degrees=90) my_vector = [0, 0, 4] my_rotated_vector = my_quaternion.rotate(my_vector) print('\nBasic Rotation') print('--------------') print('My Vector: {}...
KieranWynn/pyquaternion
demo/demo.py
Python
mit
1,146
#!/usr/bin/env python # -*- coding: utf-8 -*- # # genedb 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 # auto...
BaileyGlen/genedb
docs/conf.py
Python
mit
8,446
{ 'repo_type' : 'git', 'url' : 'https://github.com/DeadSix27/AMF', 'rename_folder' : 'amd_media_framework_headers', 'depth_git': 1, 'needs_configure' : False, 'needs_make' : False, 'needs_make_install' : False, 'run_post_patch' : [ 'if [ ! -f "already_done" ] ; then if [ ! -d "{target_prefix}/include/AMF" ]; ...
DeadSix27/python_cross_compile_script
packages/dependencies/amf_headers.py
Python
mpl-2.0
664
#!/usr/bin/env python # # Python Object Transfer: transport # import struct import select import socket import logging import threading import SocketServer logger = logging.getLogger(__name__) _DEB = logger.debug _INF = logger.info # # Factory # def get_transport(qos={}): return TCPTransport() # # URI encoding...
int-0/potp
src/potp/transport.py
Python
lgpl-3.0
11,848
__author__ = 'scott' import os from DjangoServer.settings.base import * DEBUG = True
Sensorica/Sensor-Network
DjangoServer/DjangoServer/settings/dev.py
Python
cc0-1.0
87
import os try: from PIL import Image from PIL import ImageColor except ModuleNotFoundError: exit("請安裝 Python Imaging Library 7.2.0, 指令: pip install Pillow") def main(): current_dir = (os.path.abspath(os.path.dirname(__file__))) image_types = ("png", "jpg", "gif") default_image_size = (800, 60...
t5318019/playground
tools/genImages.py
Python
mit
1,595
""" Apply a wave equation fit to the beta oscillations. as in Zanos et al 2015 Thy use a 2ms step size Fit wave equation over 20ms ( not even full beta period? ) they use lsqcurvefit in Matlab to fit the wave equation. there is a python equivalent scipy.optimize.leastsq 2D wave equation is u(x,y,t) = A(t) np.sin(K...
michaelerule/neurotools
spatial/wave_parametric_models.py
Python
gpl-3.0
19,987
# Copyright 2016 - 2021 Ternaris. # SPDX-License-Identifier: AGPL-3.0-only import math import mimetypes import os import time from datetime import timezone from pathlib import Path import jwt from aiohttp import web from aiohttp.web_urldispatcher import SystemRoute AGGRESSIVE_CACHING = bool(os.environ.get('MARV_EXP...
ternaris/marv-robotics
code/marv/marv_webapi/tooling.py
Python
agpl-3.0
4,756
#!/usr/bin/env python """ -------------------------------------------------------------------------------- (c) 2017 Julian Rees License: GNU GPLv3 Description: Plot the performance of the SCF convergence in ORCA. Run: python scfconvergence.py filename [scfnum skip] Arguments: filename - file name with extension; ...
julianrees/scripts
python/scfconvergence.py
Python
gpl-3.0
3,926
from enum import Enum EXIT_CODES = [ "SUCCESS", "BUILD_FAILURE", "PARSING_FAILURE", "COMMAND_LINE_ERROR", "TESTS_FAILED", "PARTIAL_ANALYSIS_FAILURE", "NO_TESTS_FOUND", "RUN_FAILURE", "ANALYSIS_FAILURE", "INTERRUPTED", "LOCK_HEL...
antmicro/distant-bes
distantbes/enums.py
Python
apache-2.0
1,058
# -*- coding: utf-8 -*- import flask_sqlalchemy from flask import Response from .base import json def render_schema(model, schema=None): headers = {} if schema is None: resp = json.dumps(model) elif isinstance(model, flask_sqlalchemy.Pagination): resp = schema(many=True).dumps(model.item...
fengluo/flask-tube
flask_tube/response.py
Python
mit
779