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
# Copyright 2018 The Kubeflow Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
kubeflow/pipelines
components/gcp/container/component_sdk/python/tests/google/dataproc/test__submit_pig_job.py
Python
apache-2.0
1,768
0.007353
import json import requests from django.conf import settings from website.calendar.models import WeatherTypes, Calendar from django.conf import settings from datetime import datetime from django.core.management.base import BaseCommand class Command(BaseCommand): help = "Import the weather information" def ha...
samsath/skeleton
src/website/calendar/management/commands/import_weather.py
Python
gpl-3.0
1,499
0.006004
import re from bs4 import BeautifulSoup from scripts.features.feature_extractor import FeatureExtractor from scripts.data.cleaning import clean_code def clean_html_tags(html_text): soup = BeautifulSoup(html_text, 'html.parser') if soup.find("h") is not None: soup.find("h").extract() cleaned_text...
chakki-works/elephant_sense
scripts/features/charactor_extractor.py
Python
apache-2.0
3,901
0.002072
# TODO: let's see if we can get rid of this, it's garbage from django.contrib.admin import options, actions, sites from django.template import loader import jingo def django_to_jinja(template_name, context, **kw): """ We monkeypatch Django admin's render_to_response to work in our Jinja environment. We ...
akatsoulas/mozillians
lib/jinjautils.py
Python
bsd-3-clause
1,577
0
import re import sys import struct import codecs class REMatcher(object): def __init__(self, matchstring): self.matchstring = matchstring def match(self,regexp): self.rematch = re.match(regexp, self.matchstring, re.IGNORECASE) return bool(self.rematch) def group(self,i): ...
MoebiuZ/OpcodeOne
oldfiles/oldcode/tools/assemblerold/functions.py
Python
apache-2.0
5,835
0.048517
from __future__ import division from pyglet.gl import gl, glu class ModelView(object): ''' Manage modelview matrix, performing the MVC's 'view' parts of the 'camera' ''' def __init__(self, camera): self.camera = camera def set_identity(self): gl.glMatrixMode(gl.GL_MO...
tartley/pyweek11-cube
source/view/modelview.py
Python
bsd-3-clause
682
0.001466
""" WSGI config for WeatherForecast 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("DJA...
vinicius-ronconi/WeatherForecast
WeatherForecast/wsgi.py
Python
mit
408
0
from argparse import ArgumentParser import numpy as np from mpi4py import MPI from pySDC.helpers.stats_helper import filter_stats, sort_stats from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right from pySDC.implementations.controller_classes.controller_MPI import controller_MPI f...
Parallel-in-Time/pySDC
pySDC/projects/AllenCahn_Bayreuth/run_temp_forcing_benchmark.py
Python
bsd-2-clause
5,134
0.002922
################################################################################ # Copyright (C) 2014 Jaakko Luttinen # # This file is licensed under the MIT License. ################################################################################ """ """ import numpy as np from bayespy.utils import misc from .nod...
bayespy/bayespy
bayespy/inference/vmp/nodes/gate.py
Python
mit
7,980
0.001504
from PyQt4.QtCore import Qt from PyQt4.QtGui import QHBoxLayout from PyQt4.QtGui import QLabel from PyQt4.QtGui import QLineEdit from PyQt4.QtGui import QMessageBox from PyQt4.QtGui import QPixmap from PyQt4.QtGui import QPushButton from PyQt4.QtGui import QVBoxLayout from PyQt4.QtGui import QWidget import qtUtils fr...
kostyll/Cryptully
cryptully/qt/qNickInputWidget.py
Python
gpl-3.0
2,500
0.0024
# Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
cloudbase/nova
nova/tests/unit/policy_fixture.py
Python
apache-2.0
4,908
0.000204
#------------------------------------------------------------------------------- # Copyright 2017 Cognizant Technology Solutions # # 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:...
CognizantOneDevOps/Insights
PlatformAgents/com/cognizant/devops/platformagents/agents/alm/qtest/QtestAgent.py
Python
apache-2.0
18,777
0.002929
''' Nonlinear optimization by use of Affine DualAveraging @author: Maximilian Balandat @date: May 13, 2015 ''' import numpy as np from .Domains import nBox class NLoptProblem(): """ Basic class describing a Nonlinear Optimization problem. """ def __init__(self, domain, objective): """ Construct...
Balandat/cont_no_regret
old_code/NLopt.py
Python
mit
1,667
0.010198
# 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...
asimshankar/tensorflow
tensorflow/python/ops/rnn_cell_impl.py
Python
apache-2.0
61,366
0.004856
""" A sub-package for efficiently dealing with polynomials. Within the documentation for this sub-package, a "finite power series," i.e., a polynomial (also referred to simply as a "series") is represented by a 1-D numpy array of the polynomial's coefficients, ordered from lowest order term to highest. For example, a...
simongibbons/numpy
numpy/polynomial/__init__.py
Python
bsd-3-clause
6,788
0.000148
import subprocess import os import dialog class RDP(): def __init__(self): self.d = dialog.Dialog(dialog="dialog") self.storage_path = os.path.expanduser("~/LidskjalvData") def show_rdp_menu(self, site, host): # """ """ # FIXME # print("FIXME: rdp_menu") # sys...
berserkerbernhard/Lidskjalv
code/networkmonitor/modules/serviceutilities/rdp.py
Python
gpl-3.0
1,463
0
# -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Version 2.0 (the "Lic...
sparkslabs/kamaelia_
Sketches/JT/Jam/library/trunk/Axon/SchedulingComponent.py
Python
apache-2.0
3,988
0.003761
#!/usr/bin/env python from __future__ import print_function, division import unittest import sys try: import efuse_table_gen except ImportError: sys.path.append("..") import efuse_table_gen ''' To run the test on local PC: cd ~/esp/esp-idf/components/efuse/test_efuse_host/ ./efuse_tests.py ''' class P...
krzychb/rtd-test-bed
components/efuse/test_efuse_host/efuse_tests.py
Python
apache-2.0
16,074
0.004977
# -*- coding: utf-8 -*- # # Bottle documentation build configuration file, created by # sphinx-quickstart on Thu Feb 18 18:09:50 2010. # # 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. # # All ...
ironexmaiden/csd_post_sw
docs/conf.py
Python
mit
7,270
0.005227
from marshmallow import fields from ._resource_io import ResourceSchema class ImmutableTypeResourceSchema(ResourceSchema): label = fields.String() doc = fields.String()
artPlusPlus/elemental-backend
elemental_backend/serialization/_immutable_type_resource_io.py
Python
mpl-2.0
180
0
#!/usr/bin/env python r"""A simple, fast, extensible JSON encoder and decoder JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. simplejson exposes an API familiar to uses of the standard library marshal and pickle...
fernandalavalle/mlab-ns
server/mapreduce/lib/simplejson/__init__.py
Python
apache-2.0
12,383
0.001615
from django.conf.urls import url from admin.nodes import views app_name = 'admin' urlpatterns = [ url(r'^$', views.NodeFormView.as_view(), name='search'), url(r'^flagged_spam$', views.NodeFlaggedSpamList.as_view(), name='flagged-spam'), url(r'^known_spam$', views.NodeKnownSpamList.as_view(...
pattisdr/osf.io
admin/nodes/urls.py
Python
apache-2.0
2,100
0.003333
# 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...
wangyum/tensorflow
tensorflow/contrib/seq2seq/python/kernel_tests/decoder_test.py
Python
apache-2.0
6,979
0.006591
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import errno import ...
fkorotkov/pants
src/python/pants/java/nailgun_client.py
Python
apache-2.0
7,704
0.010903
import tensorflow as tf def f(): with tf.variable_scope('A') as scope: print scope.reuse f()
b29308188/cs598vqa
src/CBP/reuse_test.py
Python
mit
98
0.040816
from . import unittest, numpy, test_int_types from .test_multi import MultiGeometryTestCase from shapely.geos import lgeos from shapely.geometry import LineString, MultiLineString, asMultiLineString from shapely.geometry.base import dump_coords class MultiLineStringTestCase(MultiGeometryTestCase): def test_multi...
jdmcbr/Shapely
tests/test_multilinestring.py
Python
bsd-3-clause
3,200
0.000625
# -*- coding: utf-8 -*- """hamming.py: Return the Hamming distance between two integers (bitwise).""" __author__ = "Russell J. Funk" __date__ = "February 7, 2013" __copyright__ = "Copyright (C) 2013" __reference__ = ["http://wiki.python.org/moin/BitManipulation", "http://en.wikipedia.org/wiki/Hamming...
jkatzsam/matchtools
matchtools/hamming.py
Python
bsd-3-clause
1,270
0.040157
# Copyright © 2017 Collabora Ltd. # # This file is part of pfg. # # pfg 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. # # pf...
afrantzis/pixel-format-guide
tests/__init__.py
Python
lgpl-2.1
768
0
""" For multi-component systems, the configurational space can be highly complicated. One may want to use different hyper-parameters and cutoffs for different interactions, or do constraint optimisation for hyper-parameters. To use more hyper-parameters, we need special kernel function that can differentiate different...
mir-group/flare
flare/utils/parameter_helper.py
Python
mit
49,237
0.001361
from .check import assert_type from .predicates import ( eq, is_predicate, Predicate, AndPredicate, OrPredicate, NotPredicate, ) from .relations import ( is_relation, Main, Relation, AndRelation, OrRelation, NotRelation ) from .rule import ( is_rule, Production, ...
bureaucratic-labs/yargy
yargy/api.py
Python
mit
1,590
0
# Copyright 2018 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...
ghchinoy/tensorflow
tensorflow/contrib/distribute/python/monitor.py
Python
apache-2.0
2,460
0.005691
"""A tool for monitoring webpages for updates urlwatch is intended to help you watch changes in webpages and get notified (via email, in your terminal or with a custom-written reporter class) of any changes. The change notification will include the URL that has changed and a unified diff of what has changed. """ pkgn...
lechuckcaptain/urlwatch
lib/urlwatch/__init__.py
Python
bsd-3-clause
598
0.001672
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
OpenDaisy/daisy-client
daisyclient/openstack/common/_i18n.py
Python
apache-2.0
1,733
0
import datetime from Tkinter import * import tkMessageBox import tkFileDialog import random import time import share class App(object): '''Controls the running of the app''' def __init__(self, master = None): '''A controller class that runs the app Constructor: Controller(object)''' #...
jaric-thorning/ProjectCapital
GUI.py
Python
mit
6,637
0.02019
from datetime import datetime from xml.etree import ElementTree import pkgutil from json import loads as base_loads from random import choice import logging import re import urlparse from sleekxmpp import ClientXMPP from redis import Redis, ConnectionPool import requests from humanize import intcomma, naturaltime, int...
nikdoof/dropbot
dropbot/bot.py
Python
mit
28,390
0.001937
SERVER_HOSTNAME = "127.0.0.1" SERVER_PORT = 9671
prerit2010/web-frontend
config.py
Python
gpl-3.0
49
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2006 - 2010 Loic Dachary <loic@dachary.org> # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of ...
pokermania/pokerengine
tests/test_game.py
Python
gpl-3.0
244,876
0.009131
#!/usr/bin/python # -*- coding: utf-8 -*- import json import os import xmltodict from bs4 import BeautifulSoup from bs4 import CData UPLOAD_DIR = '../html/uploads' METADATA_NAME = 'metadata.xml' PUBLISHER_NAME = 'Heidelberg University Press' PUBLISHER_LOC = 'Heidelberg' jsondata = [{'selected': True, 'type': 'book'}...
withanage/HEIDIEditor
static/WysiwigEditor/cgi/createJSON.py
Python
gpl-3.0
4,094
0.006839
#!/usr/bin/env python # # Copyright 2016 Hannes Juutilainen # # 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 applicabl...
hjuutilainen/autopkg-virustotalanalyzer
VirusTotalAnalyzer/VirusTotalAnalyzer.py
Python
apache-2.0
12,577
0.001193
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('builder', '0001_initial'), ] operations = [ migrations.AlterField( model_name='problem', name='date_...
kopringo/Scarky2
Scarky2/builder/migrations/0002_auto_20150505_2035.py
Python
mit
577
0
from .... import base from pulp.devel import mock_plugins from pulp.plugins.conduits.dependency import DependencyResolutionConduit from pulp.plugins.config import PluginCallConfiguration from pulp.plugins.types import database, model from pulp.server.db.model.criteria import UnitAssociationCriteria from pulp.server.db....
credativ/pulp
server/test/unit/server/managers/repo/test_dependency.py
Python
gpl-2.0
4,601
0.004347
# # 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...
mistercrunch/airflow
airflow/operators/bash.py
Python
apache-2.0
8,272
0.003264
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eithe...
power12317/weblate
weblate/trans/views.py
Python
gpl-3.0
68,329
0.000688
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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,...
keen99/SickRage
sickbeard/dailysearcher.py
Python
gpl-3.0
4,533
0.002647
# 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...
gautam1858/tensorflow
tensorflow/python/keras/backend_test.py
Python
apache-2.0
68,908
0.005819
# (C) British Crown Copyright 2014, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any later ve...
scollis/iris
lib/iris/tests/unit/plot/test_pcolor.py
Python
gpl-3.0
1,395
0
"""XML parser package. This package parses the XML file returned by the Graffiti tracker. """ from xmlparser import XMLParser from xmlgenerator import XMLGenerator from exceptions import * __all__ = ["XMLParser", "XMLGenerator", "XMLException", "InvalidXML"]
huanchenz/STX-h-store
tests/scripts/xml2/__init__.py
Python
gpl-3.0
262
0
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack import * class Casacore(CMakePackage): """A suite of c++ libraries for radio astronomy data pr...
LLNL/spack
var/spack/repos/builtin/packages/casacore/package.py
Python
lgpl-2.1
4,875
0.001846
"""Test ghost object support in VTK-Python When PyVTKObject is destroyed, the vtkObjectBase that it contained often continues to exist because references to it still exist within VTK. When that vtkObjectBase is returned to python, a new PyVTKObject is created. If the PyVTKObject has a custom class or a custom...
timkrentz/SunTracker
IMU/VTK-6.2.0/Common/Core/Testing/Python/TestGhost.py
Python
mit
1,901
0.001578
# -*- coding: utf-8 -*- ############################################################################## # # Author: OpenDrive Ltda # Copyright (c) 2013 Opendrive Ltda # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # cons...
kailIII/emaresa
rent.resp/partner.py
Python
agpl-3.0
1,548
0.008398
''' Created on 23/mag/2015 @author: koala ''' import Cript key = b'dfdfjdnjnjvnfkjn vnfj vjfk d nvkfd j' plaintext = b'jfghksdjfghksdjfgksdhgljdkghjh fgh fhg jfhgdkjfkjg hkdfjg hkdfj ghkdf ghfdjk ghfdjkg hkdfjg h' testoCriptato, seme, orLen = Cript.criptIt(plaintext, key) testoDecriptato = Cript.deCriptIt(testoCript...
koalakoker/knote_gcrypt
GCryptNote/PyMyPackage.py
Python
gpl-2.0
807
0.007435
import csv from subprocess import call# from datetime import datetime#Importing various libraries call(["color","F9"], shell=True)# call(["cls"], shell = True)#Setting colour for shell import sys, time# import time#More libraries prog=True#creating variable prog and assigning it as true time.sleep(1)# def typi...
husky-prophet/personal-backup
PRETEND assessment/PRETEND assessment csv.py
Python
mit
4,661
0.039262
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.module_interface import IModuleData, ModuleData from zope.interface import implementer from typing import Callable, List, Optional, Tuple # Numerics and names are taken from the IRCv3.1 SASL specification at http://ircv3.net/specs/e...
Heufneutje/txircd
txircd/modules/core/accountdata.py
Python
bsd-3-clause
1,023
0.021505
from __future__ import absolute_import, print_function, division import argparse import sys class GPUCommand: def __init__(self, logger): self.logger = logger self.client = None self.registered = False self.active = True def main(self, args): import aetros.cuda_gpu ...
aetros/aetros-cli
aetros/commands/GPUCommand.py
Python
mit
1,123
0.005343
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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-base...
LSIR/gsn
gsn-webui/app/urls.py
Python
gpl-3.0
712
0
# Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
sandeva/appspot
settings.py
Python
apache-2.0
3,965
0.002774
#!/usr/bin/python from setuptools import setup, find_packages setup( name = "testkit-lite", description = "Test runner for test execution", url = "https://github.com/testkit/testkit-lite", author = "Cathy Shen", author_email = "cathy.shen@intel.com", version = "2.3.4", include_package_data...
borqsat/TCT-lite
setup.py
Python
gpl-2.0
506
0.047431
from PyQt4.QtGui import * from PyQt4.QtCore import Qt from aqt.utils import tooltip from TranslatorAddon.Parser.PONSParser import PONSParser # This class describes the Dialog Window in which a vocable can be translated class TranslatorDialog(QDialog): col0Width = 40 def __init__(self, vocable, defaultSourceL...
jannewulf/Anki-Translator
TranslatorAddon/GUI/TranslatorDialog.py
Python
gpl-3.0
7,181
0.004178
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # Copyright 2014 OpenStack Foundation # # 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 # # ...
dims/cinder
cinder/zonemanager/fc_zone_manager.py
Python
apache-2.0
11,517
0
"""empty message Revision ID: b5abafa45063 Revises: 4e5dd0df14b5 Create Date: 2016-08-06 22:29:36.948000 """ # revision identifiers, used by Alembic. revision = 'b5abafa45063' down_revision = '4e5dd0df14b5' from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): ### commands auto...
Princu7/open-event-orga-server
migrations/versions/b5abafa45063_.py
Python
gpl-3.0
1,145
0.013974
"""This module include console commands for DanceCat.""" from __future__ import print_function import datetime import sqlalchemy.exc from dateutil.relativedelta import relativedelta from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from DanceCat import app, db, Models, Constants # py...
scattm/DanceCat
DanceCat/Console/__init__.py
Python
mit
2,383
0
from __future__ import unicode_literals from netaddr import EUI, AddrFormatError from django import forms from django.core.exceptions import ValidationError # # Form fields # class MACAddressFormField(forms.Field): default_error_messages = { 'invalid': "Enter a valid MAC address.", } def to_py...
snazy2000/netbox
netbox/dcim/formfields.py
Python
apache-2.0
607
0
# Test the windows specific win32reg module. # Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey import os, sys, errno import unittest from test import support import threading from platform import machine # Do this first so test will be skipped if module doesn't exist support.import_module('winreg'...
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Lib/test/test_winreg.py
Python
gpl-2.0
21,678
0.000554
from common.connector import redmine class ViewIssues: def __init__(self, view_type, assigned_to='me', minimal_priority=0, exclude_projects=(), milestone=None): self.redmine = redmine() self.assigned_to = assigned_to self.minimal_priority = minimal_priority self.exclude_projects = ...
ex0hunt/redrat
func/viewer.py
Python
bsd-2-clause
2,852
0.00495
import unittest import pdb from day13 import * class TestDay13(unittest.TestCase): def test_is_wall(self): tests = ( (0, 0, False), (1, 0, True), (2, 0, False), (-1, 0, True), (0, -1, True), ) for x, y, expected in tests: self.assertEqual( is_wall(x, y, 10), expected, "(%d,%d) s...
chrisb87/advent_of_code_2016
day13/test_day13.py
Python
unlicense
783
0.045977
from django.conf.urls import patterns, include, url from .views import MapView from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url('^$', 'mobiletrans.views.index', { 'template_name':'index.html'}, name="index"), url('^abou...
JoeJasinski/WindyTransit
mobiletrans/urls.py
Python
mit
1,139
0.022827
# # Race Capture App # # Copyright (C) 2014-2017 Autosport Labs # # This file is part of the Race Capture App # # This 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 ...
autosportlabs/RaceCapture_App
autosportlabs/uix/color/colorsequence.py
Python
gpl-3.0
1,401
0.002141
# (c) Copyright 2013, 2014, University of Manchester # # HydraPlatform 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 3 of the License, or # (at your option) any later version. # # Hydra...
UMWRG/HydraPlatform
HydraLib/python/HydraLib/config.py
Python
gpl-3.0
5,352
0.003737
# -*- coding: utf-8 -*- # # project-template documentation build configuration file, created by # sphinx-quickstart on Mon Jan 18 14:44:12 2016. # # 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 fi...
wikilinks/neleval
doc/conf.py
Python
apache-2.0
8,305
0
# Copyright(c) 2007-2010 by Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> # # This file is part of Chavier. # # Chavier 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 3 of the Lice...
timesong/pycha
chavier/dialogs.py
Python
lgpl-3.0
7,040
0.00071
from __future__ import unicode_literals from moto.core.exceptions import RESTError class EC2ClientError(RESTError): code = 400 class DependencyViolationError(EC2ClientError): def __init__(self, message): super(DependencyViolationError, self).__init__( "DependencyViolation", message) cl...
kennethd/moto
moto/ec2/exceptions.py
Python
apache-2.0
10,404
0.000192
# Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # 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...
eharney/nova
nova/tests/virt/vmwareapi/stubs.py
Python
apache-2.0
3,393
0.000295
#! /usr/bin/env python # SCardConnect_DIRECT.py : Unitary test for SCardConnect in DIRECT mode # Copyright (C) 2009 Ludovic Rousseau # # 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;...
vicamo/pcsc-lite-android
UnitaryTests/SCardConnect_DIRECT.py
Python
bsd-3-clause
3,325
0.001203
""" Django settings for charityfund project. """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ.get('SECRET_KEY') ...
DArtagan/charityfund
charityfund/settings.py
Python
mit
1,699
0
from energenie import switch_on, switch_off from time import sleep print ("Turning off") switch_off() sleep(5) print ("Turning on") switch_on()
fergalmoran/energenie
socket.py
Python
apache-2.0
147
0.020408
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # tcpconnect Trace TCP connect()s. # For Linux, uses BCC, eBPF. Embedded C. # # USAGE: tcpconnect [-h] [-c] [-t] [-p PID] [-P PORT [PORT ...]] [-4 | -6] # # All connection attempts are traced, even if they ultimately fail. # # This uses d...
brendangregg/bcc
tools/tcpconnect.py
Python
apache-2.0
17,972
0.002393
# -*- coding: UTF-8 -*- # File: summary.py # Author: Yuxin Wu <ppwwyyxx@gmail.com> import six import tensorflow as tf import re from ..utils import * from . import get_global_step_var from .symbolic_functions import rms __all__ = ['create_summary', 'add_param_summary', 'add_activation_summary', 'add_movin...
yinglanma/AI-project
tensorpack/tfutils/summary.py
Python
apache-2.0
3,816
0.002621
#!/usr/bin/env python from __future__ import absolute_import, print_function from grid_cell_model.submitting import flagparse import noisefigs from noisefigs.env import NoiseEnvironment import config_standard_gEE_3060 as config parser = flagparse.FlagParser() parser.add_flag('--bumpDriftSweep') args = parser.parse_a...
MattNolanLab/ei-attractor
grid_cell_model/simulations/007_noise/figures/paper/ee_connections_ei_flat/figure_drifts.py
Python
gpl-3.0
501
0.001996
# Copyright 2016 GoDaddy. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
noironetworks/neutron
neutron/tests/unit/extensions/test_network_ip_availability.py
Python
apache-2.0
21,269
0
""" Basic functions for manipulating 2d arrays """ from __future__ import division, absolute_import, print_function __all__ = ['diag', 'diagflat', 'eye', 'fliplr', 'flipud', 'rot90', 'tri', 'triu', 'tril', 'vander', 'histogram2d', 'mask_indices', 'tril_indices', 'tril_indices_from', 'triu_indice...
immerrr/numpy
numpy/lib/twodim_base.py
Python
bsd-3-clause
26,858
0.000037
import sys import click import os import subprocess from packageinfo import BUILD, VERSION, NAME # The version of the buildcommon to checkout. BUILDCOMMONS_VERSION = "v0.2" def bootstrap_devenv(): try: os.makedirs(".devenv") except OSError: pass if not os.path.exists(".devenv/buildrecip...
simphony/simphony-lammps-md
edmsetup.py
Python
bsd-2-clause
1,237
0
import logging import os import warnings from ..util import SysOutCapture from .base import Tool, Issue, ToolIssue # Hacks to prevent pyroma from screwing up the logging system for everyone else old_config = logging.basicConfig try: logging.basicConfig = lambda **k: None from pyroma import projectdata, rati...
jayclassless/tidypy
src/tidypy/tools/pyroma.py
Python
mit
4,228
0.000237
############################################################################### # Copyright (C) 2008 Johann Haarhoff <johann.haarhoff@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of Version 2 of the GNU General Public License as # published by the Free Softwar...
Jaden-J/shape2ge
src/shapeobjects.py
Python
gpl-2.0
10,069
0.049558
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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) an...
scottcunningham/ansible
lib/ansible/executor/process/worker.py
Python
gpl-3.0
6,192
0.004037
from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0 from selenium.webdriver.support import expected_conditions as EC # available since 2.26.0 # Create a new instance of the IE driver driver = webdri...
ktan2020/legacy-automation
samples/misc/sel_google_search_phantomjs.py
Python
mit
1,101
0.00545
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under t...
MDAnalysis/mdanalysis
package/MDAnalysis/converters/OpenMM.py
Python
gpl-2.0
7,397
0.001622
n = int(input()) arr = [] for i in range(n): arr.append(input()) q = int(input()) for i in range(q): query = input() count = 0 for j in range(len(arr)): if arr[j] == query: count +=1 print(count)
vipmunot/HackerRank
Data Structures/Arrays/Sparse Arrays.py
Python
mit
249
0.02008
import numpy as np import json import sys from .. import _smcpp, util, logging, data_filter import smcpp.defaults from smcpp.optimize.optimizers import SMCPPOptimizer, TwoPopulationOptimizer from smcpp.optimize.plugins import analysis_saver, parameter_optimizer logger = logging.getLogger(__name__) from ..model impor...
terhorst/psmcpp
smcpp/analysis/base.py
Python
gpl-3.0
6,269
0.001276
from csv import DictReader from django.core.management.base import BaseCommand from registrations.models import ClinicCode class Command(BaseCommand): help = ( "This command takes in a CSV with the columns: uid, code, facility, province," "and location, and creates/updates the cliniccodes in the...
praekeltfoundation/ndoh-hub
registrations/management/commands/upload_clinic_codes.py
Python
bsd-3-clause
2,626
0.001142
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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 appli...
sjug/perf-tests
verify/boilerplate/boilerplate.py
Python
apache-2.0
4,896
0.003881
__all__ = [ 'json_schema', ] import lollipop.types as lt import lollipop.validators as lv from lollipop.utils import identity from collections import OrderedDict from .compat import iteritems def find_validators(schema, validator_type): return [validator for validator in schema.validators ...
akscram/lollipop-jsonschema
lollipop_jsonschema/jsonschema.py
Python
mit
5,661
0.00159
# 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, ...
tensorflow/moonlight
moonlight/staves/staffline_distance.py
Python
apache-2.0
10,559
0.00483
from django.conf import settings, UserSettingsHolder from django.contrib.auth.models import User from django.contrib.messages.storage.fallback import FallbackStorage from django.test.client import Client from django.utils.functional import wraps from django.utils.importlib import import_module import constance.config ...
mastizada/kuma
kuma/core/tests/__init__.py
Python
mpl-2.0
6,376
0.000471
import copy from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django_countries import countries import accounts import third_party_auth from edxmako.shortcuts import marketing_li...
angelapper/edx-platform
openedx/core/djangoapps/user_api/api.py
Python
agpl-3.0
35,762
0.002489
#!/usr/bin/env python """ This is a hacked version of PyUnit that extends its reporting capabilities with optional meta data on the test cases. It also makes it possible to separate the standard and error output streams in TextTestRunner. It's a hack rather than a set of subclasses because a) Steve had used doub...
skyostil/tracy
src/generator/Cheetah/Tests/unittest_local_copy.py
Python
mit
34,313
0.003934
import ssl import logging import tornado.ioloop import tornado.web import sys from tornado import httpclient from functools import partial from sqlalchemy import create_engine, func from sqlalchemy.orm import scoped_session, sessionmaker from create_receive_handler import ReceiveHandler from wallet_notify_handler i...
bzero/bitex
apps/api_receive/api_receive_application.py
Python
gpl-3.0
4,247
0.014834
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('fruit', '0002_fruit_cover_image'), ] operations = [ migrations.AlterField( model_na...
jsmesami/naovoce
src/fruit/migrations/0003_added_indexes.py
Python
bsd-3-clause
702
0.002849
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2021 Luca Falavigna # # Author: Luca Falavigna <dktrkranz@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 # the Free Software Foundation; version 3 of the License. #...
debomatic/debomatic
docs/conf.py
Python
gpl-3.0
1,509
0
import pytest @pytest.fixture(scope="module") def states(loaders): return loaders.states @pytest.fixture(scope="module") def modules(loaders): return loaders.modules
saltstack/salt
tests/pytests/functional/states/conftest.py
Python
apache-2.0
178
0
#!/usr/bin/env python """ @package mi.dataset.parser.flord_l_wfp_sio_mule @file marine-integrations/mi/dataset/parser/flord_l_wfp_sio_mule.py @author Maria Lutz @brief Parser for the flord_l_wfp_sio_mule dataset driver Release notes: Initial Release """ __author__ = 'Maria Lutz' __license__ = 'Apache 2.0' import re...
ooici/marine-integrations
mi/dataset/parser/flord_l_wfp_sio_mule.py
Python
bsd-2-clause
8,191
0.021121