text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
"""Graph debug results dumping class.""" import os import json import tvm GRAPH_DUMP_FILE_NAME = '_tvmdbg_graph_dump.json' class DebugResult(object): """Graph debug data module. Data dump module manage all the debug data formatting. Output data and input graphs are formatted and dumped to file. Front...
mlperf/training_results_v0.6
Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/python/tvm/contrib/debugger/debug_result.py
Python
apache-2.0
6,677
0.002396
import sys import os import pandas as pd import multiprocessing as mp import csv # this code is written for the merged file with combined pval & fdr. although it could have been written for the file without comb fisher and fdr, # it is easier to have the output with the comb pval and fdr and use what we need rather t...
richrr/scripts
python/merging-python-script.py
Python
gpl-3.0
5,595
0.0084
#!/usr/bin/python3 import os import urllib import socket from gi.repository import GObject, Nautilus class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoProvider): nautilusVFSFile_table = {} registered_paths = {} remainder = '' connected = False watch_id = 0 d...
ckamm/mirall
shell_integration/nautilus/ownCloud.py
Python
gpl-2.0
5,047
0.038439
""" PyroScope - Controller "torrent". Copyright (c) 2009 The PyroScope Project <pyroscope.project@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 Free Software Foundation; either version 2 of the L...
pyroscope/pyroscope
pyroscope/pyroscope/controllers/torrent.py
Python
gpl-2.0
1,556
0.003213
# 24.05.2007, c # last revision: 25.02.2008 from sfepy import data_dir from sfepy.fem.periodic import * filename_mesh = data_dir + '/meshes/2d/special/channels_symm944t.mesh' if filename_mesh.find( 'symm' ): region_1 = { 'name' : 'Y1', 'select' : """elements of group 3""", } region_2 = { ...
olivierverdier/sfepy
examples/navier_stokes/stokes.py
Python
bsd-3-clause
4,109
0.024093
#!/usr/bin/env python from datetime import date import os import re SRC_DIR = 'src/main/java/' ABSTRACT = re.compile(r'public abstract class Abstract') TYPE = re.compile(r'class [A-Za-z0-9]+(<[^>]+?(?: extends ([A-Za-z0-9_]+))?>)?') TARGET = re.compile(r'\s[A-Z][A-Za-z0-9_]+<[A-Z][A-Za-z0-9_]+(?:<.+?>)?, (([A-Z][A-...
lockerfish/assertj-android
generate-assertions-java.py
Python
apache-2.0
4,345
0.014499
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-03-01 09:32 from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("modelview", "0009_auto_20160301_1030")] operations = [ mig...
openego/oeplatform
modelview/migrations/0010_auto_20160301_1032.py
Python
agpl-3.0
728
0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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 applicab...
ntt-sic/heat
heat/engine/update.py
Python
apache-2.0
7,456
0
""" USA-specific Form helpers """ from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re phone_digits_re = re.compile(r'^(?:1-?)?(\d{3})[-\.]?(\d{...
Shrews/PyGerrit
webapp/django/contrib/localflavor/us/forms.py
Python
apache-2.0
4,166
0.00312
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2015-12-19 18:47 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('judge', '0018_django_1_9'), ] operations = [ migrations.AddField( ...
monouno/site
judge/migrations/0019_og_images.py
Python
agpl-3.0
716
0.002793
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy documentation build configuration file. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this file. # # All configurati...
mwcraig/ccdproc
docs/conf.py
Python
bsd-3-clause
6,953
0.001726
from __future__ import absolute_import, division, print_function import ast from jaspyx.ast_util import ast_load, ast_call from jaspyx.visitor import BaseVisitor class BinOp(BaseVisitor): def visit_BinOp(self, node): attr = getattr(self, 'BinOp_%s' % node.op.__class__.__name__, None) attr(node.lef...
ztane/jaspyx
jaspyx/visitor/binop.py
Python
mit
1,067
0
#!/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 "License");...
arenadata/ambari
ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/interpreter_json_template.py
Python
apache-2.0
15,680
0.000255
#!/usr/bin/python # Copyright (c) 2011 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. """Cros unit test library, with utility functions.""" from __future__ import print_function import collections import contextlib i...
zhang0137/chromite
lib/cros_test_lib.py
Python
bsd-3-clause
29,541
0.008158
import sys import math as ma import numpy as np params = ["$\\varepsilon_{sph}$ & ", "$q$ & ", "$\\varepsilon$ & ", "$\mu$ & ", "R & ", "$\\theta$ & ", "$\phi$ &", " $\sigma$ & ", "$\\varepsilon$ & ", "$\mu$ & ", "R & ", "$\\theta$ & ", "$\phi$ & ", "$\sigma$ & ", "$\\varepsilon$ & ", "$\mu$ & ", "R & ", "$\\theta$ & ...
weissj3/MWTools
Scripts/MakeNormalizedHistogram.py
Python
mit
1,516
0.030343
from setuptools import setup setup( name="SULI", packages=['SULI'], version='0.0.1', description="SULI project", author='Kelin Kurzer-Ogul', author_email='kelin.kurzerogul@gmail.com', url='https://github.com/k340/SULI', keywords=['SULI', 'Fermi', 'LAT', 'transients'], class...
k340/SULI
setup.py
Python
bsd-3-clause
378
0.005291
import os from itertools import imap from multiprocessing import Pool from config import config from document_topic import Document, Topic class Collection(object): def __init__(self, list_file, prefix=''): self.names_list = [os.path.join(prefix, file_name.strip()) for file_name in list_file] def __i...
machacek/information-retrieval-project
lucene-experiment/collection.py
Python
unlicense
618
0.011327
# 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 agre...
nett55/caniusepypy
caniusepypy/command.py
Python
apache-2.0
1,565
0
""" Various tests for class members access. """ # pylint: disable=R0903,print-statement,no-absolute-import, metaclass-assignment,import-error,no-init,missing-docstring, wrong-import-order,wrong-import-position from missing import Missing class MyClass(object): """class docstring""" def __init__(self): ...
axbaretto/beam
sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/test/functional/class_members_py27.py
Python
apache-2.0
1,691
0.011236
# This python module is part of the oocs scanner for Linux. # Copyright (C) 2015 Davide Madrisan <davide.madrisan.gmail.com> import glob from os import sep from os.path import join from pwd import getpwuid from oocs.filesystem import Filesystems, UnixCommand, UnixFile from oocs.io import Config, message_add, quote, u...
madrisan/pyoocs
oocs/services.py
Python
gpl-3.0
6,244
0.004164
import zeit.newsletter.testing class MetadataTest(zeit.newsletter.testing.SeleniumTestCase): def test_form_should_save_entered_data_on_blur(self): s = self.selenium self.open('/repository/newsletter/@@checkout') s.waitForElementPresent('id=metadata.subject') s.assertValue('id=meta...
ZeitOnline/zeit.newsletter
src/zeit/newsletter/browser/tests/test_form.py
Python
bsd-3-clause
668
0
""" ==================================================================== Linear and Quadratic Discriminant Analysis with confidence ellipsoid ==================================================================== Plot the confidence ellipsoids of each class and decision boundary """ print(__doc__) from scipy import lin...
mayblue9/scikit-learn
examples/classification/plot_lda_qda.py
Python
bsd-3-clause
5,046
0.001585
from qsweepy.instruments import * from qsweepy import * from qsweepy import awg_iq_multi import numpy as np device_settings = {'vna_address': 'TCPIP0::10.20.61.48::inst0::INSTR', 'lo1_address': 'TCPIP0::10.20.61.59::inst0::INSTR', 'lo1_timeout': 5000, 'rf_switch_address': '10.20...
ooovector/qtlab_replacement
tunable_coupling_transmons/Misis_two_qubit_August_2019_setup.py
Python
gpl-3.0
9,950
0.003973
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module 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 late...
bjolivot/ansible
lib/ansible/modules/cloud/openstack/os_nova_flavor.py
Python
gpl-3.0
8,477
0.004719
from .. utils import TranspileTestCase, BuiltinFunctionTestCase class InputTests(TranspileTestCase): pass # FIXME: This test can't run without a redirection for stdin. # class BuiltinInputFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): # functions = ["input"] # not_implemented = [ # ...
glasnt/voc
tests/builtins/test_input.py
Python
bsd-3-clause
687
0
# -*- coding: utf-8 -*- """ """ import logging import logging.handlers import sys STANDARD_FORMAT = '%(name)s [%(levelname)s] %(message)s' MESSAGE_ONLY_FORMAT = '%(message)s' def get_level(level_string): """ Returns an appropriate logging level integer from a string name """ levels = {'debug': loggi...
SavinaRoja/npyscreen2
npyscreen2/logs.py
Python
gpl-3.0
1,956
0.001022
# Copyright (C) 2008-2012 Chris Ball <cjb@laptop.org> # Gianluca Montecchi <gian@grys.it> # W. Trevor King <wking@tremily.us> # # This file is part of Bugs Everywhere. # # Bugs Everywhere is free software: you can redistribute it and/or modify it # under the terms of the ...
Warbo/bugseverywhere
libbe/command/merge.py
Python
gpl-2.0
6,074
0.001976
from __future__ import absolute_import #from urllib.parse import urlparse, urlunparse from builtins import str from builtins import range from django.conf import settings # Avoid shadowing the login() and logout() views below. from django.contrib.auth import ( REDIRECT_FIELD_NAME, get_user_model, login as auth_lo...
zibawa/zibawa
front/views.py
Python
gpl-3.0
12,712
0.014553
from __future__ import ( unicode_literals, absolute_import, division, print_function, ) # Make Py2's str type like Py3's str = type('') # Rules that take into account part of speech to alter text structure_rules = [ ((["JJ*","NN*"],), (["chuffing",0,1],), 0.1), ((["."],),...
safehammad/mancify
mancify/dialects/manc.py
Python
mit
7,080
0.053107
########################################################################## # # Copyright (c) 2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
goddardl/gaffer
python/GafferTest/ApplicationTest.py
Python
bsd-3-clause
2,198
0.010919
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class ConsultantformConfig(AppConfig): name = 'consultantform'
rajeshgupta14/pathend
consultantform/apps.py
Python
apache-2.0
168
0
class RuntimeValidationError(Exception): pass
lubokkanev/cloud-system
core/main/runtimes/runtime_validation_error.py
Python
gpl-2.0
50
0
"""Provides the constants needed for component.""" from typing import Final SUPPORT_ALARM_ARM_HOME: Final = 1 SUPPORT_ALARM_ARM_AWAY: Final = 2 SUPPORT_ALARM_ARM_NIGHT: Final = 4 SUPPORT_ALARM_TRIGGER: Final = 8 SUPPORT_ALARM_ARM_CUSTOM_BYPASS: Final = 16 SUPPORT_ALARM_ARM_VACATION: Final = 32 CONDITION_TRIGGERED: F...
jawilson/home-assistant
homeassistant/components/alarm_control_panel/const.py
Python
apache-2.0
642
0
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.views.generic import DetailView, ListView, RedirectView, UpdateView from django.contrib.auth.mixins import LoginRequiredMixin from .models import User class UserDetailView(Login...
crdoconnor/cookiecutter-django
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/views.py
Python
bsd-3-clause
1,459
0
# This file is part of fedmsg. # Copyright (C) 2012 Red Hat, Inc. # # fedmsg 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 option) any later version. #...
vivekanand1101/fedmsg
fedmsg/tests/__init__.py
Python
lgpl-2.1
822
0
#!/usr/bin/python # System of three linear equations # ax + by + cz = j # dx + ey + fz = k # gx + hy + iz = l # System of three linear equations in matrix notation # - - - - - - # | a b c | | x | | j | # | | | | | | # | d e f | | y | = | k | # | | | | |...
mikequentel/sarrus_cramer
sclinear.py
Python
mit
4,841
0.026854
# -*- coding: utf-8 -*- # This software may be modified and distributed under the terms # of the BSD license. See the LICENSE file for details. from aniso8601 import compat class DateResolution(object): Year, Month, Week, Weekday, Day, Ordinal = list(compat.range(6)) class TimeResolution(object): Seconds, ...
morissette/devopsdays-hackathon-2016
venv/lib/python2.7/site-packages/aniso8601/resolution.py
Python
gpl-3.0
359
0.005571
from key import Key def _object_getattr(obj, field): """Attribute getter for the objects to operate on. This function can be overridden in classes or instances of Query, Filter, and Order. Thus, a custom function to extract values to attributes can be specified, and the system can remain agnostic to ...
alexandonian/ptutils
ptutils/datastore/query.py
Python
mit
17,240
0.001624
from multiprocessing import RLock from sys import path from mako.lookup import TemplateLookup from scullery import iceflow,workers import os import time import threading import logging import weakref import traceback import shutil import re import io import random logger = logging.Logger("plugins.nvr") templateGetter...
EternityForest/KaithemAutomation
kaithem/src/thirdparty/iot_devices/devices/NVRPlugin/__init__.py
Python
gpl-3.0
46,929
0.006393
def main(): a1="X" TextOut(10, LCD_LINE1, a1)
xlcteam/pynxc
pynxc/tests/in/_issue_5.py
Python
bsd-3-clause
54
0.018519
# # Copyright (c) 2017 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 t...
NervanaSystems/coach
rl_coach/agents/n_step_q_agent.py
Python
apache-2.0
6,933
0.00375
from pycp2k.inputsection import InputSection class _each438(InputSection): def __init__(self): InputSection.__init__(self) self.Just_energy = None self.Powell_opt = None self.Qs_scf = None self.Xas_scf = None self.Md = None self.Pint = None self.Meta...
SINGROUP/pycp2k
pycp2k/classes/_each438.py
Python
lgpl-3.0
1,114
0.001795
# 2015.09.05 18:13:46 ora legale Europa occidentale # Embedded file name: b.py from a import x def x(): print 'b' x() from a import x x() # okay decompyling C:\Users\nicola user\wotmods\files\originals\tests\overriding\b.pyc # decompiled 1 files: 1 okay, 0 failed, 0 verify failed # 2015.09.05 18:13:46 ora legal...
jstar88/wotmods
files/uncompyled/tests/overriding/b.py
Python
gpl-2.0
341
0.01173
"""Voluptuous schemas for the KNX integration.""" import voluptuous as vol from xknx.devices.climate import SetpointShiftMode from homeassistant.const import ( CONF_ADDRESS, CONF_DEVICE_CLASS, CONF_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_PORT, CONF_TYPE, ) import homeassistant.helpers.config_...
tchellomello/home-assistant
homeassistant/components/knx/schema.py
Python
apache-2.0
14,928
0.000335
from networkx.algorithms.flow.maxflow import * from networkx.algorithms.flow.mincost import *
azlanismail/prismgames
examples/games/car/networkx/algorithms/flow/__init__.py
Python
gpl-2.0
98
0.010204
# -*- coding: utf-8 -*- # # Clawpack documentation build configuration file, created by # sphinx-quickstart on Wed Mar 25 12:07:14 2009. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickle...
clawpack/clawpack-4.x
doc/sphinx/conf.py
Python
bsd-3-clause
6,603
0.005755
from django.forms import HiddenInput from .base import WidgetTest class HiddenInputTest(WidgetTest): widget = HiddenInput() def test_render(self): self.check_html(self.widget, 'email', '', html='<input type="hidden" name="email" />') def test_use_required_attribute(self): # Always False...
edmorley/django
tests/forms_tests/widget_tests/test_hiddeninput.py
Python
bsd-3-clause
603
0.001658
################################################################################ # # # Folding@Home Client Control (FAHControl) # # Copyright (C) 2016-2020 foldingathome.org ...
FoldingAtHome/fah-control
fah/db/Database.py
Python
gpl-3.0
5,550
0.013694
# -*- coding: utf-8 -*- """ Written by Daniel M. Aukes and CONTRIBUTORS Email: danaukes<at>asu.edu. Please see LICENSE for full license. """ import sys import popupcad import qt.QtCore as qc import qt.QtGui as qg if __name__=='__main__': app = qg.QApplication(sys.argv[0]) filename_from = 'C:/Users/d...
danaukes/popupcad
api_examples/switch_subdesign.py
Python
mit
1,814
0.011577
# -*- coding: utf-8 -*- """Create an application instance.""" from flask.helpers import get_debug_flag from myflaskapp.app import create_app from myflaskapp.settings import DevConfig, ProdConfig CONFIG = DevConfig if get_debug_flag() else ProdConfig app = create_app(CONFIG)
terryjbates/test-driven-development-with-python
myflaskapp/autoapp.py
Python
mit
278
0
df_monthly = df.resample('M').sum() df_monthly.plot()
jorisvandenbossche/DS-python-data-analysis
notebooks/_solutions/case1_bike_count21.py
Python
bsd-3-clause
53
0.018868
import copy from fmiapi.fmixmlparser import FMIxmlParser from tests.testUtils import * from tests.fmiapi.testdata.expected_data import * def describe_fmi_xml_parser(): parser = FMIxmlParser() def describe_daily_data(): test_data1 = load_xml('./tests/fmiapi/testdata/daily_12_days.xml') test_da...
Tumetsu/FMI-weather-downloader
tests/fmiapi/test_fmiparser.py
Python
gpl-2.0
2,344
0.00128
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-02-06 21:49 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0206_stream_rendered_description'), ] operations = [ migrations....
tommyip/zulip
zerver/migrations/0207_multiuseinvite_invited_as.py
Python
apache-2.0
482
0
# -*- coding: utf-8 -*- # Config file handling module # Copyright (C) 2014 Yury Gavrilov <yuriy@igavrilov.ru> # This file is part of VKBuddy. # VKBuddy 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...
gavyur/vkbuddy
config.py
Python
gpl-3.0
2,070
0.000966
# -*- coding: utf-8 -*- """ werkzeug ~~~~~~~~ Werkzeug is the Swiss Army knife of Python web development. It provides useful classes and functions for any WSGI application to make the life of a python web developer much easier. All of the provided classes are independent from each other so yo...
brianmhunt/SIWorldMap
werkzeug/__init__.py
Python
mit
7,097
0.001832
# Copyright (c) 2016 Pani Networks 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 req...
romana/networking-romana
networking_romana/driver/ipam_romana.py
Python
apache-2.0
15,559
0.001928
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings # noqa from django.utils.translation import ugettext_lazy as _ # noqa from appconf import AppConf class BlogConf(AppConf): DISQUS_SHORTNAME = 'django-staticgen' POST_IDENTIFIER = 'current_post' class Met...
mishbahr/staticgen-demo
staticgen_demo/blog/conf.py
Python
bsd-3-clause
347
0
"""Functionality for determining logic satisfiasbility."""
welchbj/tt
tt/satisfiability/__init__.py
Python
mit
59
0
# 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...
szha/mxnet
python/mxnet/api.py
Python
apache-2.0
938
0
import os import argparse import datetime import yaml import api.src.common.initial_environment_config from ..models.dense import create_model from ..data_processing.data_generator import DataGenerator from ..common.config import TrainingConfig, DataConfig, Config from ..common.utils import print_info, ensure_dir from...
kacper1095/asl-translator
api/src/scripts/train_simple_network.py
Python
gpl-3.0
3,211
0.005294
# Copyright (c) 2014 - 2016 townhallpinball.org # # 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, p...
town-hall-pinball/project-omega
pin/lib/score.py
Python
mit
4,429
0.001129
import numpy as np import scipy.optimize from scipy.signal import lombscargle import batman import ctools import matplotlib.pyplot as plt def periodogram(time, data, periods): freq = 1/periods nfactor = 2/(data.size * np.var(data)) power = nfactor * lombscargle(time, data-np.mean(data), freq*2*np.pi) ...
Saethlin/astrotools
fit_transit.py
Python
mit
3,396
0.001767
import numpy as np import pandas as pd import pytest ROWID_ZERO_INDEXED_BACKENDS = ('omniscidb',) @pytest.mark.parametrize( 'column', [ 'string_col', 'double_col', 'date_string_col', pytest.param('timestamp_col', marks=pytest.mark.skip(reason='hangs')), ], ) @pytest.mark.x...
cloudera/ibis
ibis/backends/tests/test_column.py
Python
apache-2.0
1,384
0
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # @Author: Adrien Chardon # @Date: 2014-11-16 14:29:10 # @Last Modified by: Adrien Chardon # @Last Modified time: 2014-11-16 16:31:32 import time as t ################################################################################ # Usefull functions ###################...
Nodraak/Prologin2015
4_Expert-itinerant.py
Python
gpl-2.0
3,054
0.005239
# -*- coding: utf-8 -*- """ flaskbb.management.views ~~~~~~~~~~~~~~~~~~~~~~~~ This module handles the management views. :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ import sys from flask import (Blueprint, current_app, request, redirect, url_for, flas...
realityone/flaskbb
flaskbb/management/views.py
Python
bsd-3-clause
24,085
0.000166
from classytags.helpers import InclusionTag from django import template from django.conf import settings from django.template.loader import render_to_string register = template.Library() class Banner(InclusionTag): """ Displays a checkout mode banner. """ template = 'sagepay/checkout_mode_banner.ht...
glynjackson/django-oscar-sagepay
sagepay/templatetags/checkout_mode_tag.py
Python
mit
613
0.001631
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
kernow/ansible-modules-core
cloud/amazon/route53.py
Python
gpl-3.0
22,225
0.009719
def load_config(default_values, user_values): if user_values is None: return default_values config = {} for k, v in user_values.items(): if k in default_values: if isinstance(v, dict): cloned = user_values[k].copy() for key, value in default_valu...
CoderBotOrg/coderbotsrv
server/lib/engineauth/utils.py
Python
gpl-3.0
948
0.003165
from django.conf import settings from django.conf.urls import static from django.urls import include, path, re_path from django.contrib import admin urlpatterns = [ path(r"admin/", admin.site.urls), path(r"flickr/", include("ditto.flickr.urls")), path(r"lastfm/", include("ditto.lastfm.urls")), path(r"...
philgyford/django-ditto
devproject/devproject/urls.py
Python
mit
795
0.001258
# -*- 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): # Changing field 'FilerFile.file' db.alter_column(u'cmsplugin_filer_file...
nephila/cmsplugin-filer
cmsplugin_filer_file/south_migrations/0005_auto__chg_field_filerfile_file.py
Python
bsd-3-clause
10,023
0.007982
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Stub functions that are used by the Amazon Pinpoint unit tests. When tests are run against an actual AWS account, the stubber class does not set up stubs and passes all calls through to the Boto 3 client. ""...
awsdocs/aws-doc-sdk-examples
python/test_tools/pinpoint_stubber.py
Python
apache-2.0
7,368
0.001629
# -*- coding: utf-8 -*- from django.test import Client from django.urls import reverse from nmkapp import views from .nmk_unit_test_case import NmkUnitTestCase class ResultsTests(NmkUnitTestCase): def test_anon_user(self): """ Test result view with anonymous user """ self.client ...
stalker314314/nasa_mala_kladionica
tests/unit/tests_view_results.py
Python
gpl-3.0
772
0.001295
# -*- coding: utf-8 -*- # Copyright 2016 Acsone SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Account Invoice Check Total', 'summary': """ Check if the verification total is equal to the bill's total""", 'version': '10.0.1.0.0', 'license': 'AGPL-3', 'autho...
sysadminmatmoz/account-invoicing
account_invoice_check_total/__manifest__.py
Python
agpl-3.0
607
0
# -*- coding: utf-8 -*- """forms""" import floppyforms.__future__ as floppyforms class HidableMultipleChoiceField(floppyforms.MultipleChoiceField): """ The MultipleChoiceField doesn't return an <input type="hidden"> when hidden but an empty string Overload this field to restore an <input type="hidden"> ...
ljean/coop_cms
coop_cms/forms/fields.py
Python
bsd-3-clause
371
0.002695
#!/usr/bin/env python from pylab import * fig = figure() subplot(221) imshow(rand(100,100)) subplot(222) imshow(rand(100,100)) subplot(223) imshow(rand(100,100)) subplot(224) imshow(rand(100,100)) subplot_tool() show()
sniemi/SamPy
sandbox/src1/examples/subplot_toolbar.py
Python
bsd-2-clause
222
0.018018
#!/usr/bin/env python import unittest import os.path import sys import time sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) import base from PyQt4.QtTest import QTest from enki.core.core import core class Test(base.TestCase): def _verifyText(self, fileName, text): w...
vi/enki
tests/test_core/test_uisavefiles.py
Python
gpl-2.0
2,949
0.001695
# encoding: utf8 from django.db import models, migrations class Migration(migrations.Migration): dependencies = [("podcasts", "0005_auto_20140610_1854")] operations = [ migrations.AlterField( model_name="episode", name="outdated", field=models.BooleanField(defau...
gpodder/mygpo
mygpo/podcasts/migrations/0006_auto_20140614_0836.py
Python
agpl-3.0
701
0
''' Generic message-based protocol used by Bitcoin and P2Pool for P2P communication ''' import hashlib import struct from twisted.internet import protocol from twisted.python import log import p2pool from p2pool.bitcoin import data as bitcoin_data from p2pool.util import datachunker, variable class TooLong(Exceptio...
GroestlCoin/p2pool-grs
p2pool/util/p2protocol.py
Python
gpl-3.0
4,140
0.006039
from django.db.models import Q from import_export.admin import ImportExportModelAdmin from models import Vote, Law, PrivateProposal, KnessetProposal, GovProposal, Bill, GovLegislationCommitteeDecision from laws.management.commands.scrape_votes import Command as ScrapeVotesCommand from django.utils.translation import u...
alonisser/Open-Knesset
laws/admin.py
Python
bsd-3-clause
5,183
0.001929
"""MNE software for MEG and EEG data analysis.""" # PEP0440 compatible formatted version, see: # https://www.python.org/dev/peps/pep-0440/ # # Generic release markers: # X.Y # X.Y.Z # For bugfix releases # # Admissible pre-release markers: # X.YaN # Alpha release # X.YbN # Beta release # X.YrcN # Rele...
kambysese/mne-python
mne/__init__.py
Python
bsd-3-clause
5,932
0.000337
# subsystemBonusGallentePropulsion2Agility # # Used by: # Subsystem: Proteus Propulsion - Hyperspatial Optimization type = "passive" def handler(fit, src, context): fit.ship.boostItemAttr("agility", src.getModifiedItemAttr("subsystemBonusGallentePropulsion2"), skill="Gallente Propulsion...
bsmr-eve/Pyfa
eos/effects/subsystembonusgallentepropulsion2agility.py
Python
gpl-3.0
331
0.003021
import numpy as np vec_bitstring_3 = np.vectorize(lambda x: np.binary_repr(x,width=3) ) def board_to_int(v): t = vec_bitstring_3(v) return int(''.join(np.apply_along_axis(lambda x: ''.join(x), 1,t)),2) def int_to_board(i): #i = '154444257952488798331863040' s = bin(int(i))[2:].zfill(108) v = n...
crhaithcock/RushHour
RushHourPy/numpy_utilities.py
Python
cc0-1.0
413
0.031477
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-07 02:03 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('medgointranet', '0012_motivoanulacion'), ] operations = [ migrations.AddFie...
ElitosGon/medgoproject
medgointranet/migrations/0013_atencion_formulario.py
Python
apache-2.0
507
0.001976
import logging from datetime import timedelta from core import Feed from core.errors import ObservableValidationError from core.observables import Ip class AlienVaultIPReputation(Feed): default_values = { "frequency": timedelta(hours=4), "name": "AlienVaultIPReputation", "source": "http:/...
yeti-platform/yeti
plugins/feeds/public/alienvault_ip_reputation.py
Python
apache-2.0
1,699
0
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # 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...
airelil/pywinauto-64
pywinauto/unittests/test_common_controls.py
Python
lgpl-2.1
33,312
0.005734
from rest_framework import status from test_utils import serialized_time def test_get_profile_topics( api_client, enable_premium_requirement, profile_topic_factory, user_factory ): """ Premium users should be able to list their own profile topics. """ password = "password" user = user_factory...
knowmetools/km-api
km_api/functional_tests/know_me/profile/profile_topics/test_profile_topic_list.py
Python
apache-2.0
2,774
0
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
facebook/fbthrift
thrift/test/py/TestSerializationSorted.py
Python
apache-2.0
3,066
0.000326
# 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...
jjas0nn/solvem
tensorflow/lib/python2.7/site-packages/tensorflow/python/debug/lib/stepper_test.py
Python
mit
32,092
0.002586
# utils.py """ Utilities module containing various useful functions for use in other modules. """ import logging import numpy as np import scipy.linalg as sl import scipy.sparse as sps import scipy.special as ss from pkg_resources import Requirement, resource_filename from scipy.integrate import odeint from scipy.int...
jellis18/enterprise
enterprise/signals/utils.py
Python
mit
29,066
0.001239
import datetime import logging from django.conf import settings from django.core.exceptions import NON_FIELD_ERRORS from google.appengine.api.datastore import Key, Delete, MAX_ALLOWABLE_QUERIES from google.appengine.datastore.datastore_rpc import TransactionOptions from google.appengine.ext import db from .unique_uti...
kirberich/djangae
djangae/db/constraints.py
Python
bsd-3-clause
11,037
0.003534
# Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
samueldotj/TeeRISC-Simulator
tests/configs/simple-atomic-dummychecker.py
Python
bsd-3-clause
2,321
0
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ boTAB ===== This solver uses the popular TAB model to simulate the atomization of droplets Author: Adam O'Brien """ from input import * from math import exp, cos, sin, sqrt from fluid import * from evaporation import * from TAB import * from output import * impor...
obrienadam/boTAB
boTAB.py
Python
gpl-2.0
2,667
0.003
#!/usr/bin/env python # -*- coding: utf-8 -*- ##################################################################### # Author: Cristian Segura L. # # Email: cristian+dot+segura+dot+lepe+arroba+dot+gmail+dot+com # # Creation Date: Sat nov 8 20:11:38 CLST 2014 ...
CSL-Consulting/asterisk-installation-script
asterisk-installation-script.py
Python
gpl-2.0
2,662
0.009016
import factory from questionnaire.models import Theme class ThemeFactory(factory.DjangoModelFactory): class Meta: model = Theme name = "A title" description = 'Description'
eJRF/ejrf
questionnaire/tests/factories/theme_factory.py
Python
bsd-3-clause
196
0.005102
#!/usr/bin/env python from server import Serve from utils import get_authenticated_user import os import sys authenticated_user = None try: authenticated_user = get_authenticated_user('server.cfg') except IOError: print ("File 'server.cfg' doesn't exist on disk. Please ensure that it" " does and ...
csridhar/58A78C12-3B74-48F6-B265-887C33ED5F98-odat-5DD613ED-1FE0-4D6A-8A20-4C26C3F2C95B
src/main.py
Python
mit
528
0.007576
#! /usr/bin/python class Indexer: def __getitem__(self, index): return index ** 2 x = Indexer() for i in range(5): print x[i], class Stepper: def __getitem__(self, index): return self.data[index] s = Stepper() s.data = "spam" for x in s: print x, print s.data[0]
yuweijun/learning-programming
language-python/getitem.py
Python
mit
281
0.064057
DEBUG = True USE_TZ = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', } } INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'custom_user', 'test_custom_user_subclass', ] SECRET_KEY = 'not_random' AUTH_USER_MODEL = 'test_custom_user_subclass....
dragonfly-science/django-custom-user
test_settings/settings_subclass.py
Python
bsd-3-clause
339
0
#----------------------------------------------------- # # Find the next prime number as the user keeps asking # #----------------------------------------------------- import sys #------------------------ # is the number a prime? #------------------------ def is_prime( num ): for i in range( 2, num ): if num % i ==...
rdegraw/numbers-py
prime_requests.py
Python
unlicense
748
0.05615
"""Views for the monitoring app.""" from django.contrib.auth.decorators import login_required from django.db.models import Count from django.http import Http404 from django.utils.decorators import method_decorator from django.views.generic import ListView, TemplateView from .register import monitor class MonitoringV...
bitmazk/django-monitoring
monitoring/views.py
Python
mit
2,525
0
""" Page classes to test either the Course Team page or the Library Team page. """ from bok_choy.promise import EmptyPromise from bok_choy.page_object import PageObject from ...tests.helpers import disable_animations from . import BASE_URL def wait_for_ajax_or_reload(browser): """ Wait for all ajax requests t...
olexiim/edx-platform
common/test/acceptance/pages/studio/users.py
Python
agpl-3.0
6,650
0.001955