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
# -*- coding: utf-8 -*- import os import collections from six.moves import cPickle import numpy as np import re import itertools class TextLoader(): def __init__(self, data_dir, batch_size, seq_length): self.data_dir = data_dir self.batch_size = batch_size self.seq_length = seq_length ...
bahmanh/word-rnn-tensorflow
utils.py
Python
mit
4,469
0.003359
""" Contains the database models for the application. """
Teddy-Schmitz/temperature_admin
models/__init__.py
Python
mit
58
0
# Copyright (C) 2016-2018 Wind River Systems, Inc. # # SPDX-License-Identifier: GPL-2.0-only # import logging import json from collections import OrderedDict, defaultdict from urllib.parse import unquote, urlparse import layerindexlib import layerindexlib.plugin logger = logging.getLogger('BitBake.layerindexlib.c...
schleichdi2/OPENNFR-6.3-CORE
bitbake/lib/layerindexlib/cooker.py
Python
gpl-2.0
14,139
0.00488
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington and Kai Nagel # See opus_core/LICENSE import os import opus_matsim.sustain_city.tests as test_dir from opus_core.tests import opus_unittest from opus_core.store.csv_storage import csv_storage from urbansim.datasets.travel_dat...
christianurich/VIBe2UrbanSim
3rdparty/opus/src/opus_matsim/sustain_city/tests/matsim_coupeling/matrix_test.py
Python
gpl-2.0
3,343
0.012564
from main_handler import Handler from ..models import Posts from .. import utils class NewPost(Handler): """Handler for new post page""" @utils.login_required def get(self): self.render("newpost.html") @utils.login_required def post(self): subject = self.request.get("subject") ...
stonescar/multi-user-blog
blogmods/handlers/new_post.py
Python
mit
772
0
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading from tempfile import mkstemp, NamedTemporaryFile import time import warnings import gc from io import BytesIO from datetime import datetime import numpy as np import numpy.ma as ma from numpy.lib._iotool...
larsmans/numpy
numpy/lib/tests/test_io.py
Python
bsd-3-clause
66,065
0.000802
# -*- coding: utf-8 -*- """Tests for template combination @Requirement: TemplateCombination @CaseAutomation: Automated @CaseLevel: Acceptance @CaseComponent: API @TestType: Functional @CaseImportance: Medium @Upstream: No """ from nailgun import entities from requests.exceptions import HTTPError from robottelo.d...
sthirugn/robottelo
tests/foreman/api/test_template_combination.py
Python
gpl-3.0
3,545
0
# foreman imports import hashlib from foreman.model import User, ForemanOptions, UserRoles, Case, UserCaseRoles, CaseType, CaseClassification, CaseStatus from foreman.model import TaskType, Task, TaskStatus, UserTaskRoles, EvidenceType, Evidence, TaskUpload, EvidenceStatus from foreman.model import EvidencePhotoUpload...
ubunteroz/foreman
foreman/utils/population.py
Python
gpl-3.0
30,432
0.006145
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'VariantEffect.segment' db.add_column('variant_effect', 'segment', self...
chop-dbhi/varify-data-warehouse
vdw/variants/migrations/0012_auto__add_field_varianteffect_segment.py
Python
bsd-2-clause
17,850
0.008179
class UnrecognisedHandlerException(Exception): pass
jeroanan/GameCollection
UI/Handlers/Exceptions/UnrecognisedHandlerException.py
Python
gpl-3.0
56
0
# extdiff.py - external diff program support for mercurial # # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''command to allow external programs to compare revisions The ex...
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/hgext/extdiff.py
Python
gpl-3.0
12,584
0.001271
import os import ast from tests import unittest from unbound_ec2 import config class TestConfig(unittest.TestCase): def setUp(self): self.config = config.UnboundEc2Conf() def tearDown(self): os.environ['UNBOUND_ZONE'] = config.DEFAULT_ZONE os.environ['UNBOUND_REVERSE_ZONE'] = config....
unibet/unbound-ec2
tests/unit/test_config.py
Python
isc
8,032
0.003984
from __future__ import print_function import functools _modes = ["push", "pull"] _types = set(( "event", "exception", "int", "float", "bool", "str", "mstr", "id", "object", "block", "blockcontrol", "blockmodel", "expression", "bee", )) _objecttypes = "object", "mstr", "id", "block", "bloc...
agoose77/hivesystem
bee/types.py
Python
bsd-2-clause
16,351
0.003241
"""Added existing tables Revision ID: f19fc04ba856 Revises: Create Date: 2017-09-24 03:10:27.208231 """ from alembic import op import sqlalchemy as sa import sys from pathlib import Path monocle_dir = str(Path(__file__).resolve().parents[2]) if monocle_dir not in sys.path: sys.path.append(monocle_dir) from monoc...
DavisPoGo/Monocle
migrations/versions/f19fc04ba856_added_existing_tables.py
Python
mit
10,836
0.01495
#!/usr/bin/python # 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 = r''' --- module: stat version_added: "1.3" short_description: Re...
agaffney/ansible
lib/ansible/modules/stat.py
Python
gpl-3.0
19,140
0.001776
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
bhattmansi/Implementation-of-CARED-in-ns3
src/stats/bindings/modulegen__gcc_LP64.py
Python
gpl-2.0
256,748
0.014244
""" Utilities for plotting various figures and animations in EEG101. """ # Author: Hubert Banville <hubert@neurotechx.com> # # License: TBD import numpy as np import matplotlib.pylab as plt import collections from scipy import signal def dot_plot(x, labels, step=1, figsize=(12,8)): """ Make a 1D dot plot. ...
NeuroTechX/eeg-101
python_tools/utilities.py
Python
isc
5,241
0.011067
# Copyright © 2016 Jakub Wilk <jwilk@jwilk.net> # # 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...
jwilk/anorack
lib/articles.py
Python
mit
1,632
0.001232
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
Azure/azure-sdk-for-python
sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2021_09_01/models/_models.py
Python
mit
38,322
0.00321
from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', ur...
cmgrote/tapiriik
tapiriik/urls.py
Python
apache-2.0
7,197
0.007781
# -*- coding: utf-8 -*- """ *************************************************************************** pyuic.py --------------------- Date : March 2016 Copyright : (C) 2016 by Juergen E. Fischer Email : jef at norbit dot de ********************************...
uclaros/QGIS
python/PyQt/PyQt5/uic/pyuic.py
Python
gpl-2.0
1,079
0
#coding=utf-8 import httplib import urllib, urllib2 import json import base64 import functools import logging import time class RequestApi(object): TimeOut = 3 DEBUG_LEVEL = 1 HOST = "api.douban.com" @classmethod def request(cls, method, path, params, headers={}, host=''): """test --- ...
lisawei/api_automate_test
base.py
Python
apache-2.0
1,990
0.00603
"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain.""" import logging from random import randint from typing import Optional from aiopvpc import PVPCData from homeassistant import config_entries from homeassistant.const import CONF_NAME, ENERGY_KILO_WATT_HOUR from homeassistant.core impo...
nkgilley/home-assistant
homeassistant/components/pvpc_hourly_pricing/sensor.py
Python
apache-2.0
5,339
0.001499
#!/usr/bin/env python # # $Id: sign1.py 363 2006-01-01 18:03:07Z valos $ # # PyXMLSec example: Signing a template file. # # Signs a template file using a key from PEM file # # Usage: # ./sign1.py <xml-tmpl> <pem-key> # # Example: # ./sign1.py sign1-tmpl.xml rsakey.pem > sign1-res.xml # # The result signature could be ...
aricaldeira/pyxmlsec
examples/sign1.py
Python
gpl-2.0
3,625
0.006345
import pytest from julia.core import JuliaOptions # fmt: off @pytest.mark.parametrize("kwargs, args", [ ({}, []), (dict(compiled_modules=None), []), (dict(compiled_modules=False), ["--compiled-modules", "no"]), (dict(compiled_modules="no"), ["--compiled-modules", "no"]), (dict(depwarn="error"), [...
JuliaLang/pyjulia
src/julia/tests/test_juliaoptions.py
Python
mit
1,232
0
''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command line will cause smsd stop for a while ''' def ...
lubao/UjU_Windows
src/GammuSender.py
Python
mit
1,013
0.008885
# !/usr/bin/python # -*- coding: cp1252 -*- # ################################################################################## # # Copyright 2016 Félix Brezo and Yaiza Rubio (i3visio, contacto@i3visio.com) # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the terms of...
i3visio/osrframework
osrframework/wrappers/pending/streakgaming.py
Python
agpl-3.0
4,315
0.009042
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by ...
RedhawkSDR/integration-gnuhawk
components/sig_source_i/tests/test_sig_source_i.py
Python
gpl-3.0
4,531
0.006621
""" This module handles parsing the AWS Billing Reports (stored on S3 in .zip or just plain .csv format) and creating metrics to be sent to the WF proxy. """ import ConfigParser import datetime import io import os import sys import time import traceback import zipfile import logging.config import dateutil from wave...
wavefrontHQ/wavefront-collector
wavefront/awsbilling.py
Python
apache-2.0
17,443
0.001433
import unittest from rx import Observable from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable from rx.disposables import Disposable, SerialDisposable on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed on_error = ReactiveTest.on_error subscribe = ReactiveTest.subscribe sub...
dbrattli/RxPY
tests/test_observable/test_withlatestfrom.py
Python
apache-2.0
14,723
0.001019
""" E-commerce Tab Instructor Dashboard Coupons Operations views """ from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist from django.db.models import Q from django.views.decorators.http import require_POST from django.utils.translation import ugettext as _ fro...
xiandiancloud/edxplaltfom-xusong
lms/djangoapps/instructor/views/coupons.py
Python
agpl-3.0
6,252
0.003039
# -*- coding: utf-8 -*- # This file is part of emesene. # # emesene 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. # #...
tiancj/emesene
emesene/e3/common/utils.py
Python
gpl-3.0
2,941
0.00306
from __future__ import annotations import pytest import scitbx.matrix from cctbx import crystal, sgtbx, uctbx from cctbx.sgtbx import bravais_types from dxtbx.model import Crystal from dials.algorithms.indexing import symmetry @pytest.mark.parametrize("space_group_symbol", bravais_types.acentric) def test_Symmetry...
dials/dials
tests/algorithms/indexing/test_symmetry.py
Python
bsd-3-clause
7,130
0.001823
# unit tests for ansible fact collectors # -*- coding: utf-8 -*- # # 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. # # Ansibl...
tux-00/ansible
test/units/module_utils/facts/test_collectors.py
Python
gpl-3.0
12,595
0.001032
# Copyright (c) 2012-2020, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSProperty, AWSObject, Tags from .validators import json_checker, boolean class IEMap(AWSProperty): props = { 'ACCOUNT': ([basestring], False), } class Policy(AWSObject...
ikben/troposphere
troposphere/fms.py
Python
bsd-2-clause
1,072
0
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE # This is a simple test variable for the interaction of gridcells and households. from opus_core.variables.variable import Variable from urbansim.functions import attribute_label class age_...
christianurich/VIBe2UrbanSim
3rdparty/opus/src/paris/household_x_neighborhood/age_lnprice.py
Python
gpl-2.0
1,876
0.032516
""" Tests for configuration file parsers, ... """ from ConfigParser import RawConfigParser import io import os import textwrap import pytest from ardomino.conf import (process_conf_files, find_configuration_files, create_conf_parser) @pytest.fixture def conf_di...
rshk/ardomino-api
ardomino/tests/test_configuration.py
Python
bsd-3-clause
3,008
0
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('crowdsourcing', '0040_auto_20150824_2013'), ] operations = [ migrations.AlterModelOptions( name='comment', ...
xasos/crowdsource-platform
crowdsourcing/migrations/0041_auto_20150825_0240.py
Python
mit
1,146
0.001745
from django.apps import AppConfig from django.utils.translation import gettext_lazy as _ class FormDesignerConfig(AppConfig): name = 'form_designer' verbose_name = _("Form Designer")
kcsry/django-form-designer
form_designer/apps.py
Python
bsd-3-clause
193
0
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import pymongo class CrawlerPipeline(object): def __init__(self, mongo_uri, mongo_db): self.mongo_uri = mongo_ur...
OnFTA/scrapy-training
crawler_film/crawler_film/pipelines.py
Python
mit
1,062
0.002825
# -*- coding: utf-8 -*- # # Jetlibs documentation build configuration file, created by # sphinx-quickstart on Wed Dec 23 16:22:13 2015. # # 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 # autogenerated file. # # A...
jetspace/jetlibs
docs/source/conf.py
Python
mit
10,239
0.006739
# # A test file for the `processing` package # import time, sys, random from Queue import Empty import processing # may get overwritten #### TEST_VALUE def value_func(running, mutex): random.seed() time.sleep(random.random()*4) mutex.acquire() print '\n\t\t\t' + ...
seishei/multiprocess
py2.5/examples/ex_synchronize.py
Python
bsd-3-clause
6,159
0.004221
#!/usr/bin/env python3 import pexpect import sys import argparse import logging from logging import StreamHandler import traceback import os import quik from quik import Template import fileinput import re import tarfile import fnmatch ROOTLOGGER = logging.getLogger("seafileinstaller") class SeafileInstaller: @stat...
aacebedo/raspbian-docker-images
seafile/files/seafile-installer.py
Python
gpl-3.0
9,507
0.019565
''' David Rodriguez Goal: Continuously looping while to perform valve actions at specified times, introduce substance at a specific ratio based on flow data, recording and saving flow data, and actuating a flush at a specified time. Inputs: A schedule of events based on entered times. Outputs: Sequence of e...
dotsonlab/AWSC-Toilet
flow.py
Python
mit
2,391
0.013802
import wx import functions infoItems=[ ("active time", functions.FormatTime), ("active workers", None), ("active tasks", None), ("tasks done", None), ("pending urls", None), ("unique urls found", None), ("bytes read", functions.FormatByte), ("processing speed", functions.FormatByteSpeed), ("c...
bauhaus93/webcrawler
ui_infopanel.py
Python
gpl-2.0
1,369
0.045289
import numpy as np #import scipy.io.wavfile #import scipy.signal import pysndfile import matplotlib.pyplot as plt plt.ion() def db2mag(d): return 10.0**(d/20.0) if __name__ == "__main__" : print('Synthesise clicks and sinusoids at regular time and frequencies') fs = 16000 syn = np.zeros(4*fs) ...
gillesdegottex/dfasma
test/synth_grid.py
Python
gpl-3.0
1,049
0.014299
""" ------------- theia.cli.tau ------------- Tau is a Text User Interface frontend for Theia. """
theia-log/theia
theia/cli/tau.py
Python
apache-2.0
100
0
from jbot import simulator def diagonal_moving(robot): robot.clear_messages() robot.send_message("moving diagonally") for m in range(0, 100): robot.move_left(1) robot.move_up(1) def directional_moving(robot): robot.send_message("moving down") robot.move_down(30) robot.send...
frozenjava/RobotSimulator
examples/robotFunctionality.py
Python
gpl-2.0
704
0.002841
#!/usr/bin/env python # -*- coding: utf-8 -*- import sqlite3 import os HOMEDIR=os.path.expanduser('~') DATABASENAME=os.path.join(HOMEDIR, ".fillBD.conf.sqlite") # ########################################################### # DB-Zugriff für die Profile class Database(): def __init__(self): self.dbname=DATABASEN...
dede67/FillBD2
Database.py
Python
gpl-3.0
7,228
0.019676
# -*- coding: utf-8 -*- #------------------------------------------------------------------------- # drawElements Quality Program utilities # -------------------------------------- # # Copyright 2015 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use t...
chadversary/deqp
scripts/caselist_diff.py
Python
apache-2.0
15,192
0.016522
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Pyunit for h2o.utils.typechecks.""" from __future__ import absolute_import, division, print_function import math from h2o import H2OFrame from h2o.exceptions import H2OTypeError, H2OValueError from h2o.utils.typechecks import (U, I, NOT, Tuple, Dict, numeric, h2ofram...
h2oai/h2o-3
h2o-py/tests/testdir_utils/pyunit_typechecks.py
Python
apache-2.0
6,106
0.001965
from mididings import * from launchpad_utils import * config( backend='jack-rt', client_name='launchpad', in_ports=[ 'Pad Keys', ], out_ports=[ 'To Pad', 'To PC', ] ) # FROM PAD TO PC # First the controls active = 0 muted = 127 UpperRow = (Filter(CTRL) >> CtrlValueF...
m4773rcl0ud/launchpaddings
launchpaddings.py
Python
gpl-3.0
4,694
0.003409
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from narcissus.settings import FLOWERS # Cache of actual flower classes. _narcissus_flowers = None def _get_flowers(): glob...
pombredanne/django-narcissus
narcissus/garden/__init__.py
Python
bsd-3-clause
1,221
0.001638
# -*- coding: utf-8 -*- # # Copyright (C) 2015 GNS3 Technologies Inc. # # 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 version. ...
GNS3/gns3-server
gns3server/compute/dynamips/nodes/device.py
Python
gpl-3.0
2,538
0
# Copyright 2015 Cisco Systems, 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 requi...
CiscoSystems/fabric_enabler
dfa/server/services/firewall/native/drivers/phy_asa.py
Python
apache-2.0
4,614
0
#!/usr/bin/env python3 import argparse import random import time def bin(number): return "{0:5b}".format(number).replace(' ','0') def initialize(population): return [bin(random.randint(0,31)) for x in range(0, population)] def evaluate(population): tuples = [] suma = 0 end = False for chav...
VictorRodriguez/personal
ec-ea/practices/pract2/sga.py
Python
apache-2.0
2,812
0.011024
#!/usr/bin/python3 class ClsAttribute: visibility_dict = {0 : "public", 1 : "private", 2 : "protected", 3 : "public"} #3 stands for implementation which is not implemented #so public is default here ...
Rihorama/dia2code
src/dia2code/classd/cls_attribute.py
Python
gpl-3.0
1,404
0.019231
#!/usr/bin/env python """ A unittest script for the Sample module. """ import unittest import json from cutlass import Sample from cutlass import MIXS, MixsException from CutlassTestConfig import CutlassTestConfig from CutlassTestUtil import CutlassTestUtil # pylint: disable=W0703, C1801 class SampleTest(unittest...
ihmpdcc/cutlass
tests/test_sample.py
Python
mit
13,059
0.000689
#!/usr/bin/env python # -*- coding: utf-8 -*- # # live-magic - GUI frontend to create Debian LiveCDs, etc. # Copyright (C) 2007-2010 Chris Lamb <lamby@debian.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 # t...
debian-live/live-magic
tests/test_sources_list.py
Python
gpl-3.0
4,591
0.004356
# # Copyright 2014 Mingyuan Xia (http://mxia.me) and others # # 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 la...
mcgill-cpslab/MonkeyHelper
examples/DroidReplayer.py
Python
apache-2.0
2,426
0.004534
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Thierry Sallé (@seuf) # 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 ANSIBLE_METADATA = { 'status': ['preview'], 'supported_by': 'com...
sgerhart/ansible
lib/ansible/modules/monitoring/grafana_dashboard.py
Python
mit
14,915
0.002749
# Copyright 2012 Nebula, 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 agree...
openstack/horizon
openstack_dashboard/dashboards/project/instances/tables.py
Python
apache-2.0
48,198
0
# coding=utf-8 import mock from lxml import html from wtforms import ValidationError from dmapiclient.errors import HTTPError from app.main.helpers.frameworks import question_references from .helpers import BaseApplicationTest class TestApplication(BaseApplicationTest): def setup_method(self, method): s...
alphagov/digitalmarketplace-supplier-frontend
tests/app/test_application.py
Python
mit
4,526
0.001994
from __future__ import unicode_literals from six.moves import configparser import logging import copy import sys import sprinter.lib as lib EMPTY = object() logger = logging.getLogger(__name__) class ParamNotFoundException(Exception): """ Exception for a parameter not being found """ class FeatureConfig(obje...
toumorokoshi/sprinter
sprinter/core/featureconfig.py
Python
mit
4,648
0.000645
from setuptools import setup setup( name='flaskr', packages=['flaskr'], include_package_data=True, install_requires=[ 'flask', ], )
UMTti/mauno
setup.py
Python
mit
160
0.00625
#!/usr/bin/env python """ jsonxs uses a path expression string to get and set values in JSON and Python datastructures. For example: >>> d = { ... 'feed': { ... 'id': 'my_feed', ... 'url': 'http://example.com/feed.rss', ... 'tags': ['devel', 'example', 'python'], ... 'short....
fboender/jsonxs
jsonxs/jsonxs.py
Python
mit
5,644
0.000886
# Copyright 2018 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/cog
cognitive/train_utils.py
Python
apache-2.0
9,504
0.00947
"""semiotweet 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') Class...
jjerphan/semiotweet
semiotweet/urls.py
Python
gpl-3.0
857
0
import numpy as np import lmbases def test_against_r_splines_uniform(): '''Compare BSplines class against R's bsplines with uniform knots. Generate the ground truth with the following R commands: > library(splines) > x <- c(1.5, 3.3, 5.1, 7.2, 9.9) > k <- c(2.5, 5.0, 7.5) > b <- bs(x, knots...
pschulam/lmbases
tests/test_bsplines.py
Python
mit
2,966
0.001349
from urlparse import urlparse from api_tests.nodes.views.test_node_contributors_list import NodeCRUDTestCase from nose.tools import * # flake8: noqa from api.base.settings.defaults import API_BASE from framework.auth.core import Auth from tests.base import fake from osf_tests.factories import ( ProjectFactory, ...
monikagrabowska/osf.io
api_tests/registrations/views/test_withdrawn_registrations.py
Python
apache-2.0
7,865
0.003687
#Main GWR classes #Offset does not yet do anyhting and needs to be implemented __author__ = "Taylor Oshan Tayoshan@gmail.com" import numpy as np import numpy.linalg as la from scipy.stats import t from .kernels import * from .diagnostics import get_AIC, get_AICc, get_BIC import pysal.spreg.user_output as USER from c...
CartoDB/crankshaft
src/py/crankshaft/crankshaft/regression/gwr/base/gwr.py
Python
bsd-3-clause
39,275
0.004328
py_object = object import pixie.vm.object as object from pixie.vm.object import affirm from pixie.vm.primitives import nil, true, false from rpython.rlib.rarithmetic import r_uint from rpython.rlib.jit import elidable, elidable_promote, promote import rpython.rlib.jit as jit import pixie.vm.rt as rt BYTECODES = ["LOA...
heyLu/pixie
pixie/vm/code.py
Python
gpl-3.0
25,247
0.002812
import importlib from kivy.animation import AnimationTransition from kivy.properties import StringProperty from kivy.uix.screenmanager import TransitionBase from kivy.uix.screenmanager import (WipeTransition, SwapTransition, FadeTransition, FallOutTransition, ...
missionpinball/mpf-mc
mpfmc/uix/transitions.py
Python
mit
5,152
0
# 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...
jbedorf/tensorflow
tensorflow/python/ops/init_ops_v2.py
Python
apache-2.0
26,725
0.004041
import numpy as np import pandas as pd import datetime as dt def initiate_procedure(): results = pd.DataFrame(columns=('Responses', 'Value', 'Reversal', 'Run', 'Trial', 'Direction', 'DateTime')) return results def append_result(res, resp, down, up, stepSize...
codles/UpDownMethods
UpDownMethods/process.py
Python
mit
5,746
0
""" .. module:: system_data :platform: linux :synopsis: The module containing the system data. .. moduleauthor:: Paul Fanelli <paul.fanelli@gmail.com> .. modulecreated:: 6/26/15 """ import bunch import sys from yaml.parser import ParserError from zope.interface import implements from planet_alignment.data.inte...
paulfanelli/planet_alignment
planet_alignment/data/system_data.py
Python
mit
1,159
0.000863
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) 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, ...
gw-sd-2016/Codir
codirSublime/SocketIO/websocket/_app.py
Python
gpl-2.0
10,235
0.002833
import asyncio import logging from typing import Text from rasa.core.agent import Agent from rasa.shared.utils.cli import print_info, print_success from rasa.shared.utils.io import json_to_string logger = logging.getLogger(__name__) def run_cmdline(model_path: Text) -> None: """Loops over CLI input, passing eac...
RasaHQ/rasa_nlu
rasa/nlu/run.py
Python
apache-2.0
803
0.001245
# -*- coding: utf-8 -*- """ Created on Fri Jul 27 10:08:25 2018 @author: cdeline Using pytest to create unit tests for gencumulativesky. Note that this can't be included in the repo until TravisCI has a Linux version of gencumsky set up in .travis.yml to run unit tests, run pytest from the command line in the bifaci...
NREL/bifacial_radiance
tests/test_gencumsky.py
Python
bsd-3-clause
4,169
0.010794
#!/usr/bin/env python """ obs === :copyright: (c) 2015 Functional Software, Inc :license: Apache 2.0, see LICENSE for more details. """ from __future__ import absolute_import, unicode_literals import os.path from setuptools import setup, find_packages # Hack to prevent stupid "TypeError: 'NoneType' object is not c...
getsentry/obs
setup.py
Python
apache-2.0
1,534
0
# 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...
kobejean/tensorflow
tensorflow/python/profiler/model_analyzer_test.py
Python
apache-2.0
33,231
0.009088
from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns import views urlpatterns = [ url(r'^firms/$', views.FirmList.as_view()), url(r'^firms/(?P<pk>[0-9]+)/$', views.FirmDetail.as_view()), url(r'^firms/next/$', views.NextFirmDetail.as_view()), url(r'^bio-pages/$...
sunlightlabs/hanuman
data_collection/urls.py
Python
bsd-3-clause
730
0.00137
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para megadrive # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # by DrZ3r0 # ------------------------------------------------------------ import re from core import logger from core...
orione7/Italorione
servers/megadrive.py
Python
gpl-3.0
1,956
0.002559
#!/usr/bin/env python3 from shutil import rmtree from os import remove, path from crawler.swiftea_bot.data import BASE_LINKS URL = "http://aetfiws.ovh" SUGGESTIONS = ['http://suggestions.ovh/page1.html', 'http://suggestions.ovh/page2.html'] CODE1 = """<!DOCTYPE html> <html lang="en"> <head> <meta char...
Swiftea/Crawler
crawler/tests/test_data.py
Python
gpl-3.0
2,567
0.007803
""" Settings for inventory """ from .base import * try: from .local import * except ImportError, exc: exc.args = tuple( ['%s (did you rename settings/local-dist.py?)' % exc.args[0]]) raise exc
sloria/device-inventory
inventory/settings/__init__.py
Python
bsd-3-clause
214
0
#!/usr/bin/env python # Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # *...
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_input.py
Python
gpl-3.0
2,580
0.001163
from crossepglib import CrossEPG_Config from crossepg_main import crossepg_main from crossepg_locale import _ from Plugins.Plugin import PluginDescriptor def setup(menuid, **kwargs): if menuid == "setup": return [("CrossEPG", crossepg_main.setup, "crossepg", None)] else: return [] def call_downloader(session, *...
tectronics/crossepg
src/enigma2/python/plugin.py
Python
lgpl-2.1
2,321
0.046963
#!/usr/bin/python import socket def server_test(): s = socket.socket() host = socket.gethostname() port = 12345 s.bind((host, port)) s.listen(5) while True: c, addr = s.accept() print c print 'connect addr: ', addr c.send('Welcome to CaiNiao!') if cmp(c...
jianwei1216/my-scripts
mytest/python/MyInternet/myserver.py
Python
gpl-2.0
400
0.0025
import sys, os, json physical_addess = '' node_info = None def getMacAddress(): if sys.platform == 'win32': for line in os.popen("ipconfig /all"): if line.lstrip().startswith('Physical Address'): mac = line.split(':')[1].strip().replace('-',':') break else: ...
rafaelbezerra-dev/PlantMonitoringSystem
monitoring_node/node.py
Python
gpl-3.0
1,138
0.011424
import template as t def test_template_once(inp, vals, funcs, output): actual = t.Template(inp).parse(vals, funcs) print (inp, vals, funcs, output, actual) assert(actual == output) print True def test_basic_vals_0(): test_template_once("", {}, {}, "") test_template_once("HI", {}, {}, "HI") de...
wnavarre/email-dictator
script/template_test.py
Python
mit
1,955
0.008184
from dbconnect import connection from flask import Flask, render_template @app.route('/index/') def display_data(): try: c, conn = connection() query = "SELECT * from sensors" c.execute(query) data = c.fetchall() conn.connection() #return data return render_template("in...
wikkii/raspluonto
old/python_flask/old/main.py
Python
mit
388
0.064433
# coding:utf-8 ##### package test ##### import sys sys.path = ['../']+sys.path ################ from expy import * # Import the needed functions start() # Initiate the experiment environment '''General usage''' # Draw a picture on the canvas center drawPic('data/demo.jpg') show(3) # Display current canvas '''''' ...
ray306/expy
test/show_picture.py
Python
gpl-3.0
882
0.004535
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
wevoice/wesub
apps/videos/rpc.py
Python
agpl-3.0
11,527
0.002429
# -*- coding: utf-8 -*- from plone import api from plone.app.mosaic import _ from zope.publisher.browser import BrowserView import json class MosaicUploadView(BrowserView): """Handle file uploads""" def __call__(self): context = self.context request = self.request # Set header to js...
plone/plone.app.mosaic
src/plone/app/mosaic/browser/upload.py
Python
gpl-2.0
3,388
0
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
TheTimmy/spack
var/spack/repos/builtin/packages/namd/package.py
Python
lgpl-2.1
5,455
0.000183
#!/usr/bin/python import pygame import enemies from core import balloon, bullet, game, gem, particle, player, world from scenes import credits, scene, splashscreen from ui import menu, text from utils import prettyprint, utility, vector from utils.settings import * pygame.init() utility.read_settings() if settings...
JoshuaSkelly/TroubleInCloudLand
main.py
Python
mit
12,372
0.003476
import flask_login import logging from flask import jsonify, request from server import app, user_db from server.auth import user_mediacloud_client, user_name, user_admin_mediacloud_client,\ user_is_admin from server.util.request import form_fields_required, arguments_required, api_error_handler logger = logging....
mitmedialab/MediaCloud-Web-Tools
server/views/topics/topiclist.py
Python
apache-2.0
4,869
0.002875
# vim: set fileencoding=utf-8 : # Copyright (C) 2008 Joao Paulo de Souza Medeiros # # Author(s): Joao Paulo de Souza Medeiros <ignotus21@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 Foundat...
jpzm/bw
__init__.py
Python
gpl-2.0
1,267
0
# -*- coding: utf-8 -*- """ 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 version. This program is distributed in...
wangjun/pyload
module/plugins/crypter/YoutubeBatch.py
Python
gpl-3.0
6,087
0.003286
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
valentin-krasontovitsch/ansible
lib/ansible/modules/cloud/openstack/_os_server_actions.py
Python
gpl-3.0
533
0.003752