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
""" Visualization module. """ import numpy as np from matplotlib import animation import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes from mpl_toolkits.axes_grid1.inset_locator import mark_inset from pca import create_handles i...
mdeff/ntds_2017
projects/reports/terrorist_attacks/project/visualization.py
Python
mit
8,333
0.022081
TestNet = False Address = "1MjeEv3WDgycrEaaNeSESrWvRfkU6s81TX" workerEndpoint = "3333" DonationPercentage = 0.0 Upnp = True BitcoindConfigPath = "/opt/bitcoin/bitcoindata/bitcoin.conf" WORKER_STATUS_REFRESH_TIME = 10 dbService = {} workerStatus = {} NodeService = { 'authentication': 'http://127.0.0.1:8080/servi...
bitmaintech/p2pool
config.py
Python
gpl-3.0
545
0
DEBUG = False TEMPLATE_DEBUG = DEBUG TIME_ZONE = 'UTC' LANGUAGE_CODE = 'en-US' SITE_ID = 1 USE_L10N = True USE_TZ = True SECRET_KEY = 'local' CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', } } DATABASES = { 'default': { 'ENGINE': 'django.db.backends.s...
dmpayton/django-flanker
tests/settings.py
Python
mit
609
0
# Check translations of pango markup # # This will look for translatable strings that appear to contain markup and # check that the markup in the translation matches. # # Copyright (C) 2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subjec...
wgwoods/anaconda
translation-canary/translation_canary/translated/test_markup.py
Python
gpl-2.0
2,842
0.002463
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Mar 30 09:25:09 2018 @author: deborahkhider Script to batch download LiPD files from the wiki after query """ # 1. Query the wiki (note this is taken directly from the Jupyter Notebook on # GitHub) The query can be changed but doesn't matter in the gr...
nickmckay/LiPD-utilities
Python/lipd/retreive_dataset.py
Python
gpl-2.0
12,806
0.003983
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Johann Prieur <johann.prieur@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 License, or # (at your option) an...
Kjir/papyon
papyon/gnet/proxy/SOCKS4.py
Python
gpl-2.0
4,827
0.002486
""" Certificate HTML webview. """ from datetime import datetime from uuid import uuid4 import logging import urllib from django.conf import settings from django.contrib.auth.models import User from django.http import HttpResponse from django.template import RequestContext from django.utils.translation import ugettext ...
don-github/edx-platform
lms/djangoapps/certificates/views/webview.py
Python
agpl-3.0
23,455
0.00469
# lint-amnesty, pylint: disable=missing-module-docstring from django.apps import AppConfig from django.conf import settings class ThirdPartyAuthConfig(AppConfig): # lint-amnesty, pylint: disable=missing-class-docstring name = 'common.djangoapps.third_party_auth' verbose_name = "Third-party authentication" ...
edx/edx-platform
common/djangoapps/third_party_auth/apps.py
Python
agpl-3.0
919
0.003264
from django.template.response import TemplateResponse from ddah_web.models import DDAHInstanceWeb, DdahFlatPage from django.views.generic.detail import DetailView from pystache import Renderer from django.http import HttpResponse from django.shortcuts import get_object_or_404 import markdown from django.utils.safestrin...
goinnn/deldichoalhecho
ddah_web/views.py
Python
gpl-3.0
3,903
0.000769
def collect_vowels(s): """ (str) -> str Return the vowels (a, e, i, o, and u) from s. >>> collect_vowels('Happy Anniversary!') 'aAiea' >>> collect_vowels('xyz') '' """ vowels = '' for char in s: if char in 'aeiouAEIOU': vowels = vowels + char return vowel...
fasaas/owne-coursera
documentation/Crafting-Quality-Code/Doctest/vowels.py
Python
apache-2.0
653
0
# -*- coding: utf-8 -*- """ This file is part of pyCMBS. (c) 2012- Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE file """ from cdo import Cdo from pycmbs.data import Data import tempfile as tempfile import copy import glob import os import sys import numpy as np from pycmbs.benchmarking ...
pygeo/pycmbs
pycmbs/benchmarking/models/mpi_esm.py
Python
mit
41,720
0.004938
import http import json import asyncio import aiohttp import oauthlib.oauth1 from waterbutler.core import streams from waterbutler.core import provider from waterbutler.core import exceptions from waterbutler.core.path import WaterButlerPath from waterbutler.providers.figshare import metadata from waterbutler.provid...
Ghalko/waterbutler
waterbutler/providers/figshare/provider.py
Python
apache-2.0
13,916
0.001653
""" Deployment for Bedrock in production. Requires commander (https://github.com/oremj/commander) which is installed on the systems that need it. """ import os import random import re import urllib import urllib2 from commander.deploy import commands, task, hostgroups import commander_settings as settings NEW_RELI...
waseem18/bedrock
bin/update/deploy_base.py
Python
mpl-2.0
5,260
0.00019
from .db import SingleDBMiddleware, MultiDBMiddleware, get_db, get_user, get_request
mrmuxl/keops
keops/middleware/__init__.py
Python
agpl-3.0
85
0.011765
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ShortURL.collect_date' db.add_column('shortim_shorturl', 'collect_date', self.gf('django.d...
arthurfurlan/django-shortim
src/shortim/migrations/0002_auto__add_field_shorturl_collect_date__add_field_shorturl_title__add_f.py
Python
gpl-3.0
2,839
0.007045
# Copyright 2014 Cloudbase Solutions Srl # 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 r...
HybridF5/jacket
jacket/tests/compute/unit/virt/hyperv/test_livemigrationops.py
Python
apache-2.0
5,845
0
import requests import json def generate_apps(): apps = [{'id': '/app-{}'.format(i), 'cmd': 'sleep 3600', 'cpus': 0.1, 'mem': 32, 'instances': 0} for i in range(1000)] groups = {'id': '/', 'groups': [], 'apps': apps} return groups def main(): apps = generate_apps() r = requests.put("http://localh...
mesosphere/marathon
tests/performance/apps.py
Python
apache-2.0
445
0.011236
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import from digits.utils import subclass, override, constants from digits.extensions.data.interface import DataIngestionInterface from .forms import DatasetForm, InferenceForm import numpy as np import os TEMPLATE = "temp...
bygreencn/DIGITS
plugins/data/imageGradients/digitsDataPluginImageGradients/data.py
Python
bsd-3-clause
3,492
0.001145
from __future__ import division import unittest import itertools import numpy from chainer import iterators from chainer import serializer from chainer import testing class DummySerializer(serializer.Serializer): def __init__(self, target): super(DummySerializer, self).__init__() self.target = ...
rezoo/chainer
tests/chainer_tests/iterators_tests/test_iterator_compatibility.py
Python
mit
2,915
0
#!/usr/bin/env python # -*- coding: utf-8 -*- ## Based on learner.js (by Blake Allen and Michael Becker) import itertools import collections from collections import defaultdict import pdb import phoment class Change(object): def __init__(self, change_type, position, input_material, output_material): ...
bhallen/pyparadigms
hypothesize.py
Python
bsd-3-clause
15,896
0.006102
import json import unittest from logging import INFO, LogRecord from foil.logger import JSONFormatter class TestLogFormatter(unittest.TestCase): def test_json_formatter(self): name = 'name' line = 42 module = 'some_module' func = 'some_function' msg = {'content': 'sample l...
portfoliome/foil
tests/test_logger.py
Python
mit
936
0
''' Build the pipeline workflow by plumbing the stages together. ''' from ruffus import Pipeline, suffix, formatter, add_inputs, output_from from stages import Stages def make_pipeline(state): '''Build the pipeline by constructing stages and connecting them together''' # Build an empty pipeline pipeline ...
bjpop/complexo_pipeline
src/pipeline.py
Python
bsd-3-clause
6,819
0.002346
#! /user/bin/python #! -*- coding: utf-8 -*- import sys import urllib, urllib2 import json """ Reversion HeyooDic Transfer from unoffical API to offical API Chrisplus 2014-6 """ # Key and name url = "http://fanyi.youdao.com/openapi.do?%s" keyFrom = "SunnyArtStudio" key = "1884243682" dataType = "data" docType = "jso...
Chrisplus/HeyoDict
Dict.py
Python
gpl-2.0
2,929
0.034141
import pytest import doctest from insights.parsers import docker_inspect, SkipException from insights.tests import context_wrap DOCKER_CONTAINER_INSPECT = """ [ { "Id": "97d7cd1a5d8fd7730e83bb61ecbc993742438e966ac5c11910776b5d53f4ae07", "Created": "2016-06-23T05:12:25.433469799Z", "Path": "/bin/bash", ...
RedHatInsights/insights-core
insights/parsers/tests/test_docker_inspect.py
Python
apache-2.0
10,303
0.002038
# Copyright (C) 2016 Scott Rome. 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 ...
srome/jacksearch
search.py
Python
apache-2.0
922
0.007592
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.coils import CoilHeatingDxVariableSpeed log = logging.getLogger(__name__) class TestCoilHeatingDxVariableSpeed(unittest.TestCase): def setUp(self): self.fd, self.pa...
rbuffat/pyidf
tests/test_coilheatingdxvariablespeed.py
Python
apache-2.0
38,214
0.005548
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2018, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
jakereps/qiime-workshops
config/urls/callback.py
Python
bsd-3-clause
890
0
import cmath n = complex(input()) print(abs(n)) print(cmath.phase(n))
jaswal72/hacker-rank
Python/Math/Polar_Coordinates.py
Python
mit
69
0.014493
from fontTools.misc import transform from fontParts.base import normalizers from fontParts.base.errors import FontPartsError from fontParts.base.base import ( BaseObject, TransformationMixin, InterpolationMixin, PointPositionMixin, SelectionMixin, IdentifierMixin, dynamicProperty, refere...
robofab-developers/fontParts
Lib/fontParts/base/component.py
Python
mit
11,222
0.000089
# -*- 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): pass def backwards(self, orm): pass models = { } ...
r-singh/Test2
webapp_project/website/migrations/0003_initial.py
Python
mit
351
0.005698
# -*- coding: utf-8 -*- """ Test debug interface ~~~~~~~~~~~~~~~~~~~~ Tests the traceback rewriter. :copyright: (c) 2009 by the Jinja Team. :license: BSD. """ from jinja2 import Environment from test_loaders import filesystem_loader env = Environment(loader=filesystem_loader) def test_runtime_e...
yesudeep/tisshrmlr
app/jinja2/tests/test_debug.py
Python
mit
1,268
0
from annoying.functions import get_object_or_None from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend from django.db.models import Q # Class to permit the authentication using email or username, with case sensitive and insensitive matches. class CustomBackend(ModelBack...
astrobin/astrobin
astrobin/auth.py
Python
agpl-3.0
1,134
0.002646
from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.conf import settings from django.views.generic import TemplateView from views import RobotsView from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', TemplateView.as_vi...
patrickbeeson/diy-trainer
diytrainer/diytrainer/preview_urls.py
Python
mit
761
0.001314
# coding: utf-8 """Find the path to picasso dynamic library files.""" import os import platform import sys class PicassoLibraryNotFound(Exception): """Error thrown by when picasso is not found""" pass def find_lib_path(): """Find the path to picasso dynamic library files. :return: List of all found ...
jasonge27/picasso
python-package/pycasso/libpath.py
Python
gpl-3.0
1,608
0.003731
from __future__ import unicode_literals from django.contrib import admin from django.contrib.contenttypes import generic from codebase.models import SingleCodeReference, CodeSnippet from doc.models import Document, Page, Section, DocDiff, SectionChanger,\ LinkChange class SingleCodeReferenceInline(generic.Gen...
bartdag/recodoc2
recodoc2/apps/doc/admin.py
Python
bsd-3-clause
2,534
0.001184
""" Copyright EMC Corporation 2015. Distributed under the MIT License. (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) """ """ Class to store parsed WADL and XSD data. """ class CLIInputs: wadl_context = dict() xsd_elements_dict = dict() unknown_xsd_elements_dict = dict() ...
santidltp/viprcommand
ViPRCommand/bin/CLIInputs.py
Python
mit
1,681
0.009518
""" Module containing the SensorArray class which models an array of FMCW radars. @author: scj robertson @since: 03/04/16 """ import numpy as np C = 3e8 class SensorArray(object): ''' Class for representing an array of identical FMCW radars. For viable multilateration four or more sensors must always b...
scjrobertson/xRange
kalman/sensor_array.py
Python
gpl-3.0
2,075
0.004337
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-05-04 15:51 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("dataedit", "0008_auto_20170504_1651")] operations = [ migrations.AddField( m...
openego/oeplatform
dataedit/migrations/0009_tablerevision_path.py
Python
agpl-3.0
488
0
from oslo_config import cfg OPTS = [ cfg.StrOpt('openhab_config_dir', default='/opt/openhab/config', help='The openhab configuration path'), cfg.StrOpt('mqtt_id', default='mosquitto', help='The mqtt id inside openhab config' 'to co...
ohaut/ohaut-core
ohaut/config.py
Python
gpl-3.0
1,064
0.00188
# # Copyright 2012 Red Hat, Inc # # Author: Eoghan Glynn <eglynn@redhat.com> # # 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...
lcostantino/healing-os
external/ceilometer/compute/virt/libvirt/inspector.py
Python
apache-2.0
8,169
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...
todaychi/hue
desktop/core/ext-py/thrift-0.9.1/src/transport/TSocket.py
Python
apache-2.0
6,194
0.008718
def MinScalarProduct(vector1,vector2,case): vector1.sort(reverse=False) vector2.sort(reverse=True) scalarProduct=0 i=0 while i<len(vector1): scalarProduct+=vector1[i]*vector2[i] i+=1 return "Case #"+str(case)+": "+str(scalarProduct)+"\n" def readTestFile(inputFile,outputFile): ...
alexcasgarcia/GCJ
2008/1A/MinimumScalarProduct/MinScalarProduct.py
Python
mit
1,138
0.02812
__author__ = 'Javier' import urllib.request import json class Repo(object): def __init__(self, fork, stars, watchers): self._fork = int(fork) self._stars = int(stars) self._watchers = int(watchers) @property def forks(self): return self._fork @property def stars(s...
javierj/kobudo-katas
Kata-RestConsumer/DjangoGIndexDemo/gindex/gindex_logic/gindex.py
Python
apache-2.0
1,609
0.002486
import pickle from pueue.client.socket import connect_socket, receive_data, process_response def command_factory(command): """A factory which returns functions for direct daemon communication. This factory will create a function which sends a payload to the daemon and returns the unpickled object which ...
Nukesor/Pueuew
pueue/client/factories.py
Python
mit
2,761
0.001811
from openerp import fields from fields_utils import direct_mapper class FileField(fields.Binary): # type = 'binary' will auto inherit from the base class of Binary def __bika_2_odoo_attrs_mapping(self): direct_mapper(self, 'description', 'help') def _setup_regular_base(self, model)...
sciCloud/OLiMS
fields/file_field.py
Python
agpl-3.0
449
0.01559
#!/usr/bin/env python from __future__ import division from __future__ import print_function # General libraries import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors import sys import argparse import datetime import getpass import os import time # OpenCV import cv2 #...
meteoswiss-mdr/precipattractor
pyscripts/radar_extrapolation.py
Python
gpl-3.0
15,346
0.015379
import ConfigParser import sys, traceback from slackclient import SlackClient from chatterbot import ChatBot import os from os import listdir from os.path import isfile, join from chatterbot.trainers import ChatterBotCorpusTrainer config = ConfigParser.SafeConfigParser({"host": "searchhub.lucidworks.com", "port":...
gsingers/rtfmbot
src/python/run.py
Python
mit
2,559
0.004299
#!/usr/bin/env python import socket import sys import os import time import random import csv import json import random from sentence_generator import make_sentence from copy import deepcopy from subprocess import check_output # csv file columns are timestamp, pressure, CO2, ... SAMPLE_DATA_DIR = os.path.join(os.pat...
breathe-free/breathe-see
example_publisher/__main__.py
Python
gpl-3.0
10,411
0.0073
""" Forwards events to a HTTP call. The configuration used by this notifier is as follows: url Full URL to contact with the event data. A POST request will be made to this URL with the contents of the events in the body. Eventually this should be enhanced to support authentication credentials as well. """ import...
rbramwell/pulp
server/pulp/server/event/http.py
Python
gpl-2.0
2,330
0.001717
from enable.api import ColorTrait from .base_patch_stylus import BasePatchStylus class RectangleStylus(BasePatchStylus): """ A Flyweight object for drawing filled rectangles. """ edge_color = ColorTrait('black') fill_color = ColorTrait('yellow') def draw(self, gc, rect): with gc: ...
tonysyu/deli
deli/stylus/rect_stylus.py
Python
bsd-3-clause
543
0
#!/usr/bin/python # -*- coding: utf-8 -*- """ Convenience functions for generating distinct colors. Usage: >>> generate_colors(4) [(1.0, 0.0, 0.0), (0.5, 1.0, 0.0), (0.0, 1.0, 1.0), (0.5, 0.0, 1.0)] """ from __future__ import division __author__ = 'Maarten Versteegh' import math def _hsv_to_rgb(h,f): """Conver...
mwv/babycircle
visualization/colors.py
Python
gpl-3.0
1,039
0.006737
# pylint: disable-msg=W0401,W0511,W0611,W0612,W0614,R0201,E1102 """Tests suite for MaskedArray & subclassing. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu """ from __future__ import division, absolute_import, print_function __author__ = "Pierre GF Gerard-Marchant" import warnings import pickle i...
argriffing/numpy
numpy/ma/tests/test_core.py
Python
bsd-3-clause
167,699
0.00102
import operator import functools from optparse import make_option from django.core.management.base import BaseCommand from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models import Q from django.utils import six from wagtail.wagtailcore.models import Page class Comma...
mephizzle/wagtail
wagtail/wagtailcore/management/commands/fixtree.py
Python
bsd-3-clause
5,041
0.004761
import csv import os from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand from django.utils import timezone from hub.apps.content.models import Author from hub.apps.content.types.presentations import Presentation from hub.apps.metadata.models import ( Organization, ...
AASHE/hub
hub/apps/content/management/commands/import_conf_presentations_2020.py
Python
mit
5,266
0.001709
import sys sys.path.insert(0,'../') if sys.version_info[:2] == (2,6): import unittest2 as unittest else: import unittest import os import lean import shutil import datetime import time from rivets_test import RivetsTest import rivets CACHE_PATH = os.path.relpath("../../.sass-cache", __file__) COMPASS_PATH = os.path...
OiNutter/rivets
test/test_scss.py
Python
mit
6,467
0.032473
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from mock import patch from oauthlib.oauth2 import LegacyApplicationClient from ....unittest import TestCase @patch('time.time', new=lambda: 1000) class LegacyApplicationClientTest(TestCase): client_id = "someclientid" scope ...
lepture/oauthlib
tests/oauth2/rfc6749/clients/test_legacy_application.py
Python
bsd-3-clause
2,383
0.002098
#!/usr/bin/env python import os import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Test label reading from an MNI tag file # # The current directory must be writeable. # try: fname = "mni-tagtest.tag" channel = open(fname, "wb") ...
timkrentz/SunTracker
IMU/VTK-6.2.0/IO/MINC/Testing/Python/TestMNITagPoints.py
Python
mit
3,826
0.000261
__author__="longuyen" __date__ ="$8-Feb-2013 3:29:44 AM$" from app.Welcome import Welcome from app.FlowControl import FlowControl if __name__ == '__main__': Welcome.disclaimer() control = FlowControl() control.start()
hiryou/pandora_extractor
src/PandoraExtractor.py
Python
mit
232
0.017241
# Copyright 2013 IBM Corp. # 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 app...
HybridF5/tempest_debug
tempest/services/orchestration/json/orchestration_client.py
Python
apache-2.0
16,844
0
#!/usr/bin/env python # Copyright (c) 2011 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. """Small utility function to find depot_tools and add it to the python path. Will throw an ImportError exception if depot_tools can...
yquant/gn-standalone
src/build/find_depot_tools.py
Python
apache-2.0
2,084
0.013436
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # 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, eit...
nishad-jobsglobal/odoo-marriot
openerp/addons/tapplicant_webcam/__openerp__.py
Python
agpl-3.0
1,685
0
from django.conf import settings from django.db.models import signals from django.utils.translation import ugettext_noop as _ if "notification" in settings.INSTALLED_APPS: from notification import models as notification def create_notice_types(app, created_models, verbosity, **kwargs): notificatio...
ericholscher/pinax
pinax/apps/projects/management.py
Python
mit
922
0.005423
# 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 (t...
apache/incubator-allura
Allura/allura/model/repo_refresh.py
Python
apache-2.0
23,508
0.000468
# encoding: utf-8 # # # 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from collections import Mapping import unittes...
klahnakoski/intermittents
pyLibrary/testing/fuzzytestcase.py
Python
mpl-2.0
5,448
0.006057
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-06-02 15:26 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('boards', '0071_auto_20170530_1711'), ('recurrent_card...
diegojromerolopez/djanban
src/djanban/apps/recurrent_cards/migrations/0002_auto_20170602_1726.py
Python
mit
2,903
0.0031
""" WSGI config for spardha 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("DJANGO_SETT...
vaishnavsm/spardha17
spardha/spardha/wsgi.py
Python
gpl-3.0
392
0
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Buron and Valeureux Copyright Valeureux.org # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
Valeureux/wezer-exchange
__unreviewed__/project_assignment/__openerp__.py
Python
agpl-3.0
1,833
0
import numpy, cairo, math from scipy import ndimage from .object3d import Object3d from .point3d import Point3d from .polygon3d import Polygon3d from .draw_utils import * from .colors import hsv_to_rgb, rgb_to_hsv def surface2array(surface): data = surface.get_data() if not data: return None rgb_a...
sujoykroy/motion-picture
editor/MotionPicture/commons/camera3d.py
Python
gpl-3.0
18,923
0.006394
"""Generate year files with news counts Usage: filter_news.py <directory> <output> <lang> Options: -h, --help """ from docopt import docopt from os import listdir from os.path import isfile, join, getsize import datetime from tqdm import * import pandas as pd def find_index(id, lis): for i in range(0, len(l...
geektoni/Influenza-Like-Illness-Predictor
data_analysis/filter_news.py
Python
mit
2,317
0.036254
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from __future__ import with_statement import os import pickle import random import subprocess import sys import time import unittest from test import support try: imp...
LaoZhongGu/kbengine
kbe/src/lib/python/Lib/test/test_capi.py
Python
lgpl-3.0
9,478
0.010762
''' Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but ...
MediaKraken/mkarchive
pipeline-deploy-os-server-ubuntu.py
Python
gpl-2.0
5,822
0.010649
import core.task import urllib2 class ExchangeFileWithRemoteTask(core.task.Task): def execute_task(self, parameters=None): self._check_mandatory_parameters(['path', 'remote_path'], parameters) path = parameters['path'] remote_path = parameters['remote_path'] with open(path, 'w+') as file_handle: response...
turekj/iDK
tasks/exchange_file_remote_task.py
Python
gpl-2.0
413
0.01937
# Copyright 2017 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...
drpngx/tensorflow
tensorflow/contrib/distributions/python/ops/vector_diffeomixture.py
Python
apache-2.0
44,484
0.004226
#!/usr/bin/env python3 """Generate an updated requirements_all.txt.""" import importlib import os import pkgutil import re import sys import fnmatch COMMENT_REQUIREMENTS = ( 'Adafruit-DHT', 'Adafruit_BBIO', 'avion', 'beacontools', 'blinkt', 'bluepy', 'bme680', 'credstash', 'decora',...
jamespcole/home-assistant
script/gen_requirements_all.py
Python
apache-2.0
10,045
0
# 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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_01_01_preview/aio/operations/_topics_operations.py
Python
mit
39,140
0.004778
from dateutil import parser from datetime import datetime def form_validation(form ,schema): err = _form_validation(form, schema) return (400, err) if err else None def _form_validation(form, schema): ''' schema: [{ ### require 'name': <str> # +<str> means require, defaul...
Tocknicsu/nctuoj_contest
backend/utils/form.py
Python
apache-2.0
3,213
0.008403
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: Alexander David Leech @date: 03/06/2016 @rev: 1 @lang: Python 2.7 @deps: YAML @desc: Class to use as an interface to import YAML files """ import yaml class yamlImport(): @staticmethod def importYAML(pathToFile): try: ...
FlaminMad/RPiProcessRig
RPiProcessRig/src/yamlImport.py
Python
mit
521
0.003839
from Database.Controllers.Disciplina import Disciplina class Prereq(object): def __init__(self,dados=None): if dados is not None: self.id = dados ['id'] self.grupo = dados ['grupo'] self.id_disc_pre = dados ['id_disc_pre'] def getId(self): return self.id def setGrupo(self,grupo): self.grupo = g...
AEDA-Solutions/matweb
backend/Database/Models/Prereq.py
Python
mit
654
0.055046
from django.shortcuts import render from enfermeriaapp.models import Cola_Consulta, Cola_Enfermeria from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.utils import timezone import time from django.contrib import messages from django.contrib.auth.decorators import login_requir...
anderson7ru/bienestarues
enfermeriaapp/views.py
Python
mit
4,242
0.016973
__author__ = 'himanshu' # TrayIcon class TrayIcon(Exception): pass
chennan47/OSF-Offline
osfoffline/exceptions/tray_icon_exceptions.py
Python
apache-2.0
73
0
from virttest import storage from virttest import qemu_storage from virttest import data_dir from autotest.client.shared import error import re import logging import time @error.context_aware def run_live_snapshot_chain(test, params, env): """ live_snapshot chain test: Will test snapshot as following ste...
spiceqa/virt-test
qemu/tests/live_snapshot_chain.py
Python
gpl-2.0
6,291
0.000159
from django.db import models from django.contrib.auth.models import User from django.conf import settings import os class Animal(models.Model): name = models.CharField(max_length=150) latin_name = models.CharField(max_length=150) count = models.IntegerField() def __unicode__(self): return self...
weigj/django-multidb
tests/regressiontests/fixtures_regress/models.py
Python
bsd-3-clause
5,996
0.002668
from autobreadcrumbs import site from django.utils.translation import ugettext_lazy site.update({ 'po_projects:project-index': ugettext_lazy('PO Projects'), 'po_projects:project-create': ugettext_lazy('Create a new project'), 'po_projects:project-details': ugettext_lazy('<small class="subhead">Project</sma...
sveetch/PO-Projects
po_projects/crumbs.py
Python
mit
697
0.004304
from os.path import isdir def conda_is_installed(conda_directory_path): return all( (isdir("{}/{}".format(conda_directory_path, name)) for name in ("bin", "lib")) )
UCSD-CCAL/ccal
ccal/conda_is_installed.py
Python
mit
184
0.005435
from django import forms from django.core import validators from comperio.accounts.models import cUser, Settings, cGroup from django.core.validators import email_re import random, datetime, sha MIN_PASSWORD_LENGTH = 6 class LoginForm(forms.Form): """account login form""" username = forms.CharField(widget=form...
neutrinog/Comperio
comperio/accounts/forms.py
Python
bsd-3-clause
8,980
0.010468
# -*- coding:utf-8 -*- import datetime import xml.etree.ElementTree as et import pony.orm as orm import sys import os pjoin = os.path.join __dir__ = os.path.abspath(os.path.dirname(__file__)) sys.path.append(__dir__) from server import * dat = dict( code = 'concefly', last_login = datetime.datetime.n...
concefly/indent_system
db_test.py
Python
gpl-3.0
598
0.078595
from django.db import models from metronus_app.model.actor import Actor from metronus_app.model.task import Task class GoalEvolution(models.Model): """ Each time the goal or the price per unit/hour from a task is changed, a new entry is created in the log Maybe should have been named TaskLog, but... "...
Metronus/metronus
Metronus-Project/metronus_app/model/goalEvolution.py
Python
mpl-2.0
791
0.001264
from __future__ import unicode_literals import re from django import forms from django.core.validators import RegexValidator from django.db import models from django.utils.translation import ugettext_lazy as _ class ColorInput(forms.TextInput): input_type = 'color' class ColorField(models.CharField): defa...
misli/cmsplugin-survey
cmsplugin_survey/fields.py
Python
bsd-3-clause
744
0
from MirrorAI.dataset.directional.label_image import label_image import numpy def test(): d = numpy.array([1, 1, 0]) answer = label_image(d, target=0) solution = [0, 0, 1] assert (answer == solution).all()
yuhangwang/MirrorAI
test/dataset/directional/label_image/test_3.py
Python
mit
224
0
# -*- coding: utf-8 -*- from classytags.arguments import Argument, MultiValueArgument from classytags.core import Options, Tag from classytags.helpers import InclusionTag from classytags.parser import Parser from cms.models import Page, Placeholder as PlaceholderModel from cms.plugin_rendering import render_plugins, re...
VillageAlliance/django-cms
cms/templatetags/cms_tags.py
Python
bsd-3-clause
14,804
0.003445
# Copyright 2021 Pure Storage 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 require...
openstack/manila
manila/share/drivers/purestorage/flashblade.py
Python
apache-2.0
17,837
0
from .RuleEditor import * class SeatingChart: def __init__(self, m, n): self.M, self.N = m, n self._pos = list(range(len(self))) self.names = None self.rule_editor = RuleEditor(m, n) self.maintain() def __len__(self) -> int: """Return the number of students in ...
hr567/seating-chart
SeatingChart/API/SeatingChart.py
Python
gpl-3.0
2,072
0
r""" ================================================== Feature computation for univariate time series ================================================== This sub-module provides routines for computing features on univariate time series. Many functions are improved version of PyEEG [PYEEG]_ functions. Be careful, som...
gilestrolab/pyrem
src/pyrem/univariate.py
Python
gpl-3.0
18,418
0.008579
# Copyright 2017 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...
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/tensorboard/version.py
Python
mit
744
0
#!/usr/bin/env python # coding: utf-8 import os import sys sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定 import numpy as np import matplotlib.pyplot as plt from dataset.mnist import load_mnist from common.util import smooth_curve from common.multi_layer_net import MultiLayerNet from common.optimizer import ...
kgsn1763/deep-learning-from-scratch
ch06/weight_init_compare.py
Python
mit
1,963
0.00429
#!/usr/bin/python """ Turns on an LED on for one second, then off for one second, repeatedly. Most Arduinos have an on-board LED you can control. On the Uno and Leonardo, it is attached to digital pin 13. If you're unsure what pin the on-board LED is connected to on your Arduino model, check the documentatio...
MrYsLab/pymata-aio
examples/blink.py
Python
agpl-3.0
1,345
0
import numpy as np def gr_indicators(chain, alpha=0.05): """Calculate the Gelman Rubin indicator of convergence. Also, calculate the interval based indicator presented in Brooks & Gelman 1998 """ nw, nstep, ndim = chain.shape # mean within each chain mean = chain.mean(axis=1) # varian...
bd-j/hmc
convergence.py
Python
gpl-2.0
1,867
0.009106
# Serial Photo Merge # Copyright (C) 2017 Simone Riva mail: simone.rva {at} gmail {dot} 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 3 of the License, or #(at your optio...
simon-r/SerialPhotoMerge
imgmerge/mergeProcedureVirtual.py
Python
gpl-3.0
2,752
0.00109
cases = [ ('pmt.py -s 1 -n 20 populations, first without state filter', 'pmt.py -s 1 -n 20 populations'), ('pmt.py -s 2 -n 20 populations filter3, state filter limits population to 3', 'pmt.py -s 2 -n 20 populations filter3') ]
nfredrik/pyModelStuff
samples/populations/test/test_filter.py
Python
bsd-3-clause
247
0.004049
import view try: view.main() except: print('Invalid List Format') view.terminate()
surru/Three-Musketeers-Game
multiagent/main.py
Python
mit
113
0.026549