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
# -*- encoding: utf-8 -*- from abjad import * def test_agenttools_InspectionAgent__select_vertical_moment_at_01(): score = Score([]) tuplet = scoretools.FixedDurationTuplet(Duration(4, 8), []) tuplet.extend("d''8 c''8 b'8") score.append(Staff([tuplet])) staff_group = StaffGroup([]) staff_grou...
mscuthbert/abjad
abjad/tools/agenttools/test/test_agenttools_InspectionAgent__select_vertical_moment_at.py
Python
gpl-3.0
3,867
from nose.tools import * import builder.automate as ba from pywinauto import WindowNotFoundError, application def test_exe(): exe = ba.exe("/") assert exe.split('.')[1] == 'exe' @raises(WindowNotFoundError) def test_connect_not_running(): ba.connect() def test_connect(): ba.start(ba.exe(ba.default...
degiere/builder-automation
tests/test_automate.py
Python
gpl-2.0
1,084
# -*- coding: utf-8 -*- # django-djcopyright # tests/templatetags/test_djcopyright_tags.py from typing import List from django.test import TestCase from django.utils import timezone from djcopyright.templatetags.djcopyright_tags import djcopyright_years __all__: List[str] = ["DjcopyrightYearsTemplatetagTest"] ...
vint21h/django-djcopyright
tests/templatetags/test_djcopyright_tags.py
Python
gpl-3.0
707
#coding:utf-8 from flask import Flask,request, render_template app = Flask(__name__) @app.route('/') def index(): return render_template('demo.html') if __name__ == '__main__': app.run(host='0.0.0.0', debug=True)
gensmusic/test
third_party/python/flask/third-party/pagedown/usage.py
Python
gpl-2.0
230
# -*- coding: utf-8 -*- # # This file is distributed under MIT License or default open-tamil license. # (C) 2013-2015 Muthiah Annamalai # # This file is part of 'open-tamil' examples # It can be used to identify patterns in a Tamil text files; # e.g. it has been used to identify patterns in Tamil Wikipedia # article...
tshrinivasan/open-tamil
examples/solpattiyal.py
Python
mit
3,639
from __future__ import absolute_import __author__ = 'chris' from django.forms.models import model_to_dict import six class UpdateScriptsMixin(object): def save(self, **kwargs): super(UpdateScriptsMixin, self).save(**kwargs) from ..backend.utils import load_scripts load_scripts() class Woo...
wooey/django-djangui
wooey/models/mixins.py
Python
bsd-3-clause
1,696
#!/usr/bin/python # # Retrieve information on an existing VPC. # # import module snippets from ansible.module_utils.basic import * from ansible.module_utils.ec2 import * import boto.vpc def main(): argument_spec = ec2_argument_spec() argument_spec.update(dict( resource_tags=dict(type='dict', require...
rackn/container-networking-ansible
test/common/library/ec2_vpc_facts.py
Python
apache-2.0
1,587
# encoding: UTF-8 import sys if sys.version_info < (3, 0): reload(sys) sys.setdefaultencoding('utf8') sys.path.append('../') sys.path.append('../../') sys.path.append('../../vnpy/trader/') import multiprocessing import signal from time import sleep from datetime import datetime, time import vnpy.trader.vt...
bigdig/vnpy
account/runServer.py
Python
mit
4,757
import urllib2,cookielib import random import signal import sys from sys import argv from bs4 import BeautifulSoup USAGE = """Usage: python s3knock.py wordlist term position Example: python s3knock.py wordlist.txt tumblr 1 """ SEPARATORS = ["", "-", ".","_"] class bcolors: public = '\033[92m' exists = '\033...
theanti9/s3knock
s3knock.py
Python
mit
3,409
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os, json KEY1 = "Key1" KEY2 = "Key2" KEY3 = "Key3" # Basic template of configuration DEFAULT_CONF = {'mailbox0':{'username':'', 'password':'', 'imap_server':'', 'imap_port':'993', ...
furkantokac/Fmail
Fmail/config.py
Python
mit
2,219
import logging from grab.selector.selector import * # noqa from grab.util.warning import warn warn('Module `grab.selector` is deprecated. Use `selection` package.')
kevinlondon/grab
grab/selector/__init__.py
Python
mit
167
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn from corehq.apps.reports.graph_models import MultiBarChart, Axis from corehq.apps.reports.sqlreport import TableDataFormat from custom.care_pathways.reports import CareBaseReport from custom.care_pathways.filters import GeographyFilter, Gende...
puttarajubr/commcare-hq
custom/care_pathways/reports/adoption_disaggregated_report.py
Python
bsd-3-clause
4,008
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 def main(): args = demisto.args() query = args.get('query') size = int(args.get('size')) query_result = demisto.searchIndicators(query=query, size=1, page=0) total = query_result.get('total', 0) outputs ...
VirusTotal/content
Packs/DeveloperTools/Scripts/VerifyEnoughIndicators/VerifyEnoughIndicators.py
Python
mit
593
from datetime import datetime now = datetime.now() year, month = now.year, now.month from calendar import Calendar def consumed_hours(): from numpy.random import normal return round(normal(10.5, 0.7), 1) cal = Calendar() for d in cal.itermonthdates(year, month): if d.month != month: print '%5s'%...
ayokyun/si-epm-timetable
random_timetable.py
Python
mit
572
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2007 Zuza Software Foundation # # This file is part of translate. # # translate 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...
lehmannro/translate
tests/odf_xliff/test_odf_xliff.py
Python
gpl-2.0
4,609
from Components.config import config from Extra.SAPCL import SAPCL import os def autoSendCrashLogs(session, id, arg): if not config.sifteam.cloud.crashlogs.value: return api = SAPCL() files = os.listdir("/hdd/") if not files: return for file in files: try: if file[:14] != "sifteam_crash_" or file[...
SIFTeam/enigma2
lib/python/SIFTeam/Crashlogs.py
Python
gpl-2.0
552
"""The tests for the Template switch platform.""" from homeassistant.core import callback from homeassistant import setup import homeassistant.components as core from homeassistant.const import STATE_ON, STATE_OFF from tests.common import ( get_test_home_assistant, assert_setup_component) class TestTemplateSwit...
persandstrom/home-assistant
tests/components/switch/test_template.py
Python
apache-2.0
16,305
import os import sys import time import datetime import pandas as pd from math import log from algorithm import Algorithm epoch = datetime.datetime(1970, 1, 1) class Hot: """ Ranks stocks based on if the daily close price is above or below the open stock price. """ def __init__(self, ups, downs, date): self.up...
hirodotp/mdata
algorithms/reddit.py
Python
gpl-2.0
2,221
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division import sys import signal import argparse import numpy as np np.set_printoptions(precision=3, suppress=True) np.set_printoptions(formatter={'float': '{: 0.3f}'.format}) # see: http://stackoverflow.com/questions/2891790/pretty-printing-of-num...
decabyte/vehicle_core
scripts/pilot_cli.py
Python
bsd-3-clause
5,387
#!/usr/bin/env python # # Copyright 2017 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 ...
tst-ahernandez/earthenterprise
earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/utils.py
Python
apache-2.0
12,945
from runner import StoryRunner from finder import (find_steps_modules, find_text_specs, find_before_all, find_after_all, find_before_each, find_after_each) from hooks import BeforeAll, AfterAll, BeforeEach, AfterEach fro...
hltbra/pycukes
pycukes/__init__.py
Python
mit
434
# -*- coding: utf-8 -*- from pySupRST.main import sup_rst from pprint import pprint c= sup_rst() a = c.get_tm("RTR_P_DG1") pprint(a)
sourceperl/pySupRST
lab/with_sqlalchemy/test.py
Python
mit
137
#!/usr/bin/env python ## Copyright (c) 2012 The WebM project authors. All Rights Reserved. ## ## Use of this source code is governed by a BSD-style license ## that can be found in the LICENSE file in the root of the source ## tree. An additional intellectual property rights grant can be found ## in the file PATENT...
jian929/stagefright
vp9/omx-components/videocodec/libvpx_internal/libvpx/tools/diff.py
Python
gpl-2.0
4,218
#!/usr/bin/env python # coding=utf-8 rship = [ # id, from(sid), to(pid) ['b','a'], ['c','a'], ['c','d'], ['e','c'] ] def add_data(_from,_to): rship.append([_from,_to]) def search_parent(_id): pass def search_son(_id): pass
zhaochl/python-utils
agrith_util/graph/tag_relationship.py
Python
apache-2.0
258
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # === This file is part of Calamares - <http://github.com/calamares> === # # Copyright 2014, Philip Müller <philm@manjaro.org> # # Calamares is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
Archman-OS/calamares-configs
src/modules/initcpio/main.py
Python
gpl-3.0
1,527
from enum import Enum __author__ = 'dirkfuchs' class Format(Enum): oneLine = 0 oracle = 1
erget/tnsmaster
tnsnames/format.py
Python
mit
101
#!/usr/bin/python # -*- coding: utf-8 -*- """ Parameter file for the plot_Stairway.py program """ # String, path to the file containing the summary of the Stairway plot stairway_file="../Data/YRI_start2_200files_summary" # Float, Stairway inference "factor" (if genome length was divided by 10 for the stairway inf...
lapierreM/Yoruba_demography
Programs/plot/plot_Stairway_parameters.py
Python
lgpl-2.1
528
from unittest import TestCase import numpy as np import keras as ks import keras.layers as layers from orcanet.model_builder import change_dropout_rate class TestDropoutChange(TestCase): def setUp(self): def dropout_model(rate_before, rate_after): inp1 = layers.Input((5, 1)) x1 = ...
ViaFerrata/DL_pipeline_TauAppearance
orcanet/tests/test_model_setup.py
Python
agpl-3.0
3,419
# -*- coding: utf-8 -*- class FakeDirectoryNode(object): def __init__(self): self.unlocker = None self.triggered = False self.waiting_nodes = [] self.removed_nodes = [] self.prior_nodes = [] self.waiting_for_node = None def unlock(self, owner): self.un...
Bajoo/client-pc
tests/unit_tests/index/fake_directory_node.py
Python
gpl-3.0
665
from __future__ import print_function, division import unittest import numpy as np from pyscf.nao import nao from os.path import dirname, abspath class KnowValues(unittest.TestCase): def test_vna_n2(self): dname = dirname(abspath(__file__)) n = nao(label='n2', cd=dname) m = 200 dvec,midv = 2*(n.atom...
gkc1000/pyscf
pyscf/nao/test/test_0004_vna.py
Python
apache-2.0
1,811
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
mnlipp/mbed
workspace_tools/export/iar.py
Python
apache-2.0
6,420
import pygame import src.colours as colours from src.entity import Entity from pygame.math import Vector2 class Particle(Entity): def __init__( self, pos: Vector2, # Pretty sure this is unused velocity: Vector2, angle: float, angular_velocity: float, ...
joereynolds/Mr-Figs
src/game_object/particle.py
Python
gpl-3.0
1,181
# -*- coding:iso-8859-1 -*- """ Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard Python datetime module. """ from __future__ import unicode_literals from __future__ import division __license__ = "Simplified BSD" import datetime import string import time i...
klahnakoski/cloc
cloc/util/vendor/dateutil/parser.py
Python
mpl-2.0
33,572
# # GeoTiler - library to create maps using tiles from a map provider # # Copyright (C) 2014 by Artur Wroblewski <wrobell@pld-linux.org> # # 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 ...
pikeBishop/OMP_gpxReport
geotiler/tests/test_geo.py
Python
gpl-2.0
3,153
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # pylint: disable=maybe-no-member, invalid-name """Test request import and updates.""" import csv from collections import OrderedDict from cStringIO import StringIO from itertools import izip from flask....
AleksNeStu/ggrc-core
test/integration/ggrc/converters/test_import_assessments.py
Python
apache-2.0
19,212
# -*- coding: utf-8 -*- from openerp import api, fields, models class AccountCommonAccountReport(models.TransientModel): _name = 'account.common.account.report' _description = 'Account Common Account Report' _inherit = "account.common.report" display_account = fields.Selection([('all','All'), ('...
vileopratama/vitech
src/addons/account/wizard/account_report_common_account.py
Python
mit
679
''' Created on Aug 6, 2014 @author: Amit ''' if __name__ == '__main__': pass
amitgupta151/tweetstorm
statistics.py
Python
gpl-2.0
82
def square_dict(num): return {n: n * n for n in range(1, int(num) + 1)} # py.test exercise_10_27_16.py --cov=exercise_10_27_16.py --cov-report=html def test_square_dict(): assert square_dict(3) == {1: 1, 2: 4, 3: 9} assert square_dict(0) == {} assert square_dict(-1) == {} if __name__ == '__main__': ...
JSBCCA/pythoncode
exercises/exercise_10_27_16.py
Python
mit
362
""" Video Tag --------- This implements a Liquid-style video tag for Pelican, based on the octopress video tag [1]_ Syntax ------ {% video url/to/video [width height] [url/to/poster] %} Example ------- {% video http://site.com/video.mp4 720 480 http://site.com/poster-frame.jpg %} Output ------ <video width='720' hei...
wsy1607/Data-Analysis-of-Campus-Crime-Index
website/plugins/liquid_tags/video.py
Python
mit
2,289
import analysis as an import exchange_API as API import portfolio as pf import strategy as st import database as db import logging def backtester_update(df, candle_data, index): """ Copies the candle_data row (dataframe) and adds it to the primary dataframe. The following columns are expected: [date...
Shutch/Cralgo
cralgo/backtester.py
Python
mit
3,655
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. import datetime from turbogears.database import session from bkr.serve...
jtoppins/beaker
IntegrationTests/src/bkr/inttest/server/selenium/test_recipes_xmlrpc.py
Python
gpl-2.0
7,534
import re from ztag.annotation import Annotation from ztag.annotation import OperatingSystem from ztag.annotation import Type from ztag.annotation import Manufacturer from ztag import protocols import ztag.test class FtpOverlandStorage(Annotation): protocol = protocols.FTP subprotocol = protocols.FTP.BANNER ...
zmap/ztag
ztag/annotations/FtpOverlandStorage.py
Python
apache-2.0
1,698
""" Robust MLR via iteratively reweighted least squares. """ import numpy as np from utide.utilities import Bunch # Weighting functions: def andrews(r): r = np.abs(r) r = max(np.sqrt(np.spacing(1)), r) w = (r < np.pi) * np.sin(r) / r return w def bisquare(r): r = np.abs(r) w = (r < 1) * (...
wesleybowman/UTide
utide/robustfit.py
Python
mit
7,233
# -*- coding: utf-8 -*- import os import re import sys import json import time import codecs import urllib2 import logging kill_ssh_command = 'taskkill /F /IM ssh.exe' ssh_nat_command = r'ssh -f -NR %(server_port)s:127.0.0.1:%(proxy_port)s %(server_login_name)s@%(server_name)s' PATH = os.path.dirname(sys.argv[0]) ...
wanghuafeng/spider_tools
nat/daemon_nat_win.py
Python
mit
1,964
import sys # where RobotControl.py, etc lives sys.path.append('/home/pi/Desktop/ADL/YeastRobot/PythonLibrary') from RobotControl import * ################################# ### Define Deck Layout ################################# deck="""\ SW24P BLANK BLANK DW24P BLANK BLANK SW96P SW96P SW24P BLANK BLANK ...
tdlong/YeastRobot
UserPrograms/Rob_Sexual_OD630_Spore_4.py
Python
gpl-3.0
1,727
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
scrapinghub/keystone
keystone/openstack/common/jsonutils.py
Python
apache-2.0
6,840
# -*- coding: utf-8 -*- ''' Connection module for Amazon SQS .. versionadded:: 2014.7.0 :configuration: This module accepts explicit sqs credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
stephane-martin/salt-debian-packaging
salt-2016.3.3/salt/modules/boto_sqs.py
Python
apache-2.0
5,122
import threadly, time, random import unittest clf = 0 llf = 0 def callLF(lf): # print "CALLED" lf.setter(True) def listenFromFuture(): global llf # print "GotCalled" llf +=1 def callFromFuture(s): global clf # print "GotCalled", s clf +=1 def listenException(): raise Exception("TEST1") def callExcep...
threadly/python-threadly
tests/futureCheck.py
Python
unlicense
1,961
import os DEBUG = True TEMPLATE_DEBUG = DEBUG MODELTRANSLATION_DEBUG = DEBUG WSGI_APPLICATION = 'openbudgets.wsgi.application' SECRET_KEY = 'pvh9d)+7aui4=evh$yv!qgbr3oyz-4=^oj_%6g8+v57b=de5)7' ALLOWED_HOSTS = ['.openbudgets.dev:8000'] SESSION_COOKIE_DOMAIN = 'openbudgets.dev' SITE_ID = 1 TIME_ZONE = 'UTC' US...
kobiluria/openbudgets
openbudgets/settings/__init__.py
Python
bsd-3-clause
9,314
#!/usr/bin/env python from yape.initialize import initialize from state import game_state from listeners import dispatcher from config import ASSETS_DIR, Config from assets import Player, Level, Questions from logic import logic from graphics import render def main(): # Initialize display screen and load assets...
calebsmith/razzytails
src/main.py
Python
gpl-3.0
1,163
# Copyright 2011 Kalamazoo College Computer Science Club # <kzoo-cs-board@googlegroups.com> # This file is part of LitHub. # # LitHub 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 v...
umangv/LitHub
LitHub/fbconnect/utils.py
Python
gpl-3.0
5,141
# Generated by Django 3.0 on 2019-12-03 17:14 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_...
jbergantine/django-blog
django_blog/migrations/0001_initial.py
Python
mit
2,509
from python_kemptech_api import * # Specify the LoadMaster connection credentials here: loadmaster_ip = "" username = "" password = "" vs_ip_1 = "" vs_ip_2 = "" rs_ip_1 = "" rs_ip_2 = "" vs_port = "" rs_port = "" class RealServerPool(object): healthcheck_parameters = [ "checktype", "checkport", ...
KEMPtechnologies/python-kemptech-api
examples/real_server_pooling.py
Python
apache-2.0
4,377
""" Implements a feature set based off of stemmer applied to words. .. autoclass:: revscoring.languages.features.Stemmed :members: :member-order: bysource Supporting classes ------------------ .. autoclass:: revscoring.languages.features.stemmed.Revision :members: :member-order: bysource .. autoclas...
yafeunteun/wikipedia-spam-classifier
revscoring/revscoring/languages/features/stemmed/__init__.py
Python
mit
516
""" Locate features in images: combine find and refine steps """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np import pandas as pd from .find import find_ellipse, find_ellipsoid, find_disks from .refine import (refine_ellipse, ...
caspervdw/circletracking
circletracking/locate.py
Python
bsd-3-clause
5,786
#!/usr/bin/env python # Copyright 2015 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. """This script provides methods for clobbering build directories.""" import argparse import os import shutil import subprocess import ...
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/build/clobber.py
Python
gpl-3.0
4,013
from __future__ import unicode_literals from copy import deepcopy import datetime from django.core.exceptions import FieldError from django.db import connection from django.db.models import F from django.db import transaction from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from django.test.util...
ulope/django
tests/expressions/tests.py
Python
bsd-3-clause
28,502
# 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, software # distrib...
openstack/python-openstackclient
openstackclient/tests/unit/compute/v2/test_server_backup.py
Python
apache-2.0
8,309
# coding: utf8 import logging from django.conf import settings from django.utils import six from django.http import HttpResponse, HttpResponseBadRequest from django.views.generic import View from django.shortcuts import redirect, get_object_or_404 from django.forms import ValidationError from django.db.models.loading ...
pawciobiel/django-getpaid
getpaid/backends/epaydk/views.py
Python
mit
5,437
""" byceps.blueprints.api.v1.tourney.match.views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from __future__ import annotations from datetime import datetime from itertools import chain from typing import Any, Itera...
homeworkprod/byceps
byceps/blueprints/api/v1/tourney/match/comments/views.py
Python
bsd-3-clause
7,187
from django.core.management.base import BaseCommand from hs_core.models import BaseResource from hs_access_control.models import PrivilegeCodes from django_irods.icommands import SessionException class Command(BaseCommand): help = "Add quotaUserName AVU to all resources in iRODS as needed" def han...
RENCI/xDCIShare
theme/management/commands/add_quota_avu.py
Python
bsd-3-clause
2,389
# coding=utf-8 ''' Created on 2013-8-15 流程协调 @author: gudh ''' import traceback,os import bookcrawl,bookshot,bookorm,bookconfig,bookimg,bookupload def get_book_ids(urls=["http://e.jd.com/ebook.html"]): '''获取一个页面内的所有id''' idss = [] for url in urls: content = bookcrawl.get_url_content(url) i...
Yhzhtk/bookcatch
bookrun.py
Python
gpl-2.0
4,970
""" Modified version of build_scripts that handles building scripts from functions. """ from __future__ import division, absolute_import, print_function from distutils.command.build_scripts import build_scripts as old_build_scripts from numpy.distutils import log from numpy.distutils.misc_util import is_string cla...
DailyActie/Surrogate-Model
01-codes/numpy-master/numpy/distutils/command/build_scripts.py
Python
mit
1,731
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible 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. # # Ansible is d...
wrouesnel/ansible
lib/ansible/plugins/action/vyos.py
Python
gpl-3.0
3,846
import string,math import db_base as base ###################### #initial def read_raw_time_data(file_name,sepper=','): fin=open(file_name,'r'); length=fin.readline().count(',')+1; fin.seek(0); print 'number of item each line:',length res=[]; for line in fin: items=line.split(sepper); for i in range(length)...
yanxiangtianji/Neuron
dataInit/db.py
Python
gpl-2.0
8,453
from flask import abort, jsonify from sqlalchemy.orm import with_polymorphic from .api_blueprint import api_blueprint from app.models.quiz import Quiz from app.models.quiz_section import QuizSection from app.models.question \ import Question, TextQuestion, SingleChoiceQuestion, QuestionChoice from .api_blueprint im...
Frederick-S/quiz
app/api_v1/quiz.py
Python
mit
1,949
from django.contrib.auth.models import User from loginurl.models import Key class LoginUrlBackend: """ Authentication backend that checks the given ``key`` to a record in the ``Key`` model. If the record is found, then ``is_valid()`` method is called to check if the key is still valid. """ def...
vanschelven/cmsplugin-journal
loginurl/backends.py
Python
bsd-3-clause
767
# Copyright 2019 The Magenta 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 law or agreed to in ...
jesseengel/magenta
magenta/models/coconet/lib_tfsampling.py
Python
apache-2.0
12,908
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Test suite for the the Chasy program. ''' import unittest import logic import supseq import baseclock import copy import clocks.verboserussian as verboserussian __author__ = "Mac Ryan" __copyright__ = "Copyright 2011, Mac Ryan" __license__ = "GPL v3" __maintainer__ = ...
quasipedia/Chasy
src/testsuite.py
Python
gpl-3.0
174,862
""" Implements Autodock Vina's pose-generation in tensorflow. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals __author__ = "Bharath Ramsundar" __copyright__ = "Copyright 2016, Stanford University" __license__ = "MIT" import warnings import numpy as np ...
ktaneishi/deepchem
contrib/vina_model/vina_model.py
Python
mit
18,997
from cheetax.adapters.adapter_type import AdapterType class Query(object): """ Query builder entry functions """ @classmethod def _builder(cls): return QueryBuilder() @classmethod def import_(cls, source_type): return cls._builder().import_(source_type) @classmethod ...
Fredehagelund92/Cheetax
cheetax/sql/query.py
Python
apache-2.0
4,477
name0_0_0_0_0_2_0 = None name0_0_0_0_0_2_1 = None name0_0_0_0_0_2_2 = None name0_0_0_0_0_2_3 = None name0_0_0_0_0_2_4 = None
goodwinnk/intellij-community
python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_0/_pkg0_0_0/_pkg0_0_0_0/_pkg0_0_0_0_0/_mod0_0_0_0_0_2.py
Python
apache-2.0
128
import os import pytest import pandas as pd from astropy import units as u from numpy.testing import assert_almost_equal, assert_array_almost_equal from tardis.io.config_reader import Configuration from tardis.model import Radial1DModel from tardis.io.decay import IsotopeAbundances def data_path(filename): return...
kaushik94/tardis
tardis/model/tests/test_base.py
Python
bsd-3-clause
11,368
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # check dir for files older 60s so we are sure to have complete transfered files # then create a tmp dir for them # put a screenshot # use bento4 to create different qualities # hls # dash # webm # when finished remove file and move tmp directory try: fro...
balrok/web_video
web_video/run.py
Python
mit
4,090
""" Django settings for locallibrary project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ impo...
Konosh93/locallibrary
locallibrary/settings.py
Python
mit
4,331
""" Simple environment with known optimal policy and value function. Action 0 then 0 yields randomly -1 or 1 reward and terminates the session. Action 0 then 1 yields randomly 0, 0, or 9 reward and terminates the session. Action 0 then 0 yields randomly 0 or 2 reward and terminates the session. Action 1 then 1 yields ...
d1hotpep/openai_gym
gym/envs/debugging/two_round_nondeterministic_reward.py
Python
mit
1,959
#-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame 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. OpenSesame is distri...
SCgeeker/OpenSesame
plugins/video_player/video_player.py
Python
gpl-3.0
4,816
#!/usr/bin/env python3 import argparse import os def process(filename): cmd = ["./cvc4_2019_05_14", "--lang=smtlib2.0", "--output-lang=smtlib2.6.1", "--dump=raw-benchmark", "--preprocess-only", "--no-simplification", "--no-ite-simp", "--...
florianschanda/smtlib_schanda
translate_benchmarks.py
Python
gpl-3.0
1,812
from platform import system import sys import os from os import mkdir, path, access, R_OK # W_OK for write permission. from shutil import copy from platform import system version = "1.0" description = "This templates allows you to create simple documents in PDF format" # pwd = .../templates/pdf-simple local_path = ...
dloureiro/tpl4md
share/templates/pdf-simple/generator.py
Python
agpl-3.0
2,150
### Open Provenance March 2016 - https://myveryown.org ### Bitcoin Blockchain Information using python-bitcoinlib ### Count of Transactions in first 10,001 Blocks ### Donate to Open Provenance: 1opDUZQ9nsL1LJALBdV1dvqSMtcvNj9EC ## In this script we search the blockchain and count the no of transactions in the first 10...
OpenProvenance/python-bitcoinlib-scripting
10-TxCount.py
Python
mit
994
#!/usr/bin/python # # Copyright (c) 2017 Bruno Medina Bolanos Cacho <bruno.medina@microsoft.com> # # 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':...
Azulinho/ansible
lib/ansible/modules/cloud/azure/azure_rm_managed_disk.py
Python
gpl-3.0
10,719
# -*- coding: utf-8 -*- import allauth.account.forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from django import forms from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from settings import models INLIST_DELETE_CONFIRM_LABEL =...
XeryusTC/projman
settings/forms.py
Python
mit
1,338
# Copyright 2018 Inap. # # 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, softwa...
internap/fake-switches
tests/arista/test_arista_rest_api.py
Python
apache-2.0
3,331
#! /usr/bin/python # coding: utf-8 import sys import io import tempfile import os import time import json import Queue import urllib import urllib2 import contextlib nodes = [] server_nodes = [] switch_nodes = [] server = {} server_priority = [] switches = {} switches_dpid = {} adjacent = [] queue_property = [] ex...
mixisbad/qos
apps/qos/queue-allocator2.py
Python
apache-2.0
23,330
__author__ = 'dnovogrodsky' import re import pathlib import os from subprocess import call #machineName = re.compile('(deflogix-pc.def-logix.local)') machineName = re.compile('(andre_sp3.def-logix.local)') inputSyslogMessages = open('messages','r') outputSyslogMessages = open('syslogMessages.txt', 'w') # read the in...
DavidNovo/ExplorationsWithPython
importSyslogFiles.py
Python
mit
1,528
# python imports import json # django imports from django.contrib.auth.decorators import permission_required from django.core.paginator import Paginator from django.urls import reverse from django.http import HttpResponse from django.shortcuts import render from django.template.loader import render_to_string from djan...
diefenbach/django-lfs
lfs/manage/views/review.py
Python
bsd-3-clause
11,457
#! /usr/bin/python # -*- coding: utf8 -*- import tensorflow as tf import tensorlayer as tl from tensorlayer.layers import set_keep import numpy as np import time from PIL import Image import os import io import json """ You will learn: 1. How to save time-series data (e.g. sentence) into TFRecord format file. 2. How...
trhongbinwang/data_science_journey
deep_learning/tensorlayer/tutorial_tfrecord3.py
Python
apache-2.0
19,856
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
tomas-edwardsson/check_mk
web/htdocs/actions.py
Python
gpl-2.0
4,100
import os import random from scrapy.conf import settings from fake_useragent import UserAgent class RandomUserAgentMiddleware(object): def __init__(self): super(RandomUserAgentMiddleware, self).__init__() self.ua = UserAgent() def process_request(self, request, spider): request.headers...
rdempsey/ddl-data-wrangling
part-two-web-scraping/govbenefitsspider/govbenefitsspider/middlewares.py
Python
mit
361
from scrapy.exceptions import IgnoreRequest import redis_const class HttpStatusMiddleware(object): def process_response(self, request, response, spider): if response.status == 200: pass elif response.status == 404 or response.status == 410 or response.status == 400: if "com...
jiady/htdb
crawler/crawler/HttpStatusMiddleware.py
Python
mit
786
import datetime import logging import os import socket import time from ...common.interfaces import AbstractInfoWidget from ..Console import screen logger = logging.getLogger(__name__) class PhantomProgressBarWidget(AbstractInfoWidget): """ Widget that displays progressbar """ def get_index(self):...
yandex/yandex-tank
yandextank/plugins/Phantom/widget.py
Python
lgpl-2.1
6,082
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2004 Werner Mayer LGPL import os,sys,string #os.chdir("E:\\Develop\\FreeCADWin\\scripts") file = open(sys.argv[1]) if(len(sys.argv) > 3): sys.stderr.write("Wrong Parameter\n Usage:\n PythonToCPP Infile.py [Outfile]\n") if(len(sys.argv) > 2): ...
YuanYouYuan/FreeCAD
src/Tools/PythonToCPP.py
Python
lgpl-2.1
949
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, cstr from frappe import msgprint, _ def execute(filters=None): if not filters: filters = {} salary_slip...
mahabuber/erpnext
erpnext/hr/report/monthly_salary_register/monthly_salary_register.py
Python
agpl-3.0
4,082
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012, Red Hat, 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 # ...
shootstar/novatest
nova/tests/compute/test_rpcapi.py
Python
apache-2.0
15,851
# swift_build_support/products/swiftdriver.py -------------------*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.tx...
CodaFi/swift
utils/swift_build_support/swift_build_support/products/swiftdriver.py
Python
apache-2.0
2,222
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Sep 21 14:37:53 2017 @author: christopherbridge """ import pickle def materials_default(): """ Return a dictionary containing default materials properties Name: yeild_stress, Pa ultimate_stress, Pa ...
PowerPlum/pipetoolbox
pipetoolbox/materials.py
Python
mit
9,429
#!/usr/bin/env python # -*- coding: utf-8 -*- # === setup.py ------------------------------------------------------------=== # Copyright © 2011-2012, RokuSigma Inc. and contributors. See AUTHORS for more # details. # # Some rights reserved. # # Redistribution and use in source and binary forms of the software as well ...
maaku/haiku-lang
setup.py
Python
bsd-3-clause
4,196
# 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...
chemelnucfin/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator.py
Python
apache-2.0
63,282
# Sample script for use by test_gdb.py def foo(a, b, c): bar(a, b, c) def bar(a, b, c): baz(a, b, c) def baz(*args): id(42) foo(1, 2, 3)
firmlyjin/brython
www/tests/unittests/test/gdb_sample.py
Python
bsd-3-clause
153
class ImageClass(): "Stores the paths to images for a given class" def __init__(self, name, image_paths): self.name = name self.image_paths = image_paths def __str__(self): return self.name + ', ' + str(len(self.image_paths)) + ' images' def __len__(self): return le...
liuzz1983/open_vision
openvision/datasets/utils.py
Python
mit
1,945