code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
import random import numpy as np import pprint import sys def generate_random_params(max_rumtime_mins = 2880, param_seed = 1234): random.seed(param_seed) np.random.seed(param_seed) # duration TIME_TAKEN_FOR_ONE_SIMULATION = 40 # minutes # params we are concerened about #CLUST...
roshantha9/AbstractManycoreSim
src/util_scripts/ccpbased_remapping_random_params_generation.py
Python
gpl-3.0
2,693
# Copyright 2015 Red Hat 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...
openstack/tripleo-heat-templates
tripleo_heat_templates/tests/test_environment_generator.py
Python
apache-2.0
18,844
# # Copyright (c) 2009 CodeSourcery # Copyright (c) 2013 Stefan Seefeld # All rights reserved. # # This file is part of OpenVSIP. It is made available under the # license contained in the accompanying LICENSE.GPL file. import os import qm from qm.fields import * import qm.test.base from qm.test.parameter_database ...
openvsip/openvsip
support/QMTest/benchmark_database.py
Python
gpl-2.0
7,885
# -*- coding: utf-8 -*- # Copyright 2013-2014 Sebastian Kreft # # 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...
sk-/git-lint
test/unittest/test_linters.py
Python
apache-2.0
18,490
#pragma out #pragma repy restrictions.veryslownetsend def foo(ip,port,sock, mainch, ch): data = sock.recv(1000) print ip,port,data stopcomm(ch) stopcomm(mainch) if callfunc == 'initialize': ip = getmyip() waitforconn(ip,<connport>,foo) sleep(.1) csock = openconn(ip,<connport>) csock.send('Hello, thi...
sburnett/seattle
repy/tests/ut_repytests_veryslownetsend-testrecv.py
Python
mit
382
# 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) from spack import * class Folly(CMakePackage): """Folly (acronymed loosely after Facebook Open Source Library) is a...
LLNL/spack
var/spack/repos/builtin/packages/folly/package.py
Python
lgpl-2.1
1,952
from datawrangling import CSV_Exercise,SQL_Exersice
enixdark/Data-Practices
paratices/__init__.py
Python
lgpl-3.0
51
import dataset import pylab import PIL.Image import numpy as np datapath = 'inpainting/val2014' paths = dataset.get_path_list(datapath) img = dataset.load_image(paths[0]) PIL.Image.fromarray(img.astype('uint8')).show() gen = dataset.generate_unflattened(datapath) masked, patch = gen.next() PIL.Image.fromarray(np.t...
gagnonlg/IFT6266-project
tests/test_gen_unflat.py
Python
gpl-3.0
546
# Program to create a file of usernames in batch mode. def main(): print("This program creates a file of usernames form a") print("file of names.") #get the file names infileName = input("What file are the names in?") outfileName = input("What file should the usernames go in? ") #open the files infile = open(...
src053/PythonComputerScience
chap5/userFile.py
Python
cc0-1.0
725
import bson import logging from mercury.inventory.db import InventoryDBController from mercury.common.asyncio.endpoints import ( async_endpoint, StaticEndpointController ) from mercury.common.exceptions import EndpointError from mercury.common.mongo import ( serialize_object_id, deserialize_object_id ) l...
jr0d/mercury
src/mercury/inventory/controller.py
Python
apache-2.0
4,532
from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from spider_helpers.Remix64Helper import Remix64Helper class Remix64Spider(CrawlSpider, Remix64Helper): name = 'remix64' allowed_domains = ['remix64.com'] start_urls = ['http://www.remix64...
tatsuhirosatou/elc-scrapers
research_scrapers/spiders/remix64_spider.py
Python
gpl-3.0
707
from __future__ import absolute_import, division, unicode_literals import param import numpy as np from matplotlib.collections import PatchCollection, LineCollection from ...core import util from ...core.options import abbreviated_exception from ...element import Polygons from .element import ColorbarPlot from .util...
basnijholt/holoviews
holoviews/plotting/mpl/path.py
Python
bsd-3-clause
6,599
import json from django.contrib.auth import get_backends from django.contrib.auth.models import User, AnonymousUser from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import Client from geonode.contrib.groups.models import Group, GroupInvitation from geonode.documents....
mishravikas/geonode-cas
geonode/contrib/groups/tests.py
Python
gpl-3.0
15,540
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Change directory to provide relative paths for doctests >>> import os >>> filepath = os.path.dirname( os.path.realpath( __file__ ) ) >>> datadir = os.path.realpath(os.path.join(filepath,...
iglpdc/nipype
nipype/interfaces/cmtk/nx.py
Python
bsd-3-clause
25,942
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # Imports ===================================================================== # Variables =================================================================== #: Categories used to choose RIV RIV_CATEGORIES = [ (1, "společenské,...
edeposit/edeposit.amqp.models
src/edeposit/amqp/models/riv.py
Python
mit
932
#!/usr/bin/evn python """ Senty Project Copyright(c) 2018 Senty. This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope it will be useful...
Kamalheib/senty
senty/tests/blocks/ibutils/ibstat.py
Python
gpl-2.0
1,599
from ..remote import RemoteModel class IfSettingRemote(RemoteModel): """ This table list out the interface settings. | ``CollectionInd:`` A flag indicating if data collection enabled on this interface. | ``attribute type:`` bool | ``created_at:`` The date and time the record was initially cr...
infobloxopen/infoblox-netmri
infoblox_netmri/api/remote/models/if_setting_remote.py
Python
apache-2.0
1,288
#!/usr/bin/python # # Python client for checking periodically for posted actions # on the Spacewalk servers. # # Copyright (c) 2000--2017 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including ...
renner/spacewalk
client/rhel/rhn-client-tools/src/bin/rhn_check.py
Python
gpl-2.0
15,754
# Copyright 2014 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. from mock import Mock from gerrit import GerritClient from test import CrBuildTestCase SHORT_CHANGE_ID = 'I7c1811882cf59c1dc55018926edb6d35295c53b8' CHANGE...
nicko96/Chrome-Infra
appengine/crbuild/gerrit/test/client_test.py
Python
bsd-3-clause
3,159
# ScummVM - Graphic Adventure Engine # Copyright (C) 2020 Stryzhniou Fiodar # ScummVM is the legal property of its developers, whose names # are too numerous to list here. Please refer to the COPYRIGHT # file distributed with this source distribution. # This program is free software; you can redistribute it and/or # ...
vanfanel/scummvm
backends/platform/symbian/symbian_builder/__init__.py
Python
gpl-2.0
2,331
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
bmanojlovic/ansible
lib/ansible/modules/network/junos/junos_config.py
Python
gpl-3.0
12,644
# # This file is part of pysmi software. # # Copyright (c) 2015-2016, Ilya Etingof <ilya@glas.net> # License: http://pysmi.sf.net/license.html # import os import sys import time from pysmi.reader.base import AbstractReader from pysmi.mibinfo import MibInfo from pysmi.compat import decode from pysmi import debug from py...
spirrello/spirrello-pynet-work
applied_python/lib/python2.7/site-packages/pysmi/reader/localfile.py
Python
gpl-3.0
4,425
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): for page in orm.InfoPage.objects.all(): page.publication_date = page.created page.save() def...
hzj123/56th
pombola/info/migrations/0004_default_publication_date_to_created.py
Python
agpl-3.0
1,605
# Copyright (c) 2019, Xilinx, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of con...
Xilinx/PYNQ
sdbuild/packages/xsdfec/package/setup.py
Python
bsd-3-clause
2,258
from array import array import rootpy import ROOT rootpy.log.basic_config_colorized() from rootpy.io import root_open from rootpy.plotting import Canvas,Graph from rootpy.plotting import set_style from statstools.finalfit_uncertband_plot import getPostFitPlottingObjects from statstools.finalfit_uncertband_plot import ...
qbuat/hhana
statstools/tests/test_finalfit_uncerband_plot.py
Python
gpl-3.0
2,790
# # module backwrd4.py # # backward chaining inference engine without exceptions; # see holmes/backwrd4.py and holmes.doc for more info; #################################################################### from match import * from index import Index from backward import ask_user, stop_proof pri...
simontakite/sysadmin
pythonscripts/programmingpython/Ai/ExpertSystem/holmes/holmes2/backwrd4.py
Python
gpl-2.0
2,586
# Copyright (C) 2008 Canonical Ltd # # 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 distributed in ...
fmccann/bzr-bisect
meta.py
Python
gpl-2.0
1,097
# coding: utf-8 # # This file is part of Sequana software # # Copyright (c) 2020 - Sequana Development Team # # Distributed under the terms of the 3-clause BSD license. # The full license is in the LICENSE file, distributed with this software. # # website: https://github.com/sequana/sequana # documentation: http:...
sequana/sequana
sequana/modules_report/rnadiff.py
Python
bsd-3-clause
18,611
itrf2008 =\ """ IGS_0194 -3766965.4504 3211877.1442 4008334.3092 -0.01092 -0.00334 -0.00407 2005.001413 IGS_1181 3800621.0195 882005.5846 5028859.6697 -0.01620 0.01588 0.00911 2005.001413 IGS_1311 -5543846.1330 -2054563.1366 2387814.3730 -0.00936 0.06292 0.03241 2005.001413 IGS_1404 1769693.2905 -5044504.5803 -346843...
softwarespartan/pyStk
referenceFrames.py
Python
mit
131,956
""" Unit tests for the web module. So far, tests the data retrieval functionality. """ from django.test import TestCase from django.test.client import Client from django.utils import simplejson as json # class DataRetrievalTest(TestCase): # # def setUp(self): # init_test_db() # self.c = Cli...
darrellsilver/norc
web/tests.py
Python
bsd-3-clause
2,380
from gi.repository import Gtk class ErrorDialogue(Gtk.MessageDialog): def __init__(self, message, details=None): Gtk.MessageDialog.__init__(self,None,Gtk.DialogFlags.MODAL,Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, message, title="An error occurred!") if details: self.format_se...
jnvsor/apgtk
errorwindow.py
Python
gpl-3.0
393
# -*- coding: iso-8859-1 -*- '''Module for organizing multiprocessing tasks. ''' ''' orbkit Gunter Hermann, Vincent Pohl, Lukas Eugen Marsoner Steinkasserer, Axel Schild, and Jean Christophe Tremblay Institut fuer Chemie und Biochemie, Freie Universitaet Berlin, 14195 Berlin, Germany This file is part of orbkit. or...
orbkit/orbkit
orbkit/omp_functions.py
Python
lgpl-3.0
2,923
# 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...
ghchinoy/tensorflow
tensorflow/python/autograph/converters/list_comprehensions_test.py
Python
apache-2.0
1,955
from Screens.Screen import Screen from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigText from Components.ConfigList import ConfigListScreen from Components.Label import Label from Components.ActionMap import ActionMap # for localized messages from . import _ class LastFMConfigS...
popazerty/try
lib/python/Plugins/Extensions/IniLastFM/LastFMConfig.py
Python
gpl-2.0
3,064
from distutils.core import setup setup( name='tincture', version='0.1.0', description='Django and SQLAlchemy all mixed up.', keywords='orm framework django sqlalchemy', url='https://github.com/grampajoe/tincture', license='MIT', author='Joe Friedl', author_email='joe@joefriedl.net', ...
grampajoe/tincture
setup.py
Python
mit
816
r''' Copyright: Brainwy Software Ltda. License: EPL. ============= Works for Windows relying on a fork of winappdbg which works in py2/3 (at least for the part we're interested in). See: https://github.com/fabioz/winappdbg (py3 branch). Note that the official branch for winappdbg is: https://github.com/Mari...
SlicerRt/SlicerDebuggingTools
PyDevRemoteDebug/ptvsd-4.1.3/ptvsd/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
Python
bsd-3-clause
21,414
# GemRB - Infinity Engine Emulator # Copyright (C) 2003 The GemRB Project # # 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 versi...
tomprince/gemrb
gemrb/GUIScripts/bg1/GUICG22.py
Python
gpl-2.0
3,963
#!/usr/bin/python import sys from itertools import repeat def compute_size(track): '''compute_size(str) -> (row,column,width,height) Given a track, compute the position of the first character and the track's width and height ex: compute_size('#-\--/---\--/-') -> (0,2,5,3) /-#-\ | | \---/ ''' ...
lagunex/TuentiChallenge4
p2/p2.py
Python
mit
3,047
# shipMissileThermDamageCC # # Used by: # Ship: Orthrus # Ship: Osprey Navy Issue type = "passive" def handler(fit, ship, context): fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), "thermalDamage", ship.getModifiedItemAttr("shi...
Ebag333/Pyfa
eos/effects/shipmissilethermdamagecc.py
Python
gpl-3.0
357
import os.path import collections import re import math import itertools INPUT=os.path.join(os.path.dirname(__file__), "input.txt") with open(INPUT) as f: data = f.read() ranges_re = re.compile(r"([\w ]+): (\d+)-(\d+) or (\d+)-(\d+)") def solve(data): mode = 0 all_ranges = [] my = [] others = [] ...
lamperi/aoc
2020/16/solve.py
Python
mit
2,800
__version__ = "2017.1"
lindsay-stevens/limesurveyrc2api
limesurveyrc2api/__init__.py
Python
mit
23
from header_meshes import * #################################################################################################################### # Each mesh record contains the following fields: # 1) Mesh id: used for referencing meshes in other files. The prefix mesh_ is automatically added before each mesh id....
berth64/modded_modded_1257ad
source/module_meshes.py
Python
agpl-3.0
96,702
import numpy as np import OpenGL.GL as GL from .element import GLElement, set_program_data class LineElement(GLElement): def __init__(self): super(LineElement, self).__init__(VERT_SHADER, FRAG_SHADER) def update(self, state, points, segments=False): super(LineElement, self).update(state) ...
tonysyu/deli
deli/app/vispy/lines.py
Python
bsd-3-clause
1,996
# -*- coding: utf-8 -*- # # jicbioimage.segment documentation build configuration file, created by # sphinx-quickstart on Wed Aug 26 09:00:45 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated...
JIC-CSB/jicbioimage.segment
docs/source/conf.py
Python
mit
12,020
from setuptools import setup def readme(): with open('README.rst') as f: return f.read() setup(name='countop', version='0.11', description='Count basic operations in algorithm implementations.', long_description=readme(), classifiers=[ 'Development Status :: 3 - Alpha', ...
ankur-gupta/countop
setup.py
Python
mit
690
# -*- coding: utf-8 -*- import unittest import os from typing import ( Set, List, NamedTuple ) import time import pandas as pd import conftest import libnano.ensemblrest as er if os.environ.get('IS_TRAVIS') is None: class TestEnsembleRest(unittest.TestCase): def test_getProbes(self): ...
libnano/libnano
tests/ensemblrest_test.py
Python
gpl-2.0
8,296
#!/usr/bin/env python # # 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/. import os, unittest, subprocess, tempfile, shutil, urlparse, zipfile, StringIO import mozcrash, ...
sean93park/mozjs24
js/src/testing/mozbase/mozcrash/tests/test.py
Python
mpl-2.0
7,381
# Copyright The PyTorch Lightning team. # # 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 i...
williamFalcon/pytorch-lightning
tests/trainer/dynamic_args/test_multiple_eval_dataloaders.py
Python
apache-2.0
5,213
"""w0401 dependency """ __revision__ = 0 import input.func_w0401 if __revision__: print input
godfryd/pylint
test/input/w0401_cycle.py
Python
gpl-2.0
101
from sympy.core.symbol import Dummy from sympy.core.add import Add from sympy.core.mul import Mul from sympy.core import Expr, S from sympy.core.sympify import sympify from sympy.core.numbers import Rational from sympy.ntheory import divisors from sympy.functions import exp, sqrt from sympy.polys import ( Poly, c...
tarballs-are-good/sympy
sympy/polys/polyroots.py
Python
bsd-3-clause
19,243
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ pyfootballmngr Copyright (C) <2012-2017> Markus Hackspacher This file is part of pyfootballmngr. pyfootballmngr 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...
MarkusHackspacher/pyfootballmngr
pyfootballmngr.py
Python
gpl-3.0
897
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test code for basic Factory classes. """ from __future__ import division, absolute_import import pickle from twisted.trial.unittest import TestCase from twisted.internet.task import Clock from twisted.internet.protocol import...
hlzz/dotfiles
graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/test/test_factories.py
Python
bsd-3-clause
4,811
"""Vimrc Generator Usage: vimrcgen.py generate -i <input_json> [-o <output_file>] vimrcgen.py default-config [-o <output_file>] vimrcgen.py (-h | --help) vimrcgen.py --version Options: -h --help Show this screen. --version Show version. """ from docopt import docopt from config_mgr import ConfigM...
MatanRubin/my.vim
virgene/main.py
Python
gpl-3.0
622
# -*- coding: utf-8 -*- # # Copyright (c) 2016 Intel Corp. # """ ServicesCheckCommand Plugin """ from ...plugin import DeclarePlugin from .services import ServicesCommand @DeclarePlugin('service_stop', 100) class ServicesStopCommand(ServicesCommand): """ServicesCheckCommand""" def __init__(self, device_name,...
intel-ctrlsys/actsys
actsys/control/commands/services/services_stop.py
Python
apache-2.0
563
import asyncio import os import weakref from concurrent.futures import ProcessPoolExecutor as PoolExecutor from uuid import UUID import psycopg2 from aiohttp import web from django.conf import settings from .. import aviews from .utils import save_image from . import image_processors cache = weakref.WeakValueDiction...
dvhbru/dvhb-hybrid
dvhb_hybrid/files/image.py
Python
mit
5,198
from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist # Create your models here. class UserData ( models.Model ): master = models.OneToOneField ( User, on_delete = models.CASCADE ) wins = models.IntegerField ( default = 0 ) ties = models.Int...
An-Alone-Cow/pyChess
pyChess/olaf/models.py
Python
mit
1,558
import os, stat, time, weakref from zope.interface import implements from twisted.internet import defer from foolscap.api import Referenceable, DeadReferenceError, eventually import allmydata # for __full_version__ from allmydata import interfaces, uri from allmydata.storage.server import si_b2a from allmydata.immutab...
gsb-eng/tahoe-lafs
src/allmydata/immutable/offloaded.py
Python
gpl-2.0
26,555
#!/usr/bin/env python # -*- coding: utf8 -*- import gevent from multiprocessing import Event from multiprocessing import Process from .base import Actor, BaseActor, AF_GREENLET, AF_PROCESS from .inbox import DequeInbox, ProcessInbox class GreenletActor(Actor): ''' Greenlet Actor ''' def __init__(self, n...
snakeego/pyactors
pyactors/green.py
Python
bsd-2-clause
3,799
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Simple Bot to reply to Telegram messages # This program is dedicated to the public domain under the CC0 license. """ This Bot uses the Updater class to handle the bot. First, a few handler functions are defined. Then, those functions are passed to the Dispatcher and re...
anbasile/pmu
bot/bot.py
Python
gpl-3.0
2,174
from django.shortcuts import render from rest_framework.generics import CreateAPIView from .serializers import * from rest_framework import generics from rest_framework.views import APIView from rest_framework.permissions import AllowAny from rest_framework.status import * from rest_framework.response import Response ...
linkingcharities/linkingcharities
Linking_Charities/payment/views.py
Python
mit
3,690
# # bootloader_advanced.py: gui advanced bootloader configuration dialog # # Jeremy Katz <katzj@redhat.com> # # Copyright 2001-2002 Red Hat, Inc. # # This software may be freely redistributed under the terms of the GNU # library public license. # # You should have received a copy of the GNU Library Public License # alo...
sergey-senozhatsky/anaconda-11-vlan-support
iw/bootloader_advanced_gui.py
Python
gpl-2.0
3,639
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import unittest import numpy as np import tensorflow as tf from sklearn.utils import shuffle from tqdm import tqdm import tensorlayer as tl from tensorlayer.cost import cross_entropy_seq from tensorlayer.models.seq2seq_with_attention import Seq2seqLuongAttentio...
zsdonghao/tensorlayer
tests/models/test_seq2seq_with_attention.py
Python
apache-2.0
3,633
from seleniumhelpers import SeleniumTestCase from seleniumhelpers import get_default_timeout from seleniumhelpers import get_setting_with_envfallback
espenak/django_seleniumhelpers
seleniumhelpers/__init__.py
Python
bsd-3-clause
150
# -*- coding: utf-8 -*- import re import logging from flask import Blueprint, jsonify, request, session from common.utils import message, encrypt from businesses import notebook from ._helpers import require_login, notebook_ownership_check, current_user_has_notebook api = Blueprint("notebook", __name__) @api.route("/...
livoras/feifanote-server
apis/notebook.py
Python
mit
3,378
import argparse import os from filelock import FileLock import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms import torch.utils.data.distributed import horovod.torch as hvd from horovod.ray import RayExecutor def metric_average(val, name): ...
ray-project/ray
python/ray/util/horovod/horovod_example.py
Python
apache-2.0
7,092
# Copyright 2016 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Implements a client library for reading and writing LUCI_CONTEXT compatible files. Due to arcane details of the UNIX process model and environ...
luci/recipes-py
recipe_engine/third_party/luci_context/luci_context.py
Python
apache-2.0
8,876
# temporary exchanger for ApiritifPlugin stuff import time import traceback import apiritif from apiritif.samples import ApiritifSampleExtractor, Sample, PathComponent from apiritif.utils import get_trace writer = None class SampleController(object): def __init__(self, log, session): self.current_sample...
Blazemeter/apiritif
apiritif/store.py
Python
apache-2.0
4,004
#!/usr/bin/env python ################################################################ # LiveQ - An interactive volunteering computing batch system # Copyright (C) 2013 Ioannis Charalampidis # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License ...
wavesoft/LiveQ
tools/gen-couch-histos.py
Python
gpl-2.0
2,695
#======================================================================= # TestSimpleSource #======================================================================= from pymtl import * from pclib.ifcs import OutValRdyBundle #----------------------------------------------------------------------- # TestSimpleSour...
Glyfina-Fernando/pymtl
pclib/test/TestSimpleSource.py
Python
bsd-3-clause
1,799
#!/usr/bin/python # https://matplotlib.org/api/animation_api.html import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation fig, ax = plt.subplots() xdata, ydata = [], [] ln, = plt.plot([], [], 'ro', animated=True) def init(): ax.set_xlim(0, 2*np.pi) # ax.set_xlim(-1,...
jtraver/dev
python/matplotlib/anim4.py
Python
mit
1,023
class Solution: # @return a string def longestPalindrome(self, s): n = len(s) t = [[False for i in range(n)] for j in range(n)] start = 0 max_len = 1 for i in range(n): t[i][i] = True for i in range(n - 1): j = i + 1 if s[i] == ...
huanqi/leetcode-python
longest_palindromic_substring/solution.py
Python
bsd-2-clause
770
from enum import Enum API_BASE = 'https://api.gotinder.com' CONTENT_BASE = 'https://content.gotinder.com' USER_AGENT = 'Tinder Android Version 6.4.1' HEADERS = { "Content-Type": "application/json; charset=utf-8", "User-Agent": USER_AGENT, "Host": API_BASE, "os_version": "1935", "app-version": "37...
ZehLuckmann/Roger
src/tinder/constants.py
Python
gpl-3.0
882
import urllib urllib.urlretrieve('http://m0.songtaste.com/201404272218/695d86e96f77c35d727c36b66c914671/0/03/0394529cd76f680fdde7736b4a42bf05.mp3', '123.mp3')
vamdt/spider
music/test.py
Python
mit
160
import sys, json import requests import re from functional import seq ''' glencoe_resp = { "media1": { "source_href": "https://static-movie-usa.glencoesoftware.com/source/10.7554/659/0f10378e095dde7aaf579af504c4bfdc6fb86550/elife-00569-media1.wmv", "doi": "10.7554/eLife.00569.019", "flv_hre...
jhroot/elife-bot
provider/glencoe_check.py
Python
mit
3,847
# class: Rational. # # primary authors: Trevor Baca, Victor Adan. # optimization: Jared Grubb. # mailto: trevorbaca (at) gmail (dot) com. # # svn version num: 89. def gcd(a, b): while b: a, b = b, a % b return abs(a) def lcm(*values): return reduce(lambda a, b: a * b / gcd(a, b), values, value...
danifelipe/freedots
python/freedots/utils/rational.py
Python
gpl-3.0
3,650
import csv print('yo') print('Whatever') for x in xrange(1,10): print(x) pass
potetball/Active
Python/yolo.py
Python
gpl-3.0
79
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-30 12:48 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('boards', '0069_auto_20170530_1425'), ('reports', '0013_auto_20170530_1425'), ] operat...
diegojromerolopez/djanban
src/djanban/apps/reports/migrations/0014_auto_20170530_1448.py
Python
mit
770
import mediatek import fresh_tomatoes '''this objects are taking title, imageUrl and trailerUrl as input''' shawshank_redemption = mediatek.Movie("the Shawshank Redemption", "http://pics.filmaffinity.com/" "the_shawshank_redemption-576140557-"...
voeller1984/ud036_StarterCode
movie_mixer.py
Python
mit
3,777
#!/usr/bin/python # -*- coding: cp1252 -*- # #Kegelstump_Abwicklung_2dxf.py #Programmer: Christian Kohlöffel #E-mail: n/A # #Copyright 2008 Christian Kohlöffel # #Distributed under the terms of the GPL (GNU Public License) # #dxf2gcode is free software; you can redistribute it and/or modify #it under the terms of t...
workflo/dxf2gcode
python_examples/Kegelstump_Abwicklung_2dxf.py
Python
gpl-3.0
12,174
# Copyright 2013 B1 Systems GmbH # # 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 ag...
JioCloud/horizon
openstack_dashboard/dashboards/admin/hypervisors/panel.py
Python
apache-2.0
942
from django.contrib import admin from facts.models import Fact admin.site.register(Fact)
evildmp/facts
facts/admin.py
Python
mit
90
''' Created on 03.04.2017 @author: smittnac ''' import logging import machine AMI_CENTOS = {'ap-northeast-1': 'ami-571e3c30', 'ap-northeast-2': 'ami-97cb19f9', 'ap-southeast-1': 'ami-30318f53', 'ap-southeast-2': 'ami-24959b47', 'ap-south-1': 'ami-11f0837e', ...
seppi91/priceScheduler
pricescheduler/instance/scripts/machine.py
Python
mit
2,783
#! env python """Archives a directory using the ZIP format.""" from optparse import OptionParser import os from dir_archive import ZipDirArchive if __name__ == '__main__': usage = """%prog [options] dir_name Archive dir_name into a .zip file. """ parser = OptionParser(usage=usage) parser.add...
mrwizard82d1/pyutils
zip_dirname.py
Python
apache-2.0
988
#/usr/bin/env python def fib(): a,b = 1, 1 while True: yield a a,b = b, a+b
Akrog/project-euler
common/fibonacci.py
Python
mit
101
from django.conf import settings from django.core.exceptions import ImproperlyConfigured class Configuration(object): def __init__(self, **kwargs): self.defaults = kwargs def __getattr__(self, k): try: return getattr(settings, k) except AttributeError: if k i...
inverse-inc/packetfence-pki
inverse/conf.py
Python
gpl-2.0
1,540
# -*- coding: utf-8 -*- # # setup.py # # Copyright 2015 Base4 Sistemas Ltda ME # # 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 re...
base4sistemas/sathub
setup.py
Python
apache-2.0
3,621
#! python """ Test the lazy looping calculator """ from carousel.core import Registry, UREG from carousel.core.formulas import FormulaRegistry from carousel.core.data_sources import DataRegistry from carousel.core.outputs import OutputRegistry # from uncertainty_wrapper import unc_wrapper_args from carousel.contrib.l...
mikofski/Carousel
carousel/contrib/test_lazy_loop_calculator.py
Python
bsd-3-clause
4,001
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2016 Fabio Falcinelli # # This program 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 optio...
mhils/pydivert
setup.py
Python
lgpl-3.0
3,017
import concurrent.futures import itertools import logging import backoff import waffle from django.apps import apps from django.core.management import BaseCommand, CommandError from django.db import connection from django.db.models.signals import post_delete, post_save from course_discovery.apps.api.cache import api_...
edx/course-discovery
course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py
Python
agpl-3.0
8,126
# Copyright 2014-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
chrislit/abydos
abydos/distance/__init__.py
Python
gpl-3.0
32,671
"""This package provides some MOSP tools. - analyse_map helps to analyse maps, map partitions, aso. - node_finder shows a map and helps to find node ids on it - profile_wiggler is an example of profiling MOSP - heatmap generates a map heatmap based on logs - see example """
bhenne/MoSP
mosp_tools/__init__.py
Python
gpl-3.0
278
# 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 ...
AutorestCI/azure-sdk-for-python
azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resources_operations.py
Python
mit
31,545
############################################################################## # Copyright (c) 2013-2016, 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...
lgarren/spack
var/spack/repos/builtin/packages/dmlc-core/package.py
Python
lgpl-2.1
2,429
""" Fixture to configure XQueue response. """ import requests import json from common.test.acceptance.fixtures import XQUEUE_STUB_URL class XQueueResponseFixtureError(Exception): """ Error occurred while configuring the stub XQueue. """ pass class XQueueResponseFixture(object): """ Configu...
louyihua/edx-platform
common/test/acceptance/fixtures/xqueue.py
Python
agpl-3.0
1,433
import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d.axes3d import Axes3D from matplotlib.lines import Line2D from matplotlib.ticker import MaxNLocator g = np.genfromtxt("const_energy_2503.dat") g = g[(g.T[4]<3000)*(g.T[6]<3000)*(g.T[5]<3000)] lloops = g[g.T[9]>0.5] sloops = g[g.T[7]>0.5] boxs...
jobovy/tact
aa/genfunc/3d_plot.py
Python
gpl-3.0
2,972
# function for insertion sort def Insertion_Sort(array): for i in range(1, len(array)): temp = array[i] j = i - 1 while j >= 0 and array[j] > temp: array[j + 1] = array[j] j -= 1 array[j + 1] = temp # function to print array def Print_Array(array): for ...
KavyaSharma/Algo_Ds_Notes
Insertion_Sort/Insertion_Sort.py
Python
gpl-3.0
492
# ----------------------------------------------------------------------- # OpenXenManager # # Copyright (C) 2009 Alberto Gonzalez Rodriguez alberto@pesadilla.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 Soft...
alanfranz/openxenmanager
openxenmanager/core/oxcSERVER_newvm.py
Python
gpl-2.0
9,674
from sqlshare_rest.test import CleanUpTestCase from sqlshare_rest.util.db import get_backend from django.db import connection from sqlshare_rest.dao.dataset import create_dataset_from_query from sqlshare_rest.dao.dataset import set_dataset_accounts from sqlshare_rest.models import User from django.test.utils import ove...
uw-it-aca/sqlshare-rest
sqlshare_rest/test/dao/dataset.py
Python
apache-2.0
3,575
# Copyright 2020 Makani Technologies 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 agreed to...
google/makani
analysis/control/trans_in.py
Python
apache-2.0
43,237
#!/usr/bin/env python # -*- coding: utf-8 -*- from tacit import tac_slices for chunk in tac_slices('data/ordered.list', 2): print repr(chunk)
moskytw/tacit
tests/test_tail_chunks.py
Python
mit
148