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 2013-2016 DataStax, 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 writi...
kishkaru/python-driver
tests/integration/long/test_ssl.py
Python
apache-2.0
10,956
0.003468
""" The network analyzer records the coherent response of the signal at the port :code:`input` to a sinusoidal excitation of variable frequency sent to the output selected in :code:`output_direct`. .. note:: If :code:`output_direct='off'`, another module's input can be set to :code:`networkanalyzer` to test ...
lneuhaus/pyrpl
pyrpl/widgets/module_widgets/na_widget.py
Python
gpl-3.0
15,889
0.004217
# TestIt.py # Copyright (C) 2009 Matthias Treder # # 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) any later version. # # This program is ...
venthur/pyff
src/lib/P300VisualElement/TestIt.py
Python
gpl-2.0
1,957
0.005621
from setuptools import setup with open('README.rst') as f: LONG_DESCRIPTION = f.read() with open('pip-req.d/install.txt') as f: install_requires = [] for line in f: if '#' in line: # remove comment line = line[:line.index('#')] line = line.strip() if line...
lexdene/sniper-jinja
setup.py
Python
gpl-3.0
1,172
0
import re from django import template register = template.Library() def user_dweet_to_link(m): text = m.group('text') dweet_id = m.group('dweet_id') username = m.group('username') if username is None: url = 'd/' + dweet_id else: url = 'u/' + username result = '<a href="/{0}"...
lionleaf/dwitter
dwitter/templatetags/insert_magic_links.py
Python
apache-2.0
2,048
0.003418
from typing import Dict, List, Optional from ray.tune.suggest.suggestion import Searcher, ConcurrencyLimiter from ray.tune.suggest.search_generator import SearchGenerator from ray.tune.trial import Trial class _MockSearcher(Searcher): def __init__(self, **kwargs): self.live_trials = {} self.count...
ray-project/ray
python/ray/tune/suggest/_mock.py
Python
apache-2.0
1,752
0
from stormed.util import WithFields class Declare(WithFields): _name = "queue.declare" _class_id = 50 _method_id = 10 _sync = True _content = False _fields = [ ('ticket' , 'short'), ('queue' , 'shortstr'), ('passive' , '...
bufferx/stormed-amqp
stormed/method/codegen/queue.py
Python
mit
3,261
0.028212
# Copyright 2014 PerfKitBenchmarker 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 appli...
meteorfox/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Python
apache-2.0
7,898
0.00899
# This file is part of django-ca (https://github.com/mathiasertl/django-ca). # # django-ca 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...
mathiasertl/django-ca
ca/django_ca/acme/messages.py
Python
gpl-3.0
2,539
0.005908
import unittest from pyicoteolib.utils import DualSortedReader from pyicoteolib.core import BED class TestUtils(unittest.TestCase): def test_dual_reader(self): reader = DualSortedReader("test_files/mini_sorted.bed", "test_files/mini_sorted2.bed", BED, False, False) merged_file = open("test_fil...
RegulatoryGenomicsUPF/pyicoteo
utest/testUtils.py
Python
gpl-3.0
566
0.012367
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # ++ single anchor added to individual output file # ++ two anchors added to individual output file # ++ anchors added to individual output files # ++ entry added to index # ++ index entry pointing to correct file and anchor # ++ multiple entries ...
engdan77/edoAutoHomeMobile
twisted/lore/test/test_lore.py
Python
mit
42,212
0.002203
from django.urls import path, re_path from .views import ( user_overview, api_overview, dq_overview, dq_overview_session, dqr_listing, ) from utils.common import states # Only allow valid state abbreviations state_abbrs = [s.abbr.lower() for s in states] state_abbr_pattern = r"({})".format("|".join...
openstates/openstates.org
dashboards/urls.py
Python
mit
685
0.00292
from basic import Atom, SingletonMeta, S, Basic from decorators import _sympifyit from cache import Memoizer, MemoizerArg import sympy.mpmath as mpmath import sympy.mpmath.libmpf as mlib import sympy.mpmath.libmpc as mlibc from sympy.mpmath.libelefun import mpf_pow, mpf_pi, mpf_e, phi_fixed import decimal rnd = mlib.r...
hazelnusse/sympy-old
sympy/core/numbers.py
Python
bsd-3-clause
44,106
0.004285
# 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...
freedomtan/tensorflow
tensorflow/python/framework/sparse_tensor.py
Python
apache-2.0
17,827
0.005441
# coding: utf-8 from sqlalchemy import Column, DateTime, Index, Integer, String, Text, text, \ ForeignKey from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() metadata = Base.metadata class RedmineToDriveMapping(Base): __tablename_...
rockdreamer/redmine-docs-to-drive
model.py
Python
mit
12,096
0.003142
def extractGhosttouchWordpressCom(item): ''' Parser for 'ghosttouch.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('Loi...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractGhosttouchWordpressCom.py
Python
bsd-3-clause
560
0.033929
import logging, sys from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL class InfoFilter(logging.Filter): def filter(self, rec): return rec.levelno in (logging.DEBUG, logging.INFO) def _new_custom_logger(name='BiblioPixel', fmt='%(levelname)s - %(module)s - %(message)s'): ...
sethshill/final
build/lib.linux-armv7l-2.7/bibliopixel/log.py
Python
mit
1,041
0.000961
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
ClearCorp/odoo-costa-rica
TODO-9.0/l10n_cr_account_trial_balance_currency_report/__openerp__.py
Python
agpl-3.0
2,013
0.002981
__author__ = 'leif' from game_models import HighScore, UserProfile from ifind.common.utils import encode_string_to_url from django.contrib.auth.models import User from django.db.models import Max, Sum, Avg # ranking based on highest total score (top x players) # ranking of players based on level/xp # top players in ...
leifos/pagefetch
pagefetch_project/pagefetch/game_leaderboards.py
Python
mit
5,894
0.005769
class MastermindError(Exception): @property def code(self): return MASTERMIND_ERROR_CODES[type(self)] @staticmethod def make_error(code, msg): if code not in MASTERMIND_ERROR_CLS: raise ValueError('Unknown error code {}'.format(code)) return MASTERMIND_ERROR_CLS[code...
yandex/mastermind
src/python-mastermind/src/mastermind/errors.py
Python
gpl-2.0
508
0.003937
# Generated by Django 2.2.14 on 2020-07-09 10:37 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import olympia.amo.models class Migration(migrations.Migration): initial = True dependencies = [ ('versions', '0008_auto_20200625_1114'), (...
bqbn/addons-server
src/olympia/promoted/migrations/0001_initial.py
Python
bsd-3-clause
2,466
0.004461
""" Normalize Array ~~~~~~~~~~~~~~~ This example will demonstrate how to perform a normalization or any custom mathematical operation on a single data array for an input data set. This filter allow the user to select an array from the input data set to be normalized. The filter will append another array to that data ...
banesullivan/ParaViewGeophysics
examples/filters-general/normalize-array.py
Python
bsd-3-clause
1,235
0
# -*- coding: utf-8 -*- # # 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 "L...
lukecwik/incubator-beam
sdks/python/apache_beam/examples/dataframe/wordcount_test.py
Python
apache-2.0
2,150
0.005581
#!/usr/bin/env python # -*- coding: utf-8 -*- from distutils.core import setup import py2app import os, glob def data_files(dirname = 'xml'): """Figure out the sugar structure and massage it into data_files format.""" def data_file(component): return (os.path.join('..', '..', component), glob.glob(os.pa...
mkhl/haskell.sugar
setup.py
Python
mit
1,606
0.056145
import math import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # Flags for defining the tf.train.ClusterSpec tf.app.flags.DEFINE_string("ps_hosts", "", "Comma-separated list of hostname:port pairs") tf.app.flags.DEFINE_string("worker_hosts", "", ...
fuhaha/tensorflow_study
docs/chapter6/distributed_mnist.py
Python
apache-2.0
4,760
0.004915
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
tensorflow/tfx
tfx/components/base/base_driver.py
Python
apache-2.0
999
0.001001
#!/usr/bin/python ## ## Copyright 2008, Various ## Adrian Likins <alikins@redhat.com> ## ## This software may be freely redistributed under the terms of the GNU ## general public license. ## import os import socket import subprocess import time import unittest import simplejson import func.utils from func import y...
pombredanne/func
test/unittest/test_func_transmit.py
Python
gpl-2.0
8,415
0.010458
#!/usr/bin/env python # This file should be compatible with both Python 2 and 3. # If it is not, please file a bug report. """ This is a Class which allows one to manipulate a git repository. """ #external imports import os import tempfile #internal imports import subuserlib.subprocessExtras as subprocessExtras from ...
weaver-viii/subuser
logic/subuserlib/classes/gitRepository.py
Python
lgpl-3.0
6,303
0.013803
from __future__ import unicode_literals from django.db import models # Create your models here. class Questions(models.Model): # Fields CHOICES = ( ('a', 'a.'),('b', 'b.'),('c', 'c.'),('d', 'd.'), ) created = models.DateTimeField(auto_now_add=True, editable=False) last_updated = models.DateTimeField(auto_now=T...
wasit7/tutorials
django/Pieng/myclass/myquiz/models.py
Python
mit
647
0.034003
# -*- coding: utf-8 -*- import codecs import logging import os import chardet import pysrt from .video import Episode, Movie from .utils import sanitize, sanitize_release_group logger = logging.getLogger(__name__) #: Subtitle extensions SUBTITLE_EXTENSIONS = ('.srt', '.sub', '.smi', '.txt', '.ssa', '.ass', '.mpl')...
neo1691/subliminal
subliminal/subtitle.py
Python
mit
8,191
0.001953
from setuptools import setup setup(name='mock_labels', version='0.0.1', packages=['mock_labels'])
cloudify-cosmo/cloudify-manager
tests/integration_tests_plugins/mock_labels/setup.py
Python
apache-2.0
99
0
# Copyright (c) 2012 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 # # Unless required by applicable law or agreed to...
Juniper/neutron
neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py
Python
apache-2.0
24,807
0.000322
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import rasa_nlu.version logging.getLogger(__name__).addHandler(logging.NullHandler()) __version__ = rasa_nlu.version.__version__
beeva-fernandocerezal/rasa_nlu
rasa_nlu/__init__.py
Python
apache-2.0
297
0
# Copyright 2017 Eayun, 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...
openstack/neutron-vpnaas
neutron_vpnaas/services/vpn/service_drivers/driver_validator.py
Python
apache-2.0
1,000
0
import datetime from .models import Note, Sujet from utilisateurs.models import Professionnel from django import forms from django_select2.forms import Select2Widget # NOTES class NoteForm(forms.ModelForm): """ Generic Note form """ class Meta: model = Note fields = ['sujet', 'text', 'create...
artus40/maraudes_project
notes/forms.py
Python
gpl-3.0
2,575
0.001554
# Copyright 2014 BitPay Inc. # Copyright 2016 The nealcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from __future__ import division,print_function,unicode_literals import subprocess import os import json impo...
appop/bitcoin
src/test/bctest.py
Python
mit
4,554
0.005051
#!/usr/bin/env python ''' ooiui.core.app.science Defines the application for the Science UI ''' import os from flask import Flask from flask.ext.cache import Cache from flask_environments import Environments app = Flask(__name__, static_url_path='', template_folder='../../templates', static_folder='../../static') ...
maka-io/ooi-ui
ooiui/core/app/__init__.py
Python
mit
651
0.003072
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
jtconnor/mec2
setup.py
Python
gpl-2.0
3,761
0
from __future__ import division import os from functools import reduce def secure_randint(bitspace): delbits = 8 - (bitspace % 8) bytez = os.urandom(bitspace // 8) if delbits > 0: b = (os.urandom(1)[0] & (0xFF >> delbits)).to_bytes(1, 'big', signed=False) bytez = b + bytez return redu...
qstokkink/py-ipv8
ipv8/attestation/wallet/irmaexact/__init__.py
Python
lgpl-3.0
360
0.002778
import os import ClearMap.Settings as settings filename = os.path.join(settings.ClearMapPath, 'Test/Data/ImageAnalysis/cfos-substack.tif'); import ClearMap.Visualization.Plot as plt import ClearMap.IO as io data = io.readData(filename, z = (0,26)); import ClearMap.ImageProcessing.BackgroundRemoval as bgr dataBGR = bgr....
ChristophKirst/ClearMap
docs/build/latex/imageanalysis-7.py
Python
gpl-3.0
749
0.045394
from plugins.bases.handlers import HandlersBase class forgotpassword(HandlersBase): WEB_PATH = r"/forgotpassword" STORE_ATTRS = True STORE_UNREF = True OPTS = {} PAGE_TITLE = "Reset Password" CSS_FILES = ["forgotpassword"] def get(self): self.show("forgotpassword", ac...
AnzenSolutions/ASWCP-Web
plugins/handlers/forgotpassword/forgotpassword.py
Python
mpl-2.0
1,694
0.008855
''' XBMC LCDproc addon Copyright (C) 2012 Team XBMC Extra icon defines/enums Copyright (C) 2012 Daniel 'herrnst' Scheller 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 Soft...
DK-Git/script.mdm166a
resources/lib/extraicons.py
Python
gpl-2.0
2,739
0.004016
# -*- coding: utf-8 -*- """Usage information for the main IPython applications. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu> # # Distributed under the terms of...
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/IPython/core/usage.py
Python
artistic-2.0
23,364
0.001198
######################################## # Automatically generated, do not edit. ######################################## from pyvisdk.thirdparty import Enum PerfFormat = Enum( 'csv', 'normal', )
xuru/pyvisdk
pyvisdk/enums/perf_format.py
Python
mit
209
0
# -*- coding: utf-8 -*- def generate_translations(item): """Generate French and Spanish translations for the given `item`.""" fr_prefix = u'(français) ' es_prefix = u'(español) ' oldname = unicode(item.name) item.name = {'en': oldname, 'fr': fr_prefix + oldname, '...
tsl143/addons-server
src/olympia/landfill/translations.py
Python
bsd-3-clause
364
0
from __future__ import division import numpy as np import sys as sys class Atom(object): def __init__(self, Z, pos): self.Z = Z self.pos = pos self.VdW = 8 # a.u. def DistFrom(self, pos): return np.dot(self.pos - pos, self.pos - pos)**0.5 class ScalarField(object): def __init__(self, atoms, scala...
12AngryMen/votca-scripts
lib/Carlstuff/ctp/cube2xyz.py
Python
apache-2.0
3,451
0.066068
# Copyright 2013 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. import logging import os from document_parser import ParseDocument from third_party.json_schema_compiler.model import UnixName class DocumentRenderer(objec...
TeamEOS/external_chromium_org
chrome/common/extensions/docs/server2/document_renderer.py
Python
bsd-3-clause
4,116
0.003158
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
chmouel/python-swiftclient
swiftclient/openstack/common/setup.py
Python
apache-2.0
12,438
0.000241
#!/usr/bin/python3 #-*- coding: utf-8 -*- # #Copyright pops (pops451@gmail.com), 2010-2011 # #This file is part of imagemash. # # imagemash 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 versi...
z-uo/imagemash
plugins/plugin_rotate.py
Python
gpl-3.0
11,247
0.003379
# -*- coding: utf-8 -*- # Copyright(C) 2012 Kevin Pouget # # This file is part of weboob. # # weboob 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 optio...
Boussadia/weboob
modules/creditcooperatif/backend.py
Python
agpl-3.0
2,921
0.001713
""" Test the CONMIN optimizer component """ import unittest import numpy # pylint: disable=F0401,E0611 from openmdao.main.api import Assembly, Component, VariableTree, set_as_top, Driver from openmdao.main.datatypes.api import Float, Array, Str, VarTree from openmdao.lib.casehandlers.api import ListCaseRecorder from ...
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/openmdao.lib-0.13.0-py2.7.egg/openmdao/lib/drivers/test/test_opt_conmin.py
Python
gpl-2.0
27,188
0.001802
# This file is part of the Simulation Manager project for VecNet. # For copyright and licensing information about this project, see the # NOTICE.txt and LICENSE.md files in its top-level directory; they are # available at https://github.com/vecnet/simulation-manager # # This Source Code Form is subject to the terms of ...
vecnet/simulation-manager
sim_manager/tests/constants.py
Python
mpl-2.0
649
0.001541
"""Base views and view utilities.""" from django.views.generic import View from django.contrib.auth.decorators import login_required from django.shortcuts import render class LoginRequiredMixin(object): """Ensures that user must be authenticated in order to access view.""" @classmethod def as_view(cls, ...
joshsamara/game-website
core/views/base.py
Python
mit
691
0
# This file is part of Buildbot. Buildbot 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 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
pmisik/buildbot
master/buildbot/scripts/sendchange.py
Python
gpl-2.0
2,058
0.000486
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014 CERN. # # Invenio 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) any...
quantifiedcode-bot/invenio-deposit
invenio_deposit/autocomplete_utils.py
Python
gpl-2.0
3,068
0
# -*- coding: utf-8 -*- import scrapy from scraper.items import ResolutionItem class ResolutionSpider(scrapy.Spider): name = "resolutions" allowed_domains = ["www.pmo.gov.il"] start_urls = ["http://www.pmo.gov.il/Secretary/GovDecisions/Pages/default.aspx"] def should_retry(self, response): ...
dvirsky/govsearch
scraper/scraper/spiders/resolutions.py
Python
bsd-3-clause
2,802
0.003569
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://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, eith...
miyataken999/weblate
weblate/trans/fonts.py
Python
gpl-3.0
49,812
0
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
pinguinkiste/bioconda-recipes
recipes/peptide-shaker/peptide-shaker.py
Python
mit
3,271
0.000917
import tensorflow as tf from .network import Network from ..fast_rcnn.config import cfg class VGGnet_test(Network): def __init__(self, trainable=True): self.inputs = [] self.data = tf.placeholder(tf.float32, shape=[None, None, None, 3]) self.im_info = tf.placeholder(tf.float32, shape=[None...
CharlesShang/TFFRCNN
lib/networks/VGGnet_test.py
Python
mit
2,855
0.001401
""" Copyright (C) 2010 David Fong and Michael Saunders Distributed under the same license as Scipy Testing Code for LSMR. 03 Jun 2010: First version release with lsmr.py David Chin-lung Fong clfong@stanford.edu Institute for Computational and Mathematical Engineering Stanford University Michael Saunders ...
DailyActie/Surrogate-Model
01-codes/scipy-master/scipy/sparse/linalg/isolve/tests/test_lsmr.py
Python
mit
4,984
0.000201
from .base import (BaseGradLogPDF, GradLogPDFGaussian, LeapFrog, ModifiedEuler, BaseSimulateHamiltonianDynamics, _return_samples) from .HMC import HamiltonianMC, HamiltonianMCDA from .NUTS import NoUTurnSampler, NoUTurnSamplerDA from .Sampling import GibbsSampling, BayesianModelSampling...
sandeepkrjha/pgmpy
pgmpy/sampling/__init__.py
Python
mit
693
0.002886
#Copyright ReportLab Europe Ltd. 2000-2015 #see license.txt for license details __doc__="""The Reportlab PDF generation library.""" Version = "3.2.13" __version__=Version __date__='20151210' import sys, os, imp if sys.version_info[0:2]!=(2, 7) and sys.version_info<(3, 3): raise ImportError("""reportlab requires P...
Distrotech/reportlab
src/reportlab/__init__.py
Python
bsd-3-clause
1,314
0.022831
import Moog960 import numpy import SpectralTools import matplotlib.pyplot as pyplot fig = pyplot.figure(0) ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) ax.clear() syntheticScore = Moog960.Score(suffix='', observed = '../../Theremin/TWHydra.fits') models = syntheticScore.getLabels(keySignature='CONVOLVED') observed = s...
soylentdeen/cuddly-weasel
MusicMaker/Output/plotter.py
Python
mit
708
0.00565
#!/usr/bin/python import os import commands import termios import sys def enable_echo(fd, enabled): (iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr (fd) if enabled: lflag |= termios.ECHO else: lflag &= ~termios.ECHO new_attr = [iflag, oflag, cflag, lflag, ispeed, o...
ASPLes/turbulence
tools/tbc-ctl/tbc-setup-mod-radmin.py
Python
lgpl-2.1
4,910
0.016497
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-12-29 01:57 from hanlp_common.constant import HANLP_URL CTB5_POS_RNN = HANLP_URL + 'pos/ctb5_pos_rnn_20200113_235925.zip' 'An old school BiLSTM tagging model trained on CTB5.' CTB5_POS_RNN_FASTTEXT_ZH = HANLP_URL + 'pos/ctb5_pos_rnn_fasttext_20191230_202639.zip' 'An...
hankcs/HanLP
hanlp/pretrained/pos.py
Python
apache-2.0
2,166
0.007849
import random import numpy as np from copy import deepcopy class Move: ''' the move data structure. field for colour of robot and direction of move. ''' intToColourConversion = ["BLUE", "RED", "GREEN", "YELLOW"] # index with robot number to get colour as string def __init__(self, colour, direction): self.colou...
ajstarna/RicochetRobots
Brobot/Move.py
Python
bsd-2-clause
1,936
0.035124
import bleach from django import template from django.conf import settings from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe register = template.Library() @stringfilter def sanitize_html(value): if isinstance(value, basestring): value = bleach.clean(va...
sema/django-2012
website/mosaicportfolio/templatetags/htmlsanitizer.py
Python
mit
564
0.010638
from pytak.call import REST class GetInformationAboutYourself(REST): def fill_call_data(self): self.uri = "/api/muad/rest/users/@me[?query_parameters]"
zlatozar/pytak
pytak/tests/fakeapi/GetInformationAboutYourself.py
Python
bsd-3-clause
166
0.006024
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
citrix-openstack-build/nova
nova/db/sqlalchemy/migrate_repo/versions/153_instance_type_in_system_metadata.py
Python
apache-2.0
2,116
0
class Instance: """ Instances class models. """ def __init__(self, instance_id, controller, parameters, description, status): self.id = instance_id self.controller = controller self.parameters = parameters self.description = description self.status = status
Crystal-SDS/dashboard
crystal_dashboard/dashboards/crystal/controllers/instances/models.py
Python
gpl-3.0
319
0.003135
""" Copyright (c) 2016 Keith Sterling 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, publish, distribute,...
dkamotsky/program-y
src/programy/parser/exceptions.py
Python
mit
3,289
0.006081
############################################################################## # 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...
wscullin/spack
var/spack/repos/builtin/packages/xkill/package.py
Python
lgpl-2.1
1,898
0.000527
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests that HTML generation is awesome.""" import datetime import glob import json import os import os.path import re import sys from unittest import mock impor...
nedbat/coveragepy
tests/test_html.py
Python
apache-2.0
44,058
0.00084
import os from LogInOut import logout def doctorCommands(cursor, conn, staff_id): loggedOut = False while not loggedOut: os.system("clear") choice = int(raw_input('''Type integer value of desired task: 1. Get patient chart info. 2. Rec...
sdlarsen1/CMPUT291
prjcode/Doctor.py
Python
gpl-3.0
9,331
0.014575
# -*- coding: utf-8 -*- # Copyright (c) 2015-2022, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 from os import path from tempfile import mkdtemp from exatomic.exa.util.utility import datetime_header, mkp, convert_bytes, get_internal_modules def test_get_internal_modules(): ...
exa-analytics/exatomic
exatomic/exa/util/tests/test_utility.py
Python
apache-2.0
964
0.001037
from django.core import validators from django.utils.deconstruct import deconstructible from django.utils.translation import gettext_lazy as _ @deconstructible class UsernameValidator(validators.RegexValidator): regex = r'^[\w.]+$' message = _( 'Enter a valid username. This value may contain only lett...
apirobot/shmitter
backend/shmitter/users/validators.py
Python
mit
377
0
#!/usr/bin/env python from setuptools import setup, find_packages from bang import VERSION import os.path ETC = os.path.join(os.path.dirname(__file__), 'etc') with open(os.path.join(ETC, 'requirements.pip')) as f: reqs = [l.strip() for l in f if '://' not in l] reqs.append('distribute') setup( name='ban...
fr33jc/bang-unstable
setup.py
Python
gpl-3.0
751
0.001332
# -*- coding: utf-8 -*- # Copyright 2018 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields from openerp import tools class FleetWorkOrderAnalysis(models.Model): _name = "fleet.work_order_analysis" _description = "Fleet Work Order Analysis...
open-synergy/opensynid-fleet
fleet_work_order/reports/fleet_work_order_analysis.py
Python
agpl-3.0
3,619
0
from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from django.db.models import Q from djblets.util.decorators import augment_method_from from djblets.webapi.decorators import webapi_login_required from djblets.webapi.responses import WebAPIResponsePaginated from reviewboard...
custode/reviewboard
reviewboard/webapi/resources/draft_file_attachment.py
Python
mit
4,019
0
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "umiss_project.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure tha...
CadeiraCuidadora/UMISS-backend
umiss_project/manage.py
Python
gpl-3.0
811
0
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-aiplatform
samples/generated_samples/aiplatform_v1beta1_generated_featurestore_service_update_entity_type_async.py
Python
apache-2.0
1,513
0.001322
def sum(*args): total = 0 for number in args: if isinstance(number, int): total += number return total print(sum(1,5))
Fuchida/Archive
albme-py/script.py
Python
mit
150
0.02
#!/usr/bin/env python # This illustrates how to use SoCo plugins # an example plugin is provided in soco.plugins.example.ExamplePlugin import time from soco import SoCo from soco.plugins import SoCoPlugin def main(): speakers = [speaker.ip_address for speaker in SoCo.discover()] if not speakers: p...
petteraas/SoCo
examples/plugins/socoplugins.py
Python
mit
1,032
0
import logging import pickle from typing import Dict, Optional, Union, List, Sequence from ray.tune.result import DEFAULT_METRIC from ray.tune.sample import Categorical, Domain, Float, Integer, LogUniform, \ Quantized from ray.tune.suggest.suggestion import UNRESOLVED_SEARCH_SPACE, \ UNDEFINED_METRIC_MODE, UND...
richardliaw/ray
python/ray/tune/suggest/nevergrad.py
Python
apache-2.0
12,589
0
#!/usr/bin/env python2 #-*- coding: utf-8 -*- __author__ = "Shrinidhi Rao" __license__ = "GPL" __email__ = "shrinidhi666@gmail.com" import os import sys import pwd import time import socket import subprocess import simplejson rbhus_main_path = os.sep.join(os.path.abspath(__file__).split(os.sep)[0:-3]) sys.path.appen...
shrinidhi666/rbhus
etc/blend_lin/default.py
Python
gpl-3.0
5,828
0.025566
from __future__ import print_function # make the handler of the color field to call chicken_mcnuggets() # instead of the default set handle_color() function handler_registry['color'] = 'chicken_mcnuggets' def chicken_mcnuggets(): # print color.getValue().getValue() pass # Initialize the color Packer (required of ...
looooo/pivy
examples/SoPyScript/glow.py
Python
isc
1,768
0.007919
#!/usr/bin/env python2 ''' Simple monitoring script to collect per process cpu percentage and mem usage in bytes (vms or virt and rss) usage: cron-send-cpu-mem-stats process_name openshift.whatever.zabbix.key or cron-send-cpu-mem-stats 'something parameter more params' openshift.something.parameter.mo...
ivanhorvath/openshift-tools
scripts/monitoring/cron-send-cpu-mem-stats.py
Python
apache-2.0
3,773
0.007951
# MIT License # # Copyright (c) 2017, Stefan Webb. All Rights Reserved. # # 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 us...
stefanwebb/tensorflow-models
tensorflow_models/initializations.py
Python
mit
1,768
0.010747
''' A module that conducts unit tests on all top-level methods within each class. Created on Jun 20, 2012 @author: ccabot ''' import unittest import sys # add to PYTHONPATH sys.path.append("../") from libpgm.dictionary import Dictionary from libpgm.graphskeleton import GraphSkeleton from libpgm.orderedskeleton impo...
CyberPoint/libpgm
tests/run_unit_tests.py
Python
bsd-3-clause
14,090
0.004116
"""Check that required Docker images are available.""" import re from pipes import quote from ansible.module_utils import six from openshift_checks import OpenShiftCheck from openshift_checks.mixins import DockerHostMixin NODE_IMAGE_SUFFIXES = ["haproxy-router", "docker-registry", "deployer", "pod"] DEPLOYMENT_IMAGE...
zhiwliu/openshift-ansible
roles/openshift_health_checker/openshift_checks/docker_image_availability.py
Python
apache-2.0
13,335
0.003975
# -*- coding: utf-8 -*- from chunsabot.botlogic import brain from chunsabot.database import Database, Cache from bs4 import BeautifulSoup as Soup import requests #from threading import Thread from multiprocessing.pool import ThreadPool class Weather: cWEATHER_GET_URL = Database.load_config("weather_url_all") ...
susemeee/Chunsabot-framework
chunsabot/modules/weather.py
Python
mit
3,474
0.00489
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Core control stuff for coverage.py.""" import atexit import inspect import os import platform import sys import traceback from coverage import env, files from ...
jayhetee/coveragepy
coverage/control.py
Python
apache-2.0
44,134
0.000159
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from simplejson import load class Configuration(dict): def __init__(self, conf_fns): self.conf_fns = conf_fns for conf_fn in self.conf_fns: abs_conf_fn = os.path.abspath(conf_fn) if os.path.exists(a...
justinvanwinkle/flexiconfig
flexiconfig/__init__.py
Python
bsd-2-clause
419
0
from setuptools import setup setup( name='alfred-coordinator', version='0.1.dev', license='ISC', description='Streams tasks from listener to workers.', url='https://github.com/alfredhq/alfred-coordinator', author='Alfred Developers', author_email='team@alfredhq.com', py_modules=['alfre...
alfredhq/alfred-coordinator
setup.py
Python
isc
530
0
#!/usr/bin/env/python # -*- coding: utf-8 -*- ### ### Author: Chris Iatrou (ichrispa@core-vector.net) ### Version: rev 13 ### ### This program was created for educational purposes and has been ### contributed to the open62541 project by the author. All licensing ### terms for this source is inherited by the terms and...
Torben-D/open62541
tools/pyUANamespace/ua_builtin_types.py
Python
lgpl-3.0
59,096
0.01391
''' Provide special versions of list and dict, that can automatically notify about changes when used for property values. Mutations to these values are detected, and the properties owning the collection is notified of the changes. Consider the following model definition: .. code-block:: python class SomeModel(Mo...
Karel-van-de-Plassche/bokeh
bokeh/core/property/containers.py
Python
bsd-3-clause
14,792
0.001149
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cd_subscription', '0004_auto_20161125_1901'), ] operations = [ migrations.AlterField( model_name='cdsubscription...
cropr/bjk2017
cd_subscription/migrations/0005_auto_20161125_1908.py
Python
apache-2.0
2,446
0.003679
import os, helper, config, glob, loader from fabops import FabricTaskOperator from policies import PiServicePolicies from remote.integration import RemoteFileHelper from initd import InitScript, InitScriptWithTemplate, AutogeneratedInitScript pisetup_root_folder_on_pi ='/home/pi/pi-setup' piservice_standart...
creative-workflow/pi-setup
lib/piservices/piservice.py
Python
mit
5,056
0.013252
""" Mock classes for use in aws_federation_proxy_tests """ from __future__ import print_function, absolute_import, unicode_literals, division from aws_federation_proxy.aws_federation_proxy import AWSFederationProxy class MockAWSFederationProxyForInitTest(AWSFederationProxy): def _setup_provider(self): pa...
ImmobilienScout24/afp-core
src/unittest/python/aws_federation_proxy_mocks.py
Python
apache-2.0
323
0.003096
import pathlib import pprint import shutil from alcustoms import sql from alcustoms.tkinter import advancedtkinter, smarttkinter, style import tkinter as tk from tkinter import filedialog, messagebox, scrolledtext ttk = smarttkinter.ttk.ttk from alcustoms.methods import minimalist_pprint_pformat ##################...
AdamantLife/alcustoms
alcustoms/Programs/SQLExplorer.py
Python
gpl-3.0
16,142
0.019081