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
# # Example how to upload application to Testdroid Cloud before Appium test # import requests import base64 import os import json # update your apiKey value here or export it to your environment # and you app path if you want to upload your own app instead of demo app api_key = os.environ.get('TESTDROID_APIKEY') or "...
teppomalinen/testdroid-samples
appium/sample-scripts/python/upload.py
Python
apache-2.0
1,020
#!/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/scons-time/mem/tail.py
Python
mit
1,875
from MenuList import MenuList from Tools.Directories import SCOPE_ACTIVE_SKIN, resolveFilename from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont, getDesktop from Tools.LoadPixmap import LoadPixmap from Tools.Directories import fileExists import skin from os import path def ChoiceEntryComponent(key="...
OpenLD/enigma2-wetek
lib/python/Components/ChoiceList.py
Python
gpl-2.0
2,195
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license """Superdesk...
petrjasek/superdesk-server
superdesk/__init__.py
Python
agpl-3.0
3,012
from cinder.exception import * from cinder.i18n import _ class ProviderMultiVolumeError(CinderException): msg_fmt = _("volume %(volume_id)s More than one provider_volume are found") class ProviderMultiSnapshotError(CinderException): msg_fmt = _("snapshot %(snapshot_id)s More than one provider_snapshot are fo...
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry
volume/drivers/ec2/exception_ex.py
Python
apache-2.0
1,031
# # Copyright (C) 2013-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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...
fweik/espresso
testsuite/python/electrostaticInteractions.py
Python
gpl-3.0
8,644
# This module contains fancy actions that create new sprite objects that can # be drawn on the screen or blitted to another sprite. from . import sprites # This gives you a sprite that is a single character. def char(x,y,c,fg="w",bg="X",bold=False,invert=False,layer=0): report = sprites.Sprite(x,y,1,1,layer) ...
isharacomix/rules-of-war
code/graphics/draw.py
Python
gpl-3.0
1,658
# -*- coding: utf-8 -*- """The app module, containing the app factory function.""" from flask import Flask, render_template from flask_ical.settings import ProdConfig from flask_ical.assets import assets from flask_ical.extensions import ( bcrypt, cache, debug_toolbar, ) from flask_ical import public impor...
ad-m/flask-ical
flask_ical/app.py
Python
gpl-2.0
1,403
#from django.conf import settings NOTICE_FROM_ANONYMOUS = 1
anscii/django-modelnotice
modelnotice/default_settings.py
Python
bsd-2-clause
60
from Spacy_SVO import SVOSENT from ig import IGscrape import subprocess import pandas as pd import os import datetime svo_sent = SVOSENT() username = 'oliviamunn' test = IGscrape("m0oseg0ose", "Kasbah5432!") test.downloadAllMedia(username) filepath = os.getcwd()+'/'+username+'/'+username+'.json' metadata = pd.read_...
rsteed11/GAT
gat/scraping/Instagram/UserAnalyzer.py
Python
mit
1,797
# # German credit toy log pdf. # # This file is part of PINTS (https://github.com/pints-team/pints/) which is # released under the BSD 3-clause license. See accompanying LICENSE.md for # copyright notice and full license details. # import io import numpy as np import scipy import urllib.request from . import ToyLogPDF...
martinjrobins/hobo
pints/toy/_german_credit.py
Python
bsd-3-clause
4,298
import os basedir = os.path.abspath(os.path.dirname(__file__)) SQLALCHEMY_DATABASE_URI = 'mysql://user:password@localhost/Database_name' SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository') SQLALCHEMY_TRACK_MODIFICATIONS = False SECRET_KEY = 'dev-key' OAUTH = { 'facebook': { 'id': '<f...
disfear86/Restaurant-Menus
config.py
Python
mit
537
#from flask import Flask, request, Response import argparse import ConfigParser import flask import logging import os import shutil import sys import tempfile import time import senbonzakura.backend.core as core import senbonzakura.cache.cache as cache import senbonzakura.database.db as db import senbonzakura.backend....
ffledgling/Senbonzakura
senbonzakura/frontend/api.py
Python
mpl-2.0
10,807
# -*- coding: utf-8 -*- ''' lucterios.contacts package @author: Laurent GAY @organization: sd-libre.fr @contact: info@sd-libre.fr @copyright: 2015 sd-libre.fr @license: This file is part of Lucterios. Lucterios is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Licens...
Lucterios2/documents
lucterios/documents/editors.py
Python
gpl-3.0
4,320
from mash_health import app, cache from flask import render_template from mash_health.models import Healthcare from mash_health.forms import Search, SERVICES from flask_wtf.csrf import CSRFError healthcare = Healthcare() @app.route('/', methods=["GET", "POST"]) def index(): form = Search() if form.validate_o...
MashSoftware/health
mash_health/views.py
Python
mit
1,860
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-04-06 11:07 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('bus', '0013_auto_20170331_2339'), ] operations = [ migrations.DeleteModel( ...
warlock57/bus_reservation
bus/migrations/0014_auto_20170406_1107.py
Python
mit
443
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
PaddlePaddle/Paddle
tools/parallel_UT_rule.py
Python
apache-2.0
101,414
from litex.soc.tools.remote import RemoteClient wb = RemoteClient("192.168.1.50", 1234, csr_data_width=8) wb.open() regs = wb.regs # # # print("temperature: %f°C" %(regs.xadc_temperature.read()*503.975/4096 - 273.15)) print("vccint: %fV" %(regs.xadc_vccint.read()/4096*3)) print("vccaux: %fV" %(regs.xadc_vccaux.read(...
mithro/HDMI2USB-litex-firmware
test/test_xadc.py
Python
bsd-2-clause
408
def getExtension(filename): # To lowercase filename = filename.lower() # Try to find the index of the last dot indexLastDot = filename.rfind(".") # If it was not found, return a dummy value if indexLastDot == -1: return "NOTFOUND" return filename[indexLastDot+1:] # Number of elements which make up the associa...
AntoineAugusti/katas
codingame/easy/file_extension.py
Python
mit
771
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test block processing.""" import copy import struct import time from test_framework.blocktools import ...
Kogser/bitcoin
test/functional/feature_block.py
Python
mit
61,564
# -*- coding: utf-8 -*- """The main validator class.""" from __future__ import unicode_literals import errno import fnmatch import logging import os import re import subprocess import sys import vnujar LOGGER = logging.getLogger(__name__) DEFAULT_IGNORE_RE = [ r'\APicked up _JAVA_OPTIONS:.*', r'\ADocument c...
svenkreiss/html5validator
html5validator/validator.py
Python
mit
5,729
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # # FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier # Distributed under the terms of the new BSD license. # # ----------------------------------------------------------------------------- ""...
bitforks/freetype-py
freetype/ft_enums/ft_face_flags.py
Python
bsd-3-clause
4,854
""" Implementation of an auto-balanced binary tree! For doctests run following command: python3 -m doctest -v avl_tree.py For testing run: python avl_tree.py """ from __future__ import annotations import math import random from typing import Any class my_queue: def __init__(self) -> None: self.data: list...
TheAlgorithms/Python
data_structures/binary_tree/avl_tree.py
Python
mit
9,677
"""Generalized extreme value distribution.""" import numpy from scipy import special from ..baseclass import SimpleDistribution, ShiftScaleDistribution class generalized_extreme(SimpleDistribution): """Generalized extreme value distribution.""" def __init__(self, c=1): super(generalized_extreme, sel...
jonathf/chaospy
chaospy/distributions/collection/generalized_extreme.py
Python
mit
2,517
from protocols.forms import forms class SplitForm(forms.VerbForm): name = "Split" slug = "split" edit_what_remark = forms.CharField() duration_min_time = forms.IntegerField() min_temp = forms.IntegerField() max_temp = forms.IntegerField() edit_remarks = forms.CharField() add_with_wha...
Bionetbook/bionetbook
bnbapp/protocols/forms/verbs/split.py
Python
mit
342
"""This module provides REST services for Scenario""" import cherrypy from LmCommon.common.lmconstants import HTTPStatus from LmWebServer.common.lmconstants import HTTPMethod from LmWebServer.services.api.v2.base import LmService from LmWebServer.services.common.access_control import check_user_permission from LmWebSe...
lifemapper/core
LmWebServer/services/api/v2/scenario.py
Python
gpl-3.0
3,521
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
3dfxsoftware/cbss-addons
invoice_report_multicompany/report/account_print_invoice.py
Python
gpl-2.0
1,805
from __future__ import print_function, unicode_literals import json from wee_slack import SlackTS def test_process_message(realish_eventrouter, team, user_alice): messages = [] messages.append(json.loads(open('_pytest/data/websocket/1485975421.33-message.json', 'r').read())) # test message and then cha...
trygveaa/wee-slack
_pytest/test_process_message.py
Python
mit
2,348
print("init top called")
andreashuebner/sqltester
__init__.py
Python
mit
24
import time as _time from datetime import timedelta, tzinfo STDOFFSET = timedelta(seconds = -_time.timezone) if _time.daylight: DSTOFFSET = timedelta(seconds = -_time.altzone) else: DSTOFFSET = STDOFFSET DSTDIFF = DSTOFFSET - STDOFFSET ZERO = timedelta(0) class LocalTimezone(tzinfo): def utcoffset(self...
shimon/dayhacker
localtimezone.py
Python
gpl-3.0
1,081
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2022, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
mrcslws/nupic.research
projects/dqn/main/data_utils.py
Python
agpl-3.0
4,131
#!/usr/bin/env python from setuptools import setup, find_packages NAME = 'python-instagram' VERSION = '1.3.2.7' REQUIREMENTS = [ 'simplejson', 'httplib2', 'six' ] setup( name=NAME, version=VERSION, description='Instagram API client', license='MIT', install_requires=REQUIREMENTS, ...
sociateru/python-instagram
setup.py
Python
bsd-3-clause
527
# -*- coding: utf-8 -*- import locale import time import urllib import json import urlparse import bleach import jinja2 from django.utils.text import Truncator from django.db.utils import IntegrityError from django.contrib.sites.models import RequestSite from django.utils.safestring import mark_safe from django.util...
tannishk/airmozilla
airmozilla/main/helpers.py
Python
bsd-3-clause
7,329
from threading import Thread import os import sys import array import Queue import threading import time import logging import logging.config import Defines from SQLEng import SQLEng from ComAlg import codec from SchemaReader import AppReader from SchemaReader import FormReader from GammuSender import PduSender class ...
lubao/UjU_Windows
src/Core.py
Python
mit
14,335
# The feeling is this needs to be part of the ingredient, not the recipe # not used currently, maybe integrate it in some way with the data returned by MSinfo? def zap(filepath): import os #, exception ## if filepath == '/' or filepath == '~/': ## raise Exception ## else: ## for root, dirs, files in...
kernsuite-debian/lofar
CEP/Pipeline/framework/lofarpipe/cuisine/files.py
Python
gpl-3.0
744
#!/usr/bin/env python # """ A script to check some properties on DotHill controllers. Developed targeting the Dot Hill AssuredSAN 4730 controller, Version: CF100R038-02. The script accepts in input a configuration file where - a user/password pair is needed to authenticate on the controller - a list of management IP...
gc3-uzh-ch/nagios-plugins
lustre/check_dothill_ctrl.py
Python
gpl-2.0
8,110
# -*- encoding: utf-8 -*- """Test class for Architecture CLI :Requirement: Architecture :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: CLI :TestType: Functional :CaseImportance: High :Upstream: No """ from robottelo.cli.architecture import Architecture from robottelo.cli.base import CLIReturn...
elyezer/robottelo
tests/foreman/cli/test_architecture.py
Python
gpl-3.0
4,588
#****************************************************************************** # * # * ** * * * * * # * * * * * * * * * * ...
sanguinariojoe/aquagpusph
examples/3D/spheric_testcase2_dambreak_mpi/cMake/plot_h.py
Python
gpl-3.0
4,882
from __future__ import absolute_import import six from rest_framework.response import Response from sentry.app import tsdb from sentry.api.base import EnvironmentMixin, StatsMixin from sentry.api.bases.project import ProjectEndpoint from sentry.api.exceptions import ResourceDoesNotExist from sentry.models import Env...
mvaled/sentry
src/sentry/api/endpoints/project_group_stats.py
Python
bsd-3-clause
1,166
from django.utils.functional import cached_property from mptt.utils import get_cached_trees class ProjectWrapper(object): def __init__(self, project, snapshot=None): self._project = project self._snapshot = snapshot def __str__(self): return str(self._project.title) @property ...
DMPwerkzeug/DMPwerkzeug
rdmo/views/utils.py
Python
apache-2.0
1,481
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from hq.tests.util import create_user_and_domain from domain.models import Domain from graphing.models import * class ViewsTestCase(TestCase): def setUp(self): create_user_and...
commtrack/temp-aquatest
apps/graphing/tests/views.py
Python
bsd-3-clause
2,131
# Copyright 2016 Mirantis 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...
ChameleonCloud/horizon
openstack_dashboard/contrib/developer/profiler/api.py
Python
apache-2.0
4,781
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013 Contributor # # 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 t...
stdweird/aquilon
lib/python2.6/aquilon/worker/commands/add_parameter_definition_feature.py
Python
apache-2.0
2,266
# =========================================================================== # eXe config # Copyright 2004-2006, University of Auckland # # 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 ...
exelearning/iteexe
exe/engine/locales.py
Python
gpl-2.0
2,690
import re from mrjob.job import MRJob from math import log def tsv_model_to_dict(file): results = {} with open(file, "r") as model: for line in model: term, ham, spam = line.strip().split("\t") results[term] = (float(ham), float(spam)) return results class NBPredict(M...
JasonSanchez/w261
week2/NBPredict.py
Python
mit
1,580
# -*- coding: utf-8 -*- # # Tuxemon # Copyright (c) 2014-2017 William Edwards <shadowapex@gmail.com>, # Benjamin Bean <superman2k5@gmail.com> # # This file is part of Tuxemon # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
treetrnk/Tuxemon
tuxemon/core/components/event/conditions/player_facing_npc.py
Python
gpl-3.0
3,493
import logging from twisted.internet import defer, protocol, reactor from twisted.web import client, http, http_headers from twisted.web.iweb import IBodyProducer from zope.interface import implements from libsaas import port from libsaas import http as our_http from . import base __all__ = ['TwistedExecutor'] lo...
ducksboard/libsaas
libsaas/executors/twisted_executor.py
Python
mit
4,554
import platform class OSCollector(object): def __init__(self, docker_client=None): self.docker_client = docker_client def key_name(self): return "osInfo" def _zip_fields_values(self, keys, values): data = {} for key, value in zip(keys, values): if len(value) >...
dx9/python-agent
cattle/plugins/host_info/os_c.py
Python
apache-2.0
1,411
from pwn import * from pwn.blocks import * b = Block([1,2,3]) foo = (42, b << name('foo'), sizeof('foo')) << name('bar') print repr(flat(foo)) print len(flat(foo)) print len(foo)
Haabb/pwnfork
pwn/test/blocktest.py
Python
mit
180
from elasticsearch import Elasticsearch import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from matplotlib.dates import AutoDateLocator, AutoDateFormatter import numpy as np import datetime as dt import math import json import pprint with open("config", "r+") as txt: contents = li...
robogen/CMS-Mining
RunScripts/es_core.py
Python
mit
4,895
# -*- coding: utf-8 -*- from djangosige.tests.test_case import BaseTestCase, replace_none_values_in_dictionary from djangosige.apps.financeiro.models import MovimentoCaixa, Entrada, Saida, PlanoContasGrupo, PlanoContasSubgrupo from djangosige.apps.estoque.models import SaidaEstoque from django.urls import reverse fro...
thiagopena/djangoSIGE
djangosige/tests/financeiro/test_views.py
Python
mit
42,676
""" Test exposing incoming <hold/>, <ringing/> and <active/> notifications via the CallState interface. """ from twisted.words.xish import xpath from gabbletest import make_result_iq from servicetest import ( wrap_channel, make_channel_proxy, EventPattern, sync_dbus) import ns import constants as cs from jinglet...
community-ssu/telepathy-gabble
tests/twisted/jingle/call-state.py
Python
lgpl-2.1
11,183
# 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...
nburn42/tensorflow
tensorflow/contrib/linear_optimizer/python/kernel_tests/sdca_ops_test.py
Python
apache-2.0
47,658
from numpy.random import random from bokeh.models.markers import marker_types from bokeh.plotting import figure, output_file, show p = figure(title="Bokeh Markers", toolbar_location=None, output_backend="webgl") p.grid.grid_line_color = None p.background_fill_color = "#eeeeee" p.axis.visible = False p.y_range.flipped...
ericmjl/bokeh
examples/plotting/file/markers.py
Python
bsd-3-clause
768
# python-pgp A Python OpenPGP implementation # Copyright (C) 2014 Richard Mitchell # # 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 la...
omar-AM/python-pgp
pgp/message.py
Python
gpl-3.0
27,884
from django.conf.urls import patterns, include, url from django.contrib import admin from counter.api import router admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'tdc.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^', include(admin.site.urls)), ...
tdf/tdc
tdc/urls.py
Python
gpl-3.0
489
# -*- coding: utf-8 -*- ################################################################################# # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr> # # This program is free software: you can redistribute it and/or modify # it under th...
StefanRijnhart/stock-logistics-warehouse
__unported__/stock_inventory_extended/__openerp__.py
Python
agpl-3.0
1,688
"""Application base class for displaying data about a single object. """ import abc import itertools import logging from .display import DisplayCommandBase LOG = logging.getLogger(__name__) class ShowOne(DisplayCommandBase): """Command base class for displaying data about a single object. """ __metacla...
citrix-openstack-build/cliff
cliff/show.py
Python
apache-2.0
1,635
#!/usr/bin/env python # -*- coding: UTF-8 -*- """JabberHooky""" __name__ = "jabberhooky" __author__ = 'Shane R. Spencer' __email__ = "shane@bogomip.com" __license__ = 'MIT' __copyright__ = '2012 Shane R. Spencer' __version__ = '0.0.1' __status__ = "Prototype"
whardier/jabberhooky
jabberhooky/__init__.py
Python
mit
263
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 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...
egabancho/invenio-knowledge
invenio_knowledge/admin.py
Python
gpl-2.0
6,695
"""Add export with release column Revision ID: ee0d67b4e552 Revises: c5b6185beb4c Create Date: 2018-01-13 11:13:22.722140 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'ee0d67b4e552' down_revision = 'c5b6185beb4c' branch_labels = None depends_on = None def u...
InQuest/ThreatKB
migrations/versions/ee0d67b4e552_add_export_with_release_column.py
Python
gpl-2.0
699
#!/usr/bin/env python3 """Creates training data for the BERT network training (noisified + masked gold predictions) using the input corpus. The masked Gold predictions use Neural Monkey's PAD_TOKEN to indicate tokens that should not be classified during training. We only leave `coverage` percent of symbols for classi...
ufal/neuralmonkey
scripts/preprocess_bert.py
Python
bsd-3-clause
3,940
#!/usr/bin/python """ This file was created just to test the git merge feature. """ print "hello"
melphick/pynet
week1/merge_example.py
Python
apache-2.0
99
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import pytest from spack.main import SpackCommand audit = SpackCommand('audit') @pytest.mark.parametrize('pkgs,expected...
LLNL/spack
lib/spack/spack/test/cmd/audit.py
Python
lgpl-2.1
1,926
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Huawei Technologies Co.,LTD. # 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://w...
eltonkevani/tempest_el_env
tempest/api/compute/admin/test_hypervisor_negative.py
Python
apache-2.0
4,845
#!/usr/bin/env python # # Copyright 2016 Planet Labs # # 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 ...
bcwaldon/klondike
roles/configure/files/ec2-inventory.py
Python
apache-2.0
58,586
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google-research/adamatch
ablation/adamatch_distalign_remixmatch.py
Python
apache-2.0
8,879
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.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 version 3 of the License, or # (at your option) any later vers...
gigitux/lollypop
src/pop_next.py
Python
gpl-3.0
2,854
import collections class IgnoreList(object): def __init__(self): self._ignored_users = collections.defaultdict(list) def ignore(self, user, ignored): if ignored not in self._ignored_users[user]: self._ignored_users[user].append(ignored) def unignore(self, user, ignored): ...
kiwicom/iwant-bot
src/iwant_bot/ignore.py
Python
mit
1,431
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the REST API.""" import binascii from decimal import Decimal from enum import Enum from io import...
qtumproject/qtum
test/functional/interface_rest.py
Python
mit
14,996
# OpenFace training tests. # # Copyright 2015-2016 Carnegie Mellon University # # 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 req...
francisleunggie/openface
tests/openface_neural_net_training_tests.py
Python
apache-2.0
3,071
# Main application flow from flask import Flask, request, redirect from models import Base, User, Job from flask_sqlalchemy import SQLAlchemy import twilio.twiml import re import datetime from list import list from sendMessage import sendMessage app = Flask(__name__ app.config['SQLALCHEMY_DATABASE_URI'] = '' db = SQL...
mhauss/Rural-Goods
run.py
Python
gpl-2.0
11,095
from setuptools import setup setup( name='pusher', version='0.6', description='A Python library for sending messages to Pusher', author='Pusher', author_email='support@pusher.com', url='http://pusher.com', packages=['pusher'], classifiers=[ "License :: OSI Approved :: MIT Licens...
stewgeo/fmepedia-data-upload-validation-display
pythonLibraries/pusher-pusher_client_python-7ca4f05/setup.py
Python
mit
628
# Copyright 2015 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, ...
axbaretto/beam
sdks/python/.tox/py27gcp/lib/python2.7/site-packages/unit_tests/test_dataset.py
Python
apache-2.0
33,045
"""Collection of pyramid renderers used by Data Dealer""" from pyramid.renderers import JSON from bson.json_util import dumps DDJSONRenderer = JSON(serializer=dumps) """pyramid.renderers.JSON using bson.json_util for serialization""" #DDJSONRenderer.add_adapter(datetime.datetime, lambda v, r: v.isoformat())
datadealer/dd_app
dd_app/render.py
Python
artistic-2.0
311
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.auth.models import django.utils.timezone from django.conf import settings import django.core.validators class Migration(migrations.Migration): dependencies = [ ('auth', '0006_re...
csunny/blog_project
source/apps/blog/migrations/0001_initial.py
Python
mit
9,844
""" Algorithm: starting number of schedules places all of these in a pq do batches of randomizations of schedules, rescore in each randomization of a schedule generate more schedules, each in a varying level of randomization put them all back along with the original, unchanged schedule randomization ...
mboutell/catapult-lecture-scheduler
Scheduler/Main.py
Python
mit
7,416
# -*- coding: utf-8 -*- from __future__ import absolute_import from .debugging import ( debugging_database_task, ) from .rest import * from .pubsub import * from .scanning import * from .smtp import ( email_order_user_for_order_completion, email_org_users_for_order_completion, send_emails_for_org_u...
lavalamp-/ws-backend-community
tasknode/tasks/__init__.py
Python
gpl-3.0
401
# given there's exactly one destination city, just find one that appears in the list but never first in a pair class Solution: def destCity(self, paths: List[List[str]]) -> str: not_destination = set() # cities with outgoing paths destination_candidate = set() for from_city, to_city in paths...
SelvorWhim/competitive
LeetCode/DestinationCity.py
Python
unlicense
604
# -*- coding: utf-8 -*- # # Copyright (C) 2015 European Synchrotron Radiation Facility, Grenoble, France # # Principal author: Wout De Nolf (wout.de_nolf@esrf.eu) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software")...
woutdenolf/wdncrunch
wdncrunch/tests/test_all.py
Python
mit
1,749
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
Micronaet/micronaet-docnaet
docnaet_reassign_country/__init__.py
Python
agpl-3.0
1,053
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 requir...
mrunge/openstack_horizon
openstack_horizon/dashboards/identity/groups/tables.py
Python
apache-2.0
8,157
from django.test import TestCase from django.contrib.auth.models import User from django.urls import reverse class RegisterTestCase(TestCase): def setUp(self): self.url = reverse("accounts:register") def test_register_view(self): response = self.client.get(self.url) self.assertEqual(r...
mathuin/pyment
django/accounts/tests.py
Python
mit
3,131
"""visarequirements URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')...
MikeOrange/visa-requirements
visarequirements/urls.py
Python
mit
835
from .dispense_label import DispenseLabel from .dispense_label_context import DispenseLabelContext
botswana-harvard/edc-pharma
edc_pharmacy/old/dispense/labels/__init__.py
Python
gpl-2.0
99
# Copyright (c) 2009-2011 Alistek Ltd (http://www.alistek.com) All Rights Reserved. # General contacts <info@alistek.com> from openerp.tools import config, ustr fontsize = 15 """ This class generate EAN bar code, it required PIL (python imaging library) installed. If the code has not checksum (12 ...
frouty/odoogoeen
extra-addons/aeroo/report_aeroo/barcode/EANBarCode.py
Python
agpl-3.0
5,302
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
adrianschroeter/kiwi
kiwi/tasks/system_build.py
Python
gpl-3.0
9,706
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import unitt...
akintolga/superdesk-aap
server/aap/macros/currency_aud_to_nzd_test.py
Python
agpl-3.0
3,013
from django.http import Http404, HttpResponse from django.utils.translation import gettext_lazy as _ from django.views.generic import DetailView, ListView from honeypot.decorators import check_honeypot from ..forms import CommentForm from ..models import Category, Comment from ..utils import Redirect from .base impo...
bkfox/aircox
aircox/views/page.py
Python
gpl-3.0
5,235
from tests.integration.create_token import create_token from tests.integration.integration_test_case import IntegrationTestCase class TestHappyPath(IntegrationTestCase): def test_try_date_203(self): self.try_date('0203', '1') def test_try_another_data_203(self): self.try_another_date('0203',...
qateam123/eq
tests/integration/mci/test_dates_in_questions.py
Python
mit
3,212
from datetime import timedelta from typing import Any, Dict, Union import orjson from django.contrib.auth.password_validation import validate_password from django.utils.timezone import now as timezone_now from analytics.models import StreamCount from zerver.lib.actions import ( bulk_add_subscriptions, bulk_re...
punchagan/zulip
zerver/tests/test_audit_log.py
Python
apache-2.0
25,145
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): if db.dry_run: return count = orm.SubtitleLanguage.objects.count() i = 0 for ...
ofer43211/unisubs
apps/videos/migrations/0101_fix_subtitle_language_is_complete.py
Python
agpl-3.0
18,220
#!/usr/bin/env python # -*- coding: utf-8 -*- #--- #--- Python import sys import StringIO import argparse #--- #--- 3rd party from redmine import Redmine from redmine import exceptions as redmine_exceptions #--- class ProjectTree(object) : def __init__(self, allProjects ) : self._projects = list(allProje...
uni-halle/python-redmine-tools
topic_index.py
Python
apache-2.0
11,227
"""The tests for the Alexa component.""" # pylint: disable=protected-access import asyncio import json import pytest from homeassistant.core import callback from homeassistant.setup import async_setup_component from homeassistant.components import alexa from homeassistant.components.alexa import intent SESSION_ID = ...
persandstrom/home-assistant
tests/components/alexa/test_intent.py
Python
apache-2.0
20,670
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_textbox10.py
Python
bsd-2-clause
1,032
# 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...
keras-team/keras
keras/layers/rnn/simple_rnn_test.py
Python
apache-2.0
7,947
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ...worksheet import Worksheet class TestWriteSheetData(unittest.TestCase): """ Test...
ivmech/iviny-scope
lib/xlsxwriter/test/worksheet/test_write_sheet_data.py
Python
gpl-3.0
792
from .base import BaseCommand class SuggestCommand(BaseCommand): command_name = "elasticsearch:suggest" def run_request(self): options = dict( index=self.settings.index, body=self.get_text(), ignore=[404] ) return self.client.suggest(**options)
KunihikoKido/sublime-elasticsearch-client
commands/suggest.py
Python
mit
317
"""Utilities to evaluate models with respect to a variable """ # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import warnings import numpy as np from .base import is_classifier, clone from .cross_validation import check_cv from .externals.joblib import Parallel, delayed fro...
vermouthmjl/scikit-learn
sklearn/learning_curve.py
Python
bsd-3-clause
14,601
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 import re import os import sys import whipper # twisted's unittests have skip support, standard unittest don't from twisted.trial import unittest # lifted from flumotion def _diff(old, new, desc): import difflib lines = difflib.unified_diff(old, new) l...
JoeLametta/morituri
whipper/test/common.py
Python
gpl-3.0
2,525