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
from dockerrotate.images import normalize_tag_name def test_normalize_tag_name(): assert normalize_tag_name('some.domain.com/organization/image:tag') == 'organization/image' assert normalize_tag_name('organization/image:tag') == 'organization/image' assert normalize_tag_name('image:tag') == 'image'
locationlabs/docker-rotate
tests/test_normalize.py
Python
apache-2.0
314
# -*- coding: utf-8 -*- """ pgp_import command Import keys and signatures from a given GPG keyring. Usage: ./manage.py pgp_import <keyring_path> """ from collections import namedtuple, OrderedDict from datetime import datetime import logging from pytz import utc import subprocess import sys from django.core.managem...
brain0/archweb
devel/management/commands/pgp_import.py
Python
gpl-2.0
8,172
from llt.utils import get_key_by_value SAMPLE = ( ('a', 'apple'), ('b', 'boy'), ) if __name__ == '__main__': assert get_key_by_value(SAMPLE, 'apple') == 'a' assert get_key_by_value(SAMPLE, 'boy') == 'b'
jian-en/luojilab_toolbox
tests.py
Python
apache-2.0
222
# Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
googleapis/python-security-private-ca
samples/snippets/test_subordinate_ca.py
Python
apache-2.0
3,171
#!/usr/bin/env python3 ## Copyright (c) MIT. All rights reserved. ## lux (vjlux@gmx.at) 2016 ############################################################ # Imports ############################################################ import logging ############################################################ # Globals #####...
vjlux/luxlib
LuxSynth/LuxSynth/LuxImage.py
Python
mit
622
import numpy [N, M, P] = list(map(int, input().split())) ns = [numpy.array(input().split(), int) for _ in range(0, N)] ms = [numpy.array(input().split(), int) for _ in range(0, M)] print(numpy.concatenate((ns, ms)))
alexander-matsievsky/HackerRank
All_Domains/Python/Numpy/np-concatenate.py
Python
mit
217
""" Authentication is implemented using flask_login and different environments can implement their own login mechanisms by providing an `airflow_login` module in their PYTHONPATH. airflow_login should be based off the `airflow.www.login` """ from builtins import object __version__ = "1.5.0" import logging import os im...
jampp/airflow
airflow/__init__.py
Python
apache-2.0
1,251
from __future__ import print_function import sys import string import numbers import functools import unicodedata STRIP_CHARS = string.whitespace + string.punctuation BOOL_STRINGS = {} BOOL_STRINGS.update( (s, True) for s in ( "true", "yes", "on", "yeah", "yup", ...
judy2k/ish
ish.py
Python
unlicense
3,130
# vim:fileencoding=utf-8 import os import vim import socket import struct FCITX_STATUS = struct.pack('i', 0) FCITX_OPEN = struct.pack('i', 1 | (1 << 16)) FCITX_CLOSE = struct.pack('i', 1) INT_SIZE = struct.calcsize('i') fcitxsocketfile = vim.eval('s:fcitxsocketfile') def fcitxtalk(command=None): sock = socke...
JackyRen/vimrc
plugin/fcitx.py
Python
mit
1,360
########################################################################## # Author: Jane Curry, jane.curry@skills-1st.co.uk # Date: March 7th, 2011 # Revised: Extra debugging added Aug 23, 2011 # # JuniperIpSecNAT modeler plugin # NATs will only be populated on SRX devices # # This prog...
jcurry/ZenPacks.ZenSystems.Juniper
ZenPacks/ZenSystems/Juniper/modeler/plugins/JuniperIpSecNATMap.py
Python
gpl-2.0
3,026
from GithubRep import GithubRep import unittest class GithubRepTests(unittest.TestCase): def test_constructor_usual(self): init_line = " - [Algorithms](https://github.com/tayllan/awesome-algorithms)" github_rep = GithubRep(init_line) self.assertEquals("https://github.com/tayllan/awesome-...
EvilKhaosKat/awesome-awesomeness_backuper
tests/GithubRepTests.py
Python
apache-2.0
865
""" Common test utilities for courseware functionality """ from abc import ABCMeta, abstractmethod from datetime import datetime import ddt from mock import patch from urllib import urlencode from lms.djangoapps.courseware.url_helpers import get_redirect_url from student.tests.factories import AdminFactory, UserFacto...
rismalrv/edx-platform
lms/djangoapps/courseware/testutils.py
Python
agpl-3.0
7,642
import sys import os import warnings import ruamel.yaml as yaml from fnmatch import fnmatch __author__ = "Pymatgen Development Team" __email__ ="pymatgen@googlegroups.com" __maintainer__ = "Shyue Ping Ong" __maintainer_email__ ="shyuep@gmail.com" __version__ = "2019.7.2" SETTINGS_FILE = os.path.join(os.path.expandu...
blondegeek/pymatgen
pymatgen/__init__.py
Python
mit
3,203
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import scrub_urls class DocType(): def __init__(self, doc, doclist=[]): self.doc = doc self.doclist = doclist def get_parent_bean(...
saurabh6790/omni-libs
core/doctype/communication/communication.py
Python
mit
5,477
#!/usr/bin/python """ ansible module for managing configuration resources on BIG-IP over iControlREST. """ import sys import json import requests from copy import deepcopy from requests.exceptions import ConnectionError, HTTPError, Timeout, TooManyRedirects class CloudFormationState(object): def __init__(self, mo...
F5Networks/aws-deployments
roles/infra/library/cloudformation_state.py
Python
mit
2,694
# 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 # distributed under the Li...
dstufft/warehouse
warehouse/migrations/versions/29d87a24d79e_cascade_project_deletion_to_release.py
Python
apache-2.0
1,308
def resultTemplate(playerStrength, enemyStrength, result): if result == True: msg = "wins" else: msg = "loses" return """ Player strength: {} Enemy strength: {} Player {}! """.format(playerStrength, enemyStrength, msg) print resultTemplate(1,2,False)
bomin2406-cmis/bomin2406-cmis-cs2
resultTemplate.py
Python
cc0-1.0
281
import chunk from . import CHUNKTYPE_SIZE, CHUNKHEADER_SIZE from .chunk import RiffChunk, ListChunk, FinalChunk from .data import Data class ChunkReader(object): def __init__(self, bigendian=False): self.bigendian = bigendian def read_riff(self, filename): """ Read a RIFF file and put it in...
Gazolik/riffPy
riffPy/riff/reader.py
Python
gpl-3.0
2,155
from Two_stage_stochastic_optimization import *
Matrixeigs/Optimization
Two_stage_stochastic_optimization/power_flow_modelling/__init__.py
Python
mit
48
from django.core.cache import cache from corehq.apps.export.esaccessors import get_case_name from corehq.apps.users.util import cached_user_id_to_username, cached_owner_id_to_display """ Module for transforms used in exports. """ def user_id_to_username(user_id, doc): return cached_user_id_to_username(user_id) ...
qedsoftware/commcare-hq
corehq/apps/export/transforms.py
Python
bsd-3-clause
876
# Copyright 2015 Intel Corporation # # 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 wri...
IntelLabsEurope/infrastructure-repository
api/occi_epa/backends/epa_backends.py
Python
apache-2.0
4,278
from execute import execWithCapture, execWithCaptureErrorStatus, execWithCaptureStatus def follow_links_to_target(path, paths=[]): o, s = execWithCaptureStatus('/bin/ls', ['/bin/ls', '-l', path]) if s == 0: words = o.strip().split() if words[0][0] == 'l': target = words[len(words)...
andyvand/cygsystem-config-llvm
src/utilities.py
Python
gpl-2.0
484
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'License' db.create_table(u'thirdparty_license', ( ...
caustin/tracker
thirdparty/migrations/0001_initial.py
Python
mit
2,968
# -*- coding: utf-8 -*- # Copyright (C) 2012 Sebastian Wiesner <lunaryorn@gmail.com> # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 2.1 of the License, or (at your # opti...
pyudev/pyudev
tests/plugins/mock_libudev.py
Python
lgpl-2.1
3,518
#!/usr/bin/env python import json from string import ascii_lowercase class ScalaBuilder: # add any macro processing methods to this file. they will automatically be called if referenced in the processed file # i.e if a method foo is defined, it will be called if (*foo*) appears in the processed file # for passing ...
goodlyrottenapple/calculus-toolbox
tools/scalabuilder.py
Python
mit
32,016
# -*- coding: utf-8 -*- """ This module offers timezone implementations subclassing the abstract :py:class:`datetime.tzinfo` type. There are classes to handle tzfile format files (usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, etc), TZ environment string (in all known formats), given ranges (with h...
MediaBrowser/plugin.video.emby
libraries/dateutil/tz/tz.py
Python
gpl-3.0
60,466
from __future__ import unicode_literals from django.db.utils import DatabaseError from django.utils.encoding import python_2_unicode_compatible class AmbiguityError(Exception): """ Raised when more than one migration matches a name prefix. """ pass class BadMigrationError(Exception): """ Ra...
jscn/django
django/db/migrations/exceptions.py
Python
bsd-3-clause
1,448
# -*- coding: utf-8 -*- """ Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function # stdlib from logging import getLogger # ZeroMQ import zmq # Zato from zato.apimox.common import ...
zatosource/zato-apimox
src/zato/apimox/zmq_.py
Python
gpl-3.0
1,548
#!/usr/bin/env python # =================================== # Copyright (c) Microsoft Corporation. All rights reserved. # See license.txt for license information. # =================================== import os import sys import tempfile import re import imp import codecs protocol = imp.load_source('protocol', '../pr...
bielawb/WPSDSCLinux
dsc/Providers/Scripts/3.x/Scripts/nxFileLine.py
Python
mit
9,035
# -*- coding: utf-8 -*- # Copyright (C) 2016-Today GRAP (http://www.grap.coop) # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Products - Send to Scales', 'summary': 'Synchronize Odoo database with Scales', 'versio...
houssine78/addons
product_to_scale_bizerba/__openerp__.py
Python
agpl-3.0
1,686
#!/usr/local/bin/python3.4 # pyb.py for Off-pyboard testing # here we find pyboard simulation classes for Off-board testing import time def millis(): return time.time() def delay(dela): time.sleep(dela) class SPI(): """simulation SPI class provides basic SPI simulation - definitions - in...
gratefulfrog/ArduGuitar
Ardu2/design/POC-3_MAX395/pyboard/DraftDevt/PS2/Old/StormPS2Trackball/PS2Tester/pyb.py
Python
gpl-2.0
2,770
from ..helpers import nativestr class BFInfo(object): capacity = None size = None filterNum = None insertedNum = None expansionRate = None def __init__(self, args): response = dict(zip(map(nativestr, args[::2]), args[1::2])) self.capacity = response["Capacity"] self.si...
mozillazg/redis-py-doc
redis/commands/bf/info.py
Python
mit
2,555
# -*- coding: utf-8 -*- # Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os import pytest import ...
srvg/ansible
test/units/galaxy/test_collection.py
Python
gpl-3.0
38,071
import pytest from timeit import default_timer from stockfish import Stockfish class TestStockfish: @pytest.fixture def stockfish(self): return Stockfish() def test_get_best_move_first_move(self, stockfish): best_move = stockfish.get_best_move() assert best_move in ( ...
zhelyabuzhsky/stockfish
tests/stockfish/test_models.py
Python
mit
23,247
""" WSGI config for touroperadora project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANG...
lobomacz/touroperadora
touroperadora/wsgi.py
Python
gpl-3.0
404
# pylint: disable=E1101,E1103 # pylint: disable=W0703,W0622,W0613,W0201 from pandas.compat import range, text_type, zip from pandas import compat from functools import partial import itertools import re import numpy as np from pandas.core.dtypes.common import ( _ensure_platform_int, is_list_like, is_bool_dtyp...
Winand/pandas
pandas/core/reshape/reshape.py
Python
bsd-3-clause
45,821
# coding: utf-8 from IPython.core.splitinput import split_user_input from IPython.testing import tools as tt from IPython.utils import py3compat tests = [ ('x=1', ('', '', 'x', '=1')), ('?', ('', '?', '', '')), ('??', ('', '??', '', '')), (' ?', (' ', '?', '', '')), (' ??', (' ', '??', '', '')), ...
cloud9ers/gurumate
environment/lib/python2.7/site-packages/IPython/core/tests/test_splitinput.py
Python
lgpl-3.0
1,196
''' Created on 18.10.2014 @author: jakob ''' from zope.interface import Interface class IVMOptions(Interface): def get_hostname(self): """hostname""" def get_size(self): """size""" def get_memory(self): """memory""" def get_yesswap(self): ""...
ichbinder23/createxenvm
IVMOptions.py
Python
gpl-2.0
879
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
ByteInternet/libcloud
libcloud/common/nttcis.py
Python
apache-2.0
74,157
"""The version number.""" # Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) __version__ = '0.21.dev0'
Teekuningas/mne-python
mne/_version.py
Python
bsd-3-clause
130
""" Tests of the chemistry utilities :Author: Jonathan Karr <jonrkarr@gmail.com> :Date: 2018-02-07 :Copyright: 2018, Karr Lab :License: MIT """ from wc_utils.util import chem import attrdict import openbabel import unittest class EmpiricalFormulaTestCase(unittest.TestCase): def test_EmpiricalFormula_constructo...
KarrLab/wc_utils
tests/util/chem/test_chem_core.py
Python
mit
6,741
from django.conf.urls import patterns, url from interviews.views import ElegibilityCertificateDetailView __author__ = 'LBerrocal' urlpatterns = patterns('', url(r'^certificate/(?P<pk>[\d]+)/$', ElegibilityCertificateDetailView.as_view(), name='certificate-goal'), )
luiscberrocal/homeworkpal
homeworkpal_project/interviews/urls.py
Python
mit
313
import datetime import json import os from amcat.models import UploadedFile from amcat.scripts.article_upload.plugins.defacto_student import get_html, split_html, get_article, \ get_meta, get_title, get_section, get_body, DeFactoStudent from amcat.scripts.article_upload.tests.test_upload import temporary_zipfile, ...
amcat/amcat
amcat/scripts/article_upload/tests/test_defacto_student.py
Python
agpl-3.0
3,481
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
airbnb/caravel
superset/migrations/versions/4e6a06bad7a8_init.py
Python
apache-2.0
10,372
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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...
t-wissmann/qutebrowser
qutebrowser/browser/qtnetworkdownloads.py
Python
gpl-3.0
21,898
#------------------------------------------------------------------------------ # Copyright (C) 2009 Richard Lincoln # # 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; version 2 dated June...
rwl/openpowersystem
dynamics/dynamics/generators/gen_sync.py
Python
agpl-3.0
1,631
from django.utils.safestring import mark_safe from django_filters import ( BooleanFilter, CharFilter, FilterSet, MultipleChoiceFilter, NumberFilter, ) from django_filters.fields import DateRangeField from django_filters.filters import RangeFilter from django_filters.widgets import CSVWidget, RangeW...
OpenHumans/open-humans
open_humans/filters.py
Python
mit
4,593
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. '''A generic script to verify all test files are in the corresponding .ini file. Usage: xpccheck.py <directory>...
michath/ConMonkey
python/mozbuild/mozbuild/action/xpccheck.py
Python
mpl-2.0
2,462
from setuptools import setup, find_packages import os import allensdk # http://bugs.python.org/issue8876#msg208792 if hasattr(os, 'link'): del os.link def prepend_find_packages(*roots): ''' Recursively traverse nested packages under the root directories ''' packages = [] for root in roots: ...
wvangeit/AllenSDK
setup.py
Python
gpl-3.0
1,828
import tensorflow as tf import matter import hippocampus import util import lobe import numpy as np class Temporal_Component(lobe.Component): def __init__(self, component_size, input_size, total_past_steps, belief_depth, scope_name): self.sizes = {'input_size': input_size, 'component_size': component_siz...
PVirie/vmachine
src/temporal_lobe.py
Python
mit
3,198
TELEGRAM_TOKEN = '275663538:AAErhVnGkQq9WgHCFb3S_OSP06gyTPy59Fg'
osminogin/asyncbot
asyncbot/settings_local.py
Python
gpl-3.0
65
"""This is IOS river implementation.""" from functools import partial import re import logging import pexpect from condoor.drivers.generic import Driver as Generic from condoor.actions import a_send_password, a_expected_prompt, a_send_line, a_send, a_disconnect from condoor.exceptions import ConnectionAuthenticationE...
kstaniek/condoor-ng
condoor/drivers/IOS.py
Python
apache-2.0
3,548
# The MIT License (MIT) # Copyright (c) «2015-2020» «Shibzukhov Zaur, szport at gmail dot com» # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software - recordclass library - and associated documentation files # (the "Software"), to deal in the Software without restriction, ...
sergey-dryabzhinsky/dedupsqlfs
lib-dynload/_recordclass/lib/recordclass/typing/__init__.py
Python
mit
7,805
import dynet as dy import numpy as np from .constants import ACTIVATIONS, INITIALIZERS, RNNS, CategoricalParameter from .mlp import MultilayerPerceptron from .sub_model import SubModel from .util import randomize_orthonormal from ...model_util import MISSING_VALUE class BiRNN(SubModel): def __init__(self, config...
danielhers/tupa
tupa/classifiers/nn/birnn.py
Python
gpl-3.0
11,062
############################################################################### # # Helper functions for testing XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # import re import sys import os.path from zipfile import ZipFile from zipfile import BadZipfile from zipfile import LargeZipFile def...
ivmech/iviny-scope
lib/xlsxwriter/test/helperfunctions.py
Python
gpl-3.0
8,017
#!/usr/bin/pythonTest # -*- coding: utf-8 -*- # # Utility functions Result # # This program is free software; you can redistribute it and/or modify # is 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...
netvigator/myPyPacks
pyPacks/Utils/Result.py
Python
gpl-2.0
1,643
# Generated by Django 2.2.5 on 2019-09-10 14:14 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tags', '0058_tagversiontype_information_package_type'), ] operations = [ migrations.AddField( model_name='structure', ...
ESSolutions/ESSArch_Core
ESSArch_Core/tags/migrations/0059_structure_description.py
Python
gpl-3.0
407
__AUTHOR__= 'FARIZA DIAN PRASETYO' from jaksafe import * import pandas as pd import pandas.io.sql as psql import numpy as np import os import zipfile import shutil from header_config_variable import * import Time as t import psycopg2 import os.path import subprocess import sys from os.path import basename gisserv...
frzdian/jaksafe-engine
jaksafe/jaksafe/jakservice/impact_analysis/hazard_compilation_function.py
Python
gpl-2.0
16,223
def application(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) return '<h1>Hello, %s!</h1>' % (environ['PATH_INFO'][1:] or 'Louis')
louistin/fullstack
Python/web_programming/wsgi/hello_20161024.py
Python
mit
177
from smtplib import SMTP, SMTPAuthenticationError, SMTPException from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText host = "smtp.gmail.com" port = 587 username = "nirajkvinit@gmail.com" password = input("Please enter your password: ") from_email = username to_list = ["nirajkvinit@yaho...
nirajkvinit/python3-study
30days/day11/html_format_email.py
Python
mit
1,489
#!/usr/bin/python #uses PyGreSQL for postgresql connection import sys import os.path import os import shutil import pg import xml.etree.ElementTree as et # # function # parse the case configuration file # def parse_config(filename): COMMENT_CHAR = '#' OPTION_CHAR = '=' options = {} f = open(filename) ...
DNPA/OcfaArch
admin/caseadmin/scripts/replacebeing.py
Python
gpl-2.0
1,932
import numpy as np import unittest import ray.rllib.agents.ddpg as ddpg import ray.rllib.agents.dqn as dqn from ray.rllib.utils.test_utils import check, framework_iterator class TestParameterNoise(unittest.TestCase): def test_ddpg_parameter_noise(self): self.do_test_parameter_noise_exploration( ...
robertnishihara/ray
rllib/utils/exploration/tests/test_parameter_noise.py
Python
apache-2.0
8,620
# -*- coding: utf-8 -*- from django.http import HttpResponse from urlparse import urlparse import mock from nose.tools import * # noqa: from rest_framework.test import APIRequestFactory from django.test.utils import override_settings from website.util import api_v2_url from api.base import settings from api.base.mid...
pattisdr/osf.io
api_tests/base/test_middleware.py
Python
apache-2.0
4,696
"""Diagnostics support for Velbus.""" from __future__ import annotations from typing import Any from velbusaio.channels import Channel as VelbusChannel from velbusaio.module import Module as VelbusModule from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassist...
rohitranjan1991/home-assistant
homeassistant/components/velbus/diagnostics.py
Python
mit
1,989
''' attelo installation ''' from setuptools import setup, find_packages setup(name="attelo", version="0.3", author="IRIT Melodi team", author_email="Philippe.Muller@irit.fr", packages=find_packages(exclude=["scripts", "experiments", ...
kowey/attelo
setup.py
Python
gpl-3.0
765
from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ from classroom.models import ClassRoom from questions import constants class Question(models.Model): class Meta: ordering = ("-created",) subject = models.CharField(_('Su...
reinbach/tutorus
tutorus/questions/models.py
Python
bsd-3-clause
1,242
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tensorflow/model-optimization
tensorflow_model_optimization/python/core/clustering/keras/cluster_integration_test.py
Python
apache-2.0
23,492
from direct.distributed.ClockDelta import * from direct.showbase import DirectObject from direct.directnotify import DirectNotifyGlobal from direct.task import Task import random import TreasurePlannerAI class RegenTreasurePlannerAI(TreasurePlannerAI.TreasurePlannerAI): notify = DirectNotifyGlobal.directNotify.new...
ksmit799/Toontown-Source
toontown/safezone/RegenTreasurePlannerAI.py
Python
mit
1,653
# -*- coding: utf-8 -*- ''' Definitions of the grid. ''' from __future__ import (absolute_import, division, print_function) import numpy as np import functions import gll class OneDimensionalGrid(object): """Contains the grid properties""" def __init__(self, param): """Init""" self.param =...
geodynamics/specfem1d
Python_version/grid.py
Python
gpl-2.0
2,988
INSERT INTO s13.t2(name) VALUES('xx'),('dasdasdas'); UPDATE s13.t2 set name='77777' WHERE nid>3; SELECT * FROM s13.t2 ##连表操作 #SELECT * FROM s13.t10 LEFT JOIN s13.t11 on s13.t10.type_id=s13.t11.id #SELECT * FROM s13.t10 RIGHT JOIN s13.t11 on s13.t10.type_id=s13.t11.id #SELECT * FROM s13.t10 INNER JOIN s13.t11 on ...
xiaoyongaa/ALL
网络编程进阶/MySQL/MySQL介绍.py
Python
apache-2.0
505
#!/usr/bin/env python # # Unit tests for the multiprocessing package # import unittest import Queue import time import sys import os import gc import signal import array import socket import random import logging import errno import test.script_helper from test import test_support from StringIO import StringIO _multi...
ianyh/heroku-buildpack-python-opencv
vendor/.heroku/lib/python2.7/test/test_multiprocessing.py
Python
mit
78,668
#!/usr/bin/env python # This software is distributed under BSD 3-clause license (see LICENSE file). # # Authors: Heiko Strathmann from numpy.random import randn from numpy import * # generate some overlapping training vectors num_vectors=5 vec_distance=1 traindat=concatenate((randn(2,num_vectors)-vec_distance, rand...
karlnapf/shogun
examples/undocumented/python/evaluation_cross_validation_mkl_weight_storage.py
Python
bsd-3-clause
3,323
import datetime from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from lizard_ui.models import ApplicationIcon from lizard_ui.configchecker import checker from lizard_ui.middleware import TracebackLog...
lizardsystem/lizard5-apps
lizard_ui/tests.py
Python
lgpl-3.0
6,646
#!/usr/bin/env python """ Created on 26.01.2014 @author: bronikkk """ from test_common import * output = do_tirpan('test10.py') assert_lines(output, 2)
bronikkk/tirpan
tests/dis_accept10.py
Python
gpl-3.0
156
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
brchiu/tensorflow
tensorflow/python/ops/sparse_ops.py
Python
apache-2.0
95,619
# # png2wx - embed png in C++ # written by Jan Engelhardt, 2007 # # This program is free software; you can redistribute it and/or # modify it under the terms of the WTF Public License version 2 or # (at your option) any later version. # # Please use png2wx.pl over png2wx.py. Here's why: # # obj$ time ../src/png2wx.pl -...
ghthor/hxtools
smm/png2wx.py
Python
gpl-2.0
3,228
import os import platform import pytest import six from conan.tools.files import rename from conans.test.utils.mocks import ConanFileMock from conans.test.utils.tools import temp_folder, save_files @pytest.mark.skipif(six.PY2, reason="only Py3") def test_rename_file(): conanfile = ConanFileMock() tmp = temp_...
conan-io/conan
conans/test/unittests/tools/files/test_rename.py
Python
mit
1,057
from unittest import TestCase from unittest.mock import MagicMock import os import h5py import numpy as np import shutil from pathlib import Path from keras.models import Model import keras.layers as layers from orcanet.core import Configuration from orcanet.in_out import IOHandler, split_name_of_predfile class Test...
ViaFerrata/DL_pipeline_TauAppearance
orcanet/tests/test_in_out.py
Python
agpl-3.0
24,292
import logging from django.db import transaction from django.utils import timezone from website.prereg.utils import get_prereg_schema from framework.celery_tasks import app as celery_app from osf.models import DraftRegistration, QueuedMail from osf.models.queued_mail import PREREG_REMINDER, PREREG_REMINDER_TYPE, que...
laurenrevere/osf.io
scripts/remind_draft_preregistrations.py
Python
apache-2.0
2,171
# -*- coding: utf-8 -*- # # shell.py - shell commander module # # Copyright (C) 2010 - Jesse van den Kieboom # # 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 Licens...
purpleidea/gedit-plugins
plugins/commander/modules/shell.py
Python
gpl-2.0
5,761
# ----------------------------------------------------------------------------- # Copyright (c) 2016--, The Plate Mapper Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------...
squirrelo/plate-mapper
platemap/lib/environment.py
Python
bsd-3-clause
2,587
import unittest from pykka import ActorDeadError from pykka.actor import ThreadingActor from pykka.proxy import ActorProxy class SomeObject(object): cat = 'bar.cat' pykka_traversable = False class AnActor(object): bar = SomeObject() bar.pykka_traversable = True foo = 'foo' def __init__(se...
li-ch/pykka
tests/proxy_test.py
Python
apache-2.0
3,258
# Copyright (c) 2001 Chris Withers # # This Software is released under the MIT License: # http://www.opensource.org/licenses/mit-license.html # See license.txt for more details. # # $Id: testStripogram.py,v 1.20 2003/01/07 11:03:56 fresh Exp $ # we need to import ourselves, so add the folder above # into the module se...
MehmetNuri/ozgurlukicin
forum/stripogram/testStripogram.py
Python
gpl-3.0
8,658
from flask import Blueprint, render_template, url_for, redirect from flask_login import login_required, current_user from scoring_engine.models.service import Service from scoring_engine.models.setting import Setting from scoring_engine.db import session mod = Blueprint('services', __name__) @mod.route('/services')...
pwnbus/scoring_engine
scoring_engine/web/views/services.py
Python
mit
1,498
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: proxysql_global_variables ...
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/database/proxysql/proxysql_global_variables.py
Python
bsd-3-clause
9,148
from nose.plugins.attrib import attr from numpy.testing import assert_array_less from numpy import array, hstack from numpy.random import rand import singleModelSpike as sms from hopkinsTesting import runOnManyExtraNoise, findBalancedSets, manyNames, rest import alternatingAlgorithms import utility import weightedMode...
daniel-vainsencher/regularized_weighting
src/testAcceptance.py
Python
bsd-2-clause
4,123
import sys from PyQt4 import QtGui import numpy as np from Orange.widgets import widget, gui from Orange.widgets.settings import Setting from Orange.data import Table, Domain, ContinuousVariable from Orange.classification import OneClassSVMLearner, EllipticEnvelopeLearner from Orange.base import SklLearner class O...
hugobuddel/orange3
Orange/widgets/data/owoutliers.py
Python
gpl-3.0
7,168
# Copyright 2018 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. from __future__ import print_function from __future__ import division from __future__ import absolute_import import datetime import httplib import mock impo...
endlessm/chromium-browser
third_party/catapult/dashboard/dashboard/update_dashboard_stats_test.py
Python
bsd-3-clause
8,059
"""Segmented models of the lattice.""" import math as _math import numpy as _np import pyaccel as _pyaccel def dipole_bc(m_accep_fam_name, simplified=False): """Segmented BC dipole model.""" segtypes = { 'BC': ('BC', _pyaccel.elements.rbend), 'BC_EDGE': ('BC_EDGE', _pyaccel.elements.marker), ...
lnls-fac/sirius
pymodels/SI_V25_01/segmented_models.py
Python
mit
21,211
def solution(A): def countGreater(A, a): count = 0 for i in range(a - 1): if A[i] > A[a]: count += 1 return count dp = [0] * len(A) dp[0] = 1 for i in range(1, len(A)): dp[i] = countGreater(A, i) + dp[i - 1] + 1 return sum(dp) print(sol...
opethe1st/CompetitiveProgramming
Codility/Chromium2017/ZigZag.py
Python
gpl-3.0
344
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
stormi/tsunami
src/bases/exceptions/__init__.py
Python
bsd-3-clause
1,853
def test_audit_item_schema_validation(testapp, organism): testapp.patch_json(organism['@id'] + '?validate=false', {'disallowed': 'errs'}) res = testapp.get(organism['@id'] + '@@index-data') errors = res.json['audit'] errors_list = [] for error_type in errors: errors_li...
T2DREAM/t2dream-portal
src/encoded/tests/test_audit_item.py
Python
mit
3,971
# coding=utf-8 import os, sys, datetime, unicodedata, re import xbmc, xbmcgui, xbmcvfs, xbmcaddon import xml.etree.ElementTree as xmltree from xml.sax.saxutils import escape as escapeXML import copy import ast from traceback import print_exc from unicodeutils import try_decode if sys.version_info < (2, 7): import ...
Jayz2K/script.skinshortcuts
resources/lib/xmlfunctions.py
Python
gpl-2.0
45,834
# -*- coding: utf-8 -*- """ tests/__init__.py """ import unittest import trytond.tests.test_tryton from tests.test_views_depends import TestViewsDepends from tests.test_shipment import TestDHLDEShipment def suite(): """ Define suite """ test_suite = trytond.tests.test_tryton.suite() test_su...
fulfilio/trytond-shipping-dhl-de
tests/__init__.py
Python
bsd-3-clause
589
"""Test LoadCore.""" from nose.tools import assert_equals import mock from core.loadcore import LoadCore from support.messages.savedgame import SavedGame from support.messages.newgame import NewGame from errors.invalidchoice import InvalidChoice class TestLoadCore(object): """Test LoadCore.""" def test_ini...
nihlaeth/HorseLife
tests/core/testloadcore.py
Python
gpl-2.0
1,494
"""Performancetest-runner performancetest scalability collector.""" from collector_utilities.exceptions import CollectorException from collector_utilities.type import Value from model import SourceResponses from .base import PerformanceTestRunnerBaseClass class PerformanceTestRunnerScalability(PerformanceTestRunner...
ICTU/quality-time
components/collector/src/source_collectors/performancetest_runner/performancetest_scalability.py
Python
apache-2.0
1,002
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, ...
derekchiang/keystone
keystone/common/environment/eventlet_server.py
Python
apache-2.0
4,635
#!/usr/bin/env python # Progressive Cactus Package # Copyright (C) 2009-2012 by Glenn Hickey (hickey@soe.ucsc.edu) # and Benedict Paten (benedictpaten@gmail.com) # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
BD2KGenomics/cactus
src/progressiveCactus.py
Python
gpl-3.0
16,648
''' Created on 9 Mar, 2015 @author: artur.mrowca '''
PhilippMundhenk/IVNS
ECUSimulation/environment/__init__.py
Python
mit
54
import datetime import urlparse import elasticsearch import requests from django.shortcuts import render from django.conf import settings from django.utils import timezone from django.contrib.auth.models import Permission from django.core.cache import cache from crashstats.crashstats import utils from crashstats.cra...
AdrianGaudebert/socorro
webapp-django/crashstats/monitoring/views.py
Python
mpl-2.0
5,803