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) 2021 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google-research/python-graphs
python_graphs/control_flow_test_components.py
Python
apache-2.0
4,962
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing M2M table for field references on 'Message' db.delete_table('django_mailbox_message_references') ...
leifurhauks/django-mailbox
django_mailbox/south_migrations/0009_remove_references_table.py
Python
mit
2,544
import requests from semantics.simulator import tasks, urls commands_url = urls.global_url + "commands/" conditions_url = urls.global_url + "conditions/" command1 = tasks.createCommand("command1", urls.global_url, 25, "continuousVariable") command2 = tasks.createCommand("command2", url...
viniciusmsfraga/aura-gateways
client.py
Python
gpl-3.0
874
# -------------------------------- Database models---------------------------------------------------------------------- import sys, os import sqlalchemy from sqlalchemy import create_engine sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) import secrets import settings MY...
MQFN/MQFN
bbmq/server/models.py
Python
apache-2.0
3,993
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('master', '0023_gruposector'), ] operations = [ migrations.AddField( model_name='sector', name='grupo...
Teino1978-Corp/Teino1978-Corp-light_.gitignore
light_master_migrations_0024_sector_grupo.py
Python
mit
461
import http.client import urllib.request import UserInteract import os import shutil import json from distutils.dir_util import * import time import tkinter.messagebox as tkMessageBox import downloader class Remote: def __init__(self, repo, directory, mcpath, LocalDB, gui = False, gui_parent = None): """Initialise ...
zyuiop/McModInstaller
Remote.py
Python
gpl-3.0
2,787
# 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 # d...
vganapath/rally
rally/plugins/common/scenarios/requests/http_requests.py
Python
apache-2.0
2,056
#!/usr/bin/env python # This file is part of nexdatas - Tango Server for NeXus data writer # # Copyright (C) 2012-2018 DESY, Jan Kotanski <jkotan@mail.desy.de> # # nexdatas is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
nexdatas/tools
test/NXSCreatePoolDSDBR2_test.py
Python
gpl-3.0
1,526
############################################################################# # # $Id: __init__.py,v 2.10.2.1 2008/05/17 09:56:01 irmen Exp $ # Pyro file to make Pyro a package, and to set up configuration. # # This is part of "Pyro" - Python Remote Objects # Which is (c) Irmen de Jong - irmen@users.sourceforge.net # M...
yasserglez/tagfs
packages/tagfs/contrib/Pyro/__init__.py
Python
mit
1,312
################################################################################ # 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...
apache/flink
flink-python/pyflink/fn_execution/pickle.py
Python
apache-2.0
1,256
import asyncio import time import logging import collections import re import os import gc from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.schema import MetaData import cloudbot from cloudbot.client im...
sbeparey/CloudBot
cloudbot/bot.py
Python
gpl-3.0
11,588
""" Greedy completer extension for IPython Normal tab completer refuses to evaluate nonsafe stuff. This will evaluate everything, so you need to consider the consequences of pressing tab yourself! Note that this extension simplifies readline interaction by setting only whitespace as completer delimiter. If this work...
mastizada/kuma
vendor/packages/ipython/IPython/Extensions/ipy_greedycompleter.py
Python
mpl-2.0
2,187
from PyQt5 import QtWidgets from projManagement.Validation import Validation from configuration.Appconfig import Appconfig import os # This class is called when user creates new Project class convertSub(QtWidgets.QWidget): """ Contains functions that checks project present for conversion and also function...
FOSSEE/eSim
src/subcircuit/convertSub.py
Python
gpl-3.0
2,427
from django.http import HttpResponse, HttpResponseServerError from django.test import RequestFactory, TestCase from django.test.utils import override_settings from nose.tools import eq_ from csp.middleware import CSPMiddleware HEADER = 'Content-Security-Policy' mw = CSPMiddleware() rf = RequestFactory() class Mid...
percipient/django-csp
csp/tests/test_middleware.py
Python
bsd-3-clause
2,535
import mysql.connector class DbObject: def __init__(self): self.cnx = mysql.connector.connect(user='root', password='', host='127.0.0.1',database='CareMeToo') self._query_getId = "SELECT * FROM %s WHERE ID=%i" self._filespath = "http://0.0.0.0:5000/caregivers/%i/files?filepath=%s" #cnx.close()
panzerfausten/CareMeTooServer
models/DbObject.py
Python
gpl-3.0
308
from spire.mesh import ModelController from spire.schema import SchemaDependency from tap.models import Group as GroupModel from tap.resources import Group from tap.structures import permission_extract, user_extract class GroupController(ModelController): """Group controller""" mapping = 'id name status' ...
esho/yabl.tap
tap/controllers/group.py
Python
bsd-3-clause
945
""" WSGI config """ import os, sys path = '/var/www/arsfest/releases/current/' if path not in sys.path: sys.path.append(path) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tf_arsfest.settings") os.environ.setdefault("DJANGO_ENVIRONMENT", "hugin") from django.core.wsgi import get_wsgi_application application ...
Teknologforeningen/tf_arsfest
wsgi.py
Python
mit
344
#!/usr/bin/python # # mongo.py -- a MongoDB collector for tcollector/OpenTSDB # Copyright (C) 2013 The tcollector Authors. # # 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 Foundation, either versio...
kylemallory/tcollector
collectors/available/mongo.py
Python
gpl-3.0
2,824
# -*- encoding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the...
InakiZabala/odoomrp-wip
mrp_operations_extension/models/res_config.py
Python
agpl-3.0
1,148
from zerver.lib.test_classes import WebhookTestCase class PivotalV3HookTests(WebhookTestCase): STREAM_NAME = 'pivotal' URL_TEMPLATE = "/api/v1/external/pivotal?stream={stream}&api_key={api_key}" def test_accepted(self) -> None: expected_topic = 'My new Feature story' expected_message = 'L...
brainwane/zulip
zerver/webhooks/pivotal/tests.py
Python
apache-2.0
8,966
# -*- coding: utf-8 -*- from __future__ import unicode_literals # Register your models here. from django.contrib import admin from service_builder.models import * class ServiceAdmin(admin.ModelAdmin): list_display = ['title','description','user','queries','arguments','created','updated'] admin.site.register(Ser...
dipapaspyros/bdo_platform
service_builder/admin.py
Python
mit
718
# coding=utf-8 from __future__ import division import numpy as _np from scipy.signal import welch as _welch, periodogram as _periodogram, freqz as _freqz import scipy.optimize as _opt import pycwt.wavelet as wave from scipy import linalg as _linalg import itertools as _itertools from ..BaseTool import Tool as _Tool fr...
MPBA/pyHRV
pyphysio/tools/Tools.py
Python
gpl-3.0
51,184
#!/usr/bin/env python # coding: utf-8 """ resyst.log ~~~~~~~~~~~~~ TODO: Description :copyright: 2017, Jonathan Racicot, see AUTHORS for more details :license: MIT, see LICENSE for more details """ def debug(_msg): log("[>] {:s}".format(_msg)) def error(_msg): log("[-] {:s}".format(_msg))...
InfectedPacket/resyst
resyst/log.py
Python
gpl-2.0
462
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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...
EmanueleCannizzaro/scons
test/Java/JARCOM.py
Python
mit
2,195
import sublime, sublime_plugin import subprocess import os import json import datetime import threading import time from subprocess import Popen, PIPE, STDOUT FLOW_STATUS_BAR_KEY="flow_status_key" highlightedRegions = {} flowStatusRegions = [] flowRequestThreadCount = 0 class ProjectFlowStatusThread(threading.Thread)...
RobertElderSoftware/HappyCatSublimeFlow
HappyCatSublimeFlow.py
Python
mit
12,045
#!/usr/bin/env python # coding: utf-8 from django.core.urlresolvers import reverse from django.utils.safestring import mark_safe from django.utils.html import escape from django.template import Template, Context from table.utils import Accessor from .base import Column class LinkColumn(Column): def __init__(self...
arambadk/django-datatable
table/columns/linkcolumn.py
Python
mit
3,890
import requests import time import json # ------------ Do data need to roll def roll_data_if_needed(secondsAllowed): # calculate last time last_roll_time = get_status() now = int(time.time()) time_since_roll = now - last_roll_time # do I need to roll? if time_since_roll > secondsAllowed: ...
mrnohr/pi-temperature-firebase
firebase_log_roll.py
Python
mit
1,702
type(Key.ESC) exit(0)
silverbulleters/vanessa-behavoir
tools/Sikuli/TypeESC.sikuli/TypeESC.py
Python
apache-2.0
22
import _plotly_utils.basevalidators class ZerolinecolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="zerolinecolor", parent_name="layout.scene.zaxis", **kwargs ): super(ZerolinecolorValidator, self).__init__( plotly_name=plotly_name, ...
plotly/python-api
packages/python/plotly/plotly/validators/layout/scene/zaxis/_zerolinecolor.py
Python
mit
484
# -*- coding: utf-8 -*- # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for cros_mark_as_stable.py.""" from __future__ import print_function import os import sys import mock from c...
endlessm/chromium-browser
third_party/chromite/scripts/cros_mark_as_stable_unittest.py
Python
bsd-3-clause
16,033
#!/usr/bin/env python # shell script to collect the links visited on Google Chrome # by: Cody Kochmann import os, time def current_links(): try: chrome_link=os.popen("""osascript -e 'tell application "Google Chrome" to return URL of active tab of front window'""").read().split("\n")[0] return chro...
CodyKochmann/snippets
chrome_watcher.py
Python
mit
545
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
rackerlabs/swift
swift/common/middleware/keystoneauth.py
Python
apache-2.0
25,563
from django.contrib import admin from .models import Coupon class CouponAdmin(admin.ModelAdmin): list_display = ['code', 'valid_from', 'valid_to', 'discount', 'active'] list_filter = ['active', 'valid_from', 'valid_to'] search_field = ['code'] admin.site.register(Coupon, CouponAdmin)
spectrumone/online-shop-template
myshop/coupons/admin.py
Python
mit
320
""" Django settings for depressionassesment project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # ...
ammarkhann/FinalSeniorCode
src/depressionassesment/settings/base.py
Python
mit
4,159
"""Tests for entity permissions.""" import pytest import voluptuous as vol from homeassistant.auth.permissions.entities import ( compile_entities, ENTITY_POLICY_SCHEMA, ) from homeassistant.auth.permissions.models import PermissionLookup from homeassistant.helpers.entity_registry import RegistryEntry from home...
joopert/home-assistant
tests/auth/permissions/test_entities.py
Python
apache-2.0
7,198
#!/usr/bin/env python # Copyright 2011 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
AwesomeTurtle/personfinder
tools/pfif-tools/app/pfif_validator.py
Python
apache-2.0
41,885
import random import unittest from hearthbreaker.agents.basic_agents import DoNothingBot from tests.agents.testing_agents import SelfSpellTestingAgent, EnemySpellTestingAgent, MinionPlayingAgent, \ EnemyMinionSpellTestingAgent, SpellTestingAgent from hearthbreaker.constants import CHARACTER_CLASS from hearthbreake...
pieiscool/edited-hearthbreaker
tests/card_tests/druid_tests.py
Python
mit
32,165
#!/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 "Li...
guozhangwang/kafka
release.py
Python
apache-2.0
34,951
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from pip._vendor.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. ...
sonntagsgesicht/regtest
.aux/venv/lib/python3.9/site-packages/pip/_vendor/requests/exceptions.py
Python
apache-2.0
3,250
# -*- coding: utf-8 -*- # {{{ constants and imports import urwid try: import numpy HAVE_NUMPY = 1 except ImportError: HAVE_NUMPY = 0 from pudb.py3compat import PY3, execfile, raw_input, xrange, \ integer_types, string_types if PY3: ELLIPSIS = '…' else: ELLIPSIS = unicode('…', 'utf-8') f...
FedericoCeratto/debian-pudb
pudb/var_view.py
Python
mit
16,826
from readability.exceptions import ReadabilityException class Result: def __init__(self, score, grade_level): self.score = score self.grade_level = grade_level def __str__(self): return "score: {}, grade_level: '{}'". \ format(self.score, self.grade_level) class FleschKi...
cdimascio/py-readability-metrics
readability/scorers/flesch_kincaid.py
Python
mit
876
"""Create cosmetics table Revision ID: de55c5fc3c49 Revises: 906a48cc55d0 Create Date: 2017-05-30 19:51:29.692001 """ # revision identifiers, used by Alembic. revision = 'de55c5fc3c49' down_revision = '906a48cc55d0' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(...
TitanEmbeds/Titan
webapp/alembic/versions/de55c5fc3c49_create_cosmetics_table.py
Python
agpl-3.0
594
class authenticationError(Exception): def __init__(self, message): self.message = message
justin-ho/passwd-mng
authenticateException.py
Python
gpl-3.0
102
#!/usr/bin/python """ This file is part of the CINF Data Presentation Website Copyright (C) 2012 Robert Jensen, Thomas Andersen and Kenneth Nielsen The CINF Data Presentation Website 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 S...
CINF/DataPresentationWebsite
sym-files2/graphsettings.py
Python
gpl-3.0
3,133
# Rekall Memory Forensics # Copyright 2015 Google Inc. All Rights Reserved. # # 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 ver...
dsweet04/rekall
rekall-core/rekall/plugins/common/sigscan.py
Python
gpl-2.0
8,902
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ ('core', '0012_experiment_parent'), ] operations = [ migration...
niekas/dakis
dakis/core/migrations/0013_auto_20151104_1517.py
Python
agpl-3.0
776
""" downloaded from http://xbmc-addons.googlecode.com/svn/addons/ """ """ This is a modded version of the original addons.xml generator """ """ Put this version in the root folder of your repo and it will """ """ zip up all add-on folders, create a new zip in your zips folder """ """ and then update the md5 and addons...
kodiskills/supremebuildsrepo
_repo_xml_generator.py
Python
gpl-2.0
5,871
#!/usr/bin/env python3 ''' simile compiler ''' ''' by Richard A. Benson <eyedeeemm@gmail.com> ''' import sys, os import emit, out, util, fn, enums as e class s: ''' state ''' pass def init (t, long_len = 8): if t: s.line_n = 0 s.fn_cur = None if not emit.init (long_len): ...
eyedeeemm/simile
simile.py
Python
unlicense
6,021
# Copyright (C) 2016 Fan Long, Martin Rianrd and MIT CSAIL # Prophet # # This file is part of Prophet. # # Prophet 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 y...
jyi/ITSP
prophet-gpl/tools/lighttpd-test-copy.py
Python
mit
1,133
# pylint:disable=line-too-long import logging from ...sim_type import SimTypeFunction, SimTypeShort, SimTypeInt, SimTypeLong, SimTypeLongLong, SimTypeDouble, SimTypeFloat, SimTypePointer, SimTypeChar, SimStruct, SimTypeFixedSizeArray, SimTypeBottom, SimUnion, SimTypeBool from ...calling...
angr/angr
angr/procedures/definitions/win32_deviceaccess.py
Python
bsd-2-clause
1,030
''' @author: Vikram Udyawer @date: 19th March 2017 Sunday @summary: Bike Light On @description: Code for a Raspberry Pi to switch ON all LEDs of a bicycle light. ''' import RPi.GPIO as GPIO # Sets any warnings off GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) ...
witwiki/rasp-pi-iot
bike light/blight_on.py
Python
mit
528
# -*- coding: utf-8 -*- #------------------------------------------------------------ # beta.1 EPG FórmulaTV.com # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) #------------------------------------------------------------ # Gracias a la librería plugintools de Jesús (www.mimediacenter.info) #----------------...
iptvgratis/TUPLAY
resources/tools/epg_formulatv.py
Python
gpl-3.0
24,492
from luna import objects as obj from luna.stdlib import builtin from luna.vm import opcodes as ops class Frame(object): def __init__(self, code, consts, vars): self.code = code self.consts = consts self.vars = vars self.pc = 0 self.env = {} self.stack = [] def...
numerodix/luna
luna/vm/frame.py
Python
mit
1,716
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Eric6 Plugin Installer. This is the main Python script to install eric6 plugins from outside of the IDE. """ from __future__ import unicode_literals import Toolbox.PyQt4ImportHook # __IGNOR...
davy39/eric
eric6_plugininstall.py
Python
gpl-3.0
1,758
#!/usr/bin/python import os import unittest from time import sleep import json import re from selenium_test_manager import SeleniumTestManager from selenium.webdriver.support.ui import WebDriverWait class BaseSeleniumTest(unittest.TestCase): suite_is_setup = False suite_is_teared_down = False default_impl...
agramian/selenium-unittest
selenium_unittest/selenium_test_base.py
Python
mit
4,063
# Generated by Django 2.2.13 on 2020-11-19 20:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('openstack', '0016_securitygrouprule_remote_group'), ] operations = [ migrations.AlterField( model_name='securitygrouprule', ...
opennode/nodeconductor-assembly-waldur
src/waldur_openstack/openstack/migrations/0017_cidr_optional.py
Python
mit
433
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import asyncio import functools import logging import os import gunicorn.workers.base as base from aiohttp.wsgi import WSGIServerHttpProtocol class AiohttpWorker(base.Worker): def __in...
erikdejonge/microservicebase
whatsmyip/gunicorn/workers/_gaiohttp.py
Python
gpl-2.0
3,930
import FreeCAD,FreeCADGui FreeCAD.open(FreeCAD.getResourceDir()+"examples/RobotExample.FCStd") FreeCADGui.activeDocument().sendMsgToViews("ViewFit") FreeCADGui.activeDocument().sendMsgToViews("ViewAxo")
JonasThomas/free-cad
src/Mod/Start/StartPage/LoadRobotExample.py
Python
lgpl-2.1
207
#!/usr/bin/env python """Execute the tests for mason. The golden test outputs are generated by the script generate_outputs.sh. You have to give the root paths to the source and the binaries as arguments to the program. These are the paths to the directory that contains the 'projects' directory. Usage: run_tests.py...
bkahlert/seqan-research
raw/workshop12/workshop2012-data-20120906/trunk/core/apps/mason/tests/run_tests.py
Python
mit
21,168
import cv2 import numpy as np import Tkinter import time import socket host = 'xxx.xxx.xxx.xx' #ip address of computer where the surf program is run port = xxxx #random unused port s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.bind((host,port)) print "server started" MIN_MATCH_COUNT=10 ...
bijanbrahma/SARA
surfServer.py
Python
gpl-3.0
2,654
""" flask.ext.restless ~~~~~~~~~~~~~~~~~~ Flask-Restless is a `Flask <http://flask.pocoo.org>`_ extension which facilitates the creation of ReSTful JSON APIs. It is compatible with models which have been described using `SQLAlchemy <http://sqlalchemy.org>`_. :copyright:2011 by Lincoln de Sousa...
HellerCommaA/flask-angular
lib/python2.7/site-packages/flask_restless/__init__.py
Python
mit
740
import numpy as np from scipy.signal import medfilt import manager.operations.method as method from manager.operations.methodsteps.confirmation import Confirmation from manager.exceptions import VoltPyNotAllowed class MedianFilter(method.ProcessingMethod): can_be_applied = True _steps = [ { ...
efce/voltPy
manager/operations/methods/MedianFilter.py
Python
gpl-3.0
1,485
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sitemask.tests.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
mnesvold/sitemask
manage.py
Python
mit
257
#!/usr/bin/env python # # $Id: free.py 1508 2012-08-13 12:30:07Z g.rodola $ # # Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ A clone of 'free' cmdline utility. """ import psutil from psu...
sergecodd/FireFox-OS
B2G/gecko/python/psutil/examples/free.py
Python
apache-2.0
1,153
# 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 ...
CSCI1200Course/csci1200OnlineCourse
tests/functional/unit_header_footer.py
Python
apache-2.0
7,574
import talkey from gtts import gTTS import vlc import time import wave import contextlib class Speaker: def __init__(self): self.engine =talkey.Talkey() def say(self, text_to_say): self.engine.say(text_to_say) def google_say(self, text_to_say, fname="1.mp3"): tts = gTTS(text=text...
codebhendi/alfred-bot
speaker.py
Python
mit
490
# Generated by Django 2.0.7 on 2018-08-08 15:45 from django.db import migrations class Migration(migrations.Migration): dependencies = [("events", "0015_remove_event_start_date")] operations = [ migrations.RenameField(model_name="event", old_name="end_date", new_name="date") ]
ianastewart/cwltc-admin
events/migrations/0016_auto_20180808_1645.py
Python
mit
303
import logging from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template.base import TemplateDoesNotExist from django.template.loaders.filesystem import Loader as FilesystemLoader from django.template.loaders.app_directories import Loader as AppDirectoriesLoader from...
zhenzhai/edx-platform
common/djangoapps/edxmako/makoloader.py
Python
agpl-3.0
3,530
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE import io import json import unittest from datetime import date, datetime, time, timedelta from decimal import Decimal from enum import Enum from mimetypes import guess_type from unittest.mock import patch import pytz fro...
frappe/frappe
frappe/tests/test_utils.py
Python
mit
18,219
#!/usr/bin/env python # -*- coding: utf-8 -*- # tifffile.py # Copyright (c) 2008-2016, Christoph Gohlke # Copyright (c) 2008-2016, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
pratapvardhan/scikit-image
skimage/external/tifffile/tifffile.py
Python
bsd-3-clause
216,045
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
rvs/gpdb
src/test/tinc/tincrepo/mpp/lib/gprecoverseg.py
Python
apache-2.0
4,762
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='Compositor', version='1.0.1', description='Morphologically...
athuras/Compositor
setup.py
Python
mit
1,027
#!/usr/bin/env python2 import sys import json import struct import subprocess import shlex def getMessage(): rawLength = sys.stdin.read(4) if len(rawLength) == 0: sys.exit(0) messageLength = struct.unpack('@I', rawLength)[0] message = sys.stdin.read(messageLength) return json.loads(messag...
vayan/external-video
app/mpv.py
Python
mit
487
# 自然数Nをコマンドライン引数などの手段で受け取り, # 入力のファイルを行単位でN分割せよ.同様の処理をsplitコマンドで実現せよ. import sys N = int(sys.argv[1]) with open('hightemp.txt', 'r') as f: lines = f.readlines() nl = len(lines) q, r = divmod(nl, N) ind = 0 for i in range(r): ind += 1 print('Chunk{}:'.format(ind)) bs = q + 1 ...
yusekiya/nlp100_2015
Ch2/ex016.py
Python
gpl-3.0
650
# encoding: latin2 """AZP-SA """ __author__ = "Juan C. Duque" __credits__ = "Copyright (c) 2009-11 Juan C. Duque" __license__ = "GPL" __version__ = "1.0.0" __maintainer__ = "RiSE Group" __email__ = "contacto@rise-group.org" import numpy import time as tm from componentsAlg import AreaManager from componentsAlg import ...
tectronics/clusterpy
clusterpy/core/toolboxes/cluster/azpSa.py
Python
bsd-3-clause
7,716
import unittest import logging logging.getLogger().setLevel(logging.DEBUG) from ...tables.base import Base class TestCase(unittest.TestCase): def setUp(self): self.base = Base() def test_init(self): pass
LegionXI/pydarkstar
pydarkstar/tests/tables/test_base.py
Python
mit
230
############################################################################## # 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/xkill/package.py
Python
lgpl-2.1
1,891
#!/usr/bin/env python import argparse import collections import json import os import re import shutil import sys import tempfile def find_dict_by_key(doc, key): if key in doc and type(doc[key]) is collections.OrderedDict: return doc[key] for k in doc: if type(doc[k]) is collections.OrderedD...
credp/rt-app
doc/tune_json.py
Python
gpl-2.0
4,185
import orbit_mpi, types from orbit_mpi import * class printf: def __init__(self,f_name,title): self.f_name = f_name rank = orbit_mpi.MPI_Comm_rank(mpi_comm.MPI_COMM_WORLD) if (rank == 0): f_out = open(self.f_name,"w") for i in range(len(title)): f_o...
azukov/py-orbit
py/ext/las_str/print_mod.py
Python
mit
968
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
Glignos/inspire-next
tests/unit/utils/test_utils_export.py
Python
gpl-3.0
10,334
#!/usr/bin/env python import numpy as np import random from q1_softmax import softmax from q2_gradcheck import gradcheck_naive from q2_sigmoid import sigmoid, sigmoid_grad def normalizeRows(x): """ Row normalization function Implement a function that normalizes each row of a matrix to have unit length. ...
IAAAIAAIA/studyGroup
thomas/assignment1/q3_word2vec.py
Python
mit
7,945
# -*- coding: utf-8 -*- """ *************************************************************************** ogr2ogrbuffer.py --------------------- Date : Janaury 2015 Copyright : (C) 2015 by Giovanni Manghi Email : giovanni dot manghi at naturalgis dot pt *****...
pavlova-marina/QGIS
python/plugins/processing/algs/gdal/ogr2ogrbuffer.py
Python
gpl-2.0
5,110
#!/usr/bin/env python # Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
dpgoetz/swift
test/unit/proxy/controllers/test_obj.py
Python
apache-2.0
33,082
import os import time import urllib.request as urllib from urllib.error import URLError import socket EXCEPTIONS = (URLError, socket.timeout, ConnectionResetError) start_ts = time.time() expected_port = os.environ.get("MOTO_PORT", "5000") expected_host = "http://localhost:{}/".format(expected_port) print("Waiting f...
spulec/moto
scripts/ci_wait_for_server.py
Python
apache-2.0
611
import unittest import xml.etree.ElementTree as ET from iis.util.process import XMLProcess, DataType, ProcessNotFoundError from test_utils.base import BaseTestCase class TestXMLProcess(BaseTestCase): def setUp(self): xml_process_description = """ <processes> <process name="M-VORFFIP" id...
interactomix/iis
iis/tests/test_process.py
Python
agpl-3.0
2,672
#!/usr/bin/env python # # $File: IfElseFixed.py $ # # This file is part of simuPOP, a forward-time population genetics # simulation environment. Please visit http://simupop.sourceforge.net # for details. # # Copyright (C) 2004 - 2010 Bo Peng (bpeng@mdanderson.org) # # This program is free software: you can redistribut...
BoPeng/simuPOP
docs/IfElseFixed.py
Python
gpl-2.0
1,537
# -*- coding: utf-8 -*- from django.conf import settings as django_settings import pytz from dateutil import rrule from django.contrib.contenttypes import generic from django.db import models from django.db.models import Q from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import ...
saxix/django-scheduler
schedule/models/events.py
Python
bsd-3-clause
17,918
# -*- coding: utf-8 -*- # This file is part of INSPIRE. # Copyright (C) 2015 CERN. # # Invenio 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 v...
jalavik/inspire-next
inspire/testsuite/workflows/payload_model_fixture.py
Python
gpl-2.0
1,692
__author__ = 'kiruba' import pandas as pd import matplotlib.pyplot as plt import mpld3 as m from mpl_toolkits.mplot3d import axes3d, Axes3D from matplotlib import rc from scipy.interpolate import griddata import numpy as np from matplotlib import cm from matplotlib.path import * from matplotlib.collections import PolyC...
Kirubaharan/hydrology
ch_591/ch_591_stage_area.py
Python
gpl-3.0
18,373
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
datalogics/scons
test/up-to-date.py
Python
mit
2,194
import io import sys import threading import six from chainer.dataset import dataset_mixin class TextDataset(dataset_mixin.DatasetMixin): """Dataset of a line-oriented text file. This dataset reads each line of text file(s) on every call of the :meth:`__getitem__` operator. Positions of line bound...
okuta/chainer
chainer/datasets/text_dataset.py
Python
mit
6,272
from django.conf import settings import requests from mozillians.celery import app @app.task def celery_healthcheck(): """Ping healthchecks.io periodically to monitor celery/celerybeat health.""" response = requests.get(settings.HEALTHCHECKS_IO_URL) return response.status_code == requests.codes.ok
johngian/mozillians
mozillians/common/tasks.py
Python
bsd-3-clause
316
import datetime import re """Run the file to update the user_events.json file with more recent timestamp""" def update_events_timestamp(json_file): # Get the yesterday's date request_time = datetime.datetime.now() - datetime.timedelta(days=1) day = request_time.date().strftime("%Y-%m-%d") print(day) ...
googleapis/python-retail
samples/interactive-tutorials/events/setup_events/update_user_events_json.py
Python
apache-2.0
787
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** # ...
SKIRT/PTS
magic/config/list_ned.py
Python
agpl-3.0
973
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Election.complaint_period_ends_at' db.add_column('helios_election', 'complaint_period_ends...
pirati-cz/helios-server
helios/south_migrations/0005_add_quarantine_fields.py
Python
apache-2.0
11,330
import json import pytest from sovrin_client.test import waits from stp_core.loop.eventually import eventually from plenum.test.cli.helper import exitFromCli, \ createAndAssertNewKeyringCreation from sovrin_common.exceptions import InvalidConnectionException from sovrin_common.constants import ENDPOINT from plenu...
keenondrums/sovrin-node
sovrin_client/test/cli/test_tutorial.py
Python
apache-2.0
36,421
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to extract a catalog of Windows Registry keys and values.""" import argparse import logging import sys from dfwinreg import creg as dfwinreg_creg from dfwinreg import regf as dfwinreg_regf from dfwinreg import registry as dfwinreg_registry from winregrc import ...
libyal/winreg-kb
scripts/catalog.py
Python
apache-2.0
2,974
"""This file is useful only if 'salesforce' is a duplicit name in Django registry then put a string 'salesforce.apps.SalesforceDb' instead of simple 'salesforce' """ from django.apps import AppConfig class SalesforceDb(AppConfig): name = 'salesforce' label = 'salesforce_db'
django-salesforce/django-salesforce
salesforce/apps.py
Python
mit
286
# -*- coding: utf-8 -*- # ===================================================================== # write : moto # latest update : 18.01.27 # # usage : python unixtime.py # # ===================================================================== import datetime, time class UNIXTIME: def getCurrentUnixTime(self):...
motobyus/moto
util/datetime/unixtime.py
Python
mit
881
#! /usr/bin/env python import sys import PEAT_SA.Core as Core import Protool import itertools def getPathSequence(combinations): path = [] currentSet = set(combinations[0].split(',')) path.append(combinations[0]) for i in range(1, len(combinations)): newSet = set(combinations[i].split(',')) newElement = newSe...
dmnfarrell/peat
PEATSA/Tools/HIVTools/CombinationConverter.py
Python
mit
4,305