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
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
SmartInfrastructures/fuel-web-dev
nailgun/nailgun/extensions/volume_manager/handlers/disks.py
Python
apache-2.0
3,400
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.md')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.txt')) as f: CHANGES = f.read() requires = [ ] tests_require = [ 'WebTest >= 1.3.1', # py3...
esentino/pythonpolign
setup.py
Python
gpl-3.0
903
import attr import re from navmazing import NavigateToAttribute, NavigateToSibling from widgetastic_patternfly import Input, BootstrapSelect, Button, BootstrapSwitch # TODO replace with dynamic table from widgetastic_manageiq import VanillaTable, SummaryFormItem, Table, Dropdown from widgetastic.widget import Checkbox...
akarol/cfme_tests
cfme/configure/configuration/region_settings.py
Python
gpl-2.0
36,046
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-24 19:04 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("configuration", "0002_auto_20161024_1842"), ] operations = [ migrations.AlterModelO...
cdriehuys/chmvh-website
chmvh_website/configuration/migrations/0003_auto_20161024_1904.py
Python
mit
440
#! /bin/env python # # Protein Engineering Analysis Tool Structure Analysis (PEATSA) # Copyright (C) 2010 Michael Johnston & Jens Erik Nielsen # # Author: Michael Johnston # # 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 # th...
dmnfarrell/peat
PEATSA/Tools/Vitality.py
Python
mit
8,168
"""DWC Network Server Emulator Copyright (C) 2014 polaris- Copyright (C) 2014 msoucy Copyright (C) 2015 Sepalani This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either...
sepalani/dwc_network_server_emulator
gamespy_player_search_server.py
Python
agpl-3.0
5,974
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
XeCycle/indico
indico/MaKaC/webinterface/rh/trackModif.py
Python
gpl-3.0
39,643
""" Base class for the calculation of reduced and minimal intrinsic informations. """ from abc import abstractmethod import numpy as np from ... import Distribution from ...algorithms import BaseAuxVarOptimizer from ...exceptions import ditException from ...math import prod from ...utils import unitful __all__ = (...
dit/dit
dit/multivariate/secret_key_agreement/base_skar_optimizers.py
Python
bsd-3-clause
25,213
# -*- coding: utf-8 -*- import sys import tweepy import webbrowser import time reload(sys) sys.setdefaultencoding("utf-8") # Pegando a consulta por parâmetro consulta = sys.argv[1:] #Autenticações consumer_key = 'w8FmJROsBCnoirSqZxZbg' consumer_secret = 'PoPc3qVdDWYzYHAo22xqnLfPXQdS2TLa8iucBLOqk' access_token = ...
ronanlopes/ufsjbot
UFSJBot.py
Python
gpl-2.0
1,738
#! /usr/bin/env python import os import sys import re import logging if __name__ == '__main__': # According to the python sys.path documentation, the directory containing # the main script appears as sys.path[0]. utildir = sys.path[0] assert(os.path.basename(utildir) == 'util') andir = os.path.dirn...
blackball/an-test6
util/fits2fits.py
Python
gpl-2.0
4,096
#!/usr/bin/env python """RESTful Open Annotation server based on Eve. The RESTful Open Annotation API is primarily implemented using two ways of modifying the Eve default API: 1. global configuration of keys in settings.py to use OA names, e.g. "annotatedAt" instead of the default "_created". 2. event hooks to mod...
restful-open-annotation/eve-restoa
server.py
Python
mit
1,296
import Orange data = Orange.data.Table("lenses") rules = Orange.associate.AssociationRulesInducer(data, support=0.3) rule = rules[0] print "Rule: ", rule, "\n" print "Supporting data instances:" for d in data: if rule.appliesBoth(d): print d print print "Contradicting data instances:" for d in data: ...
yzl0083/orange
docs/reference/rst/code/associate-traceback.py
Python
gpl-3.0
397
# -*- coding: utf-8 -*- from widgetastic_patternfly import BootstrapSelect from widgetastic_patternfly import Button from cfme.base.ui import AutomateImportExportBaseView from cfme.base.ui import AutomateImportExportView from cfme.utils.appliance import Navigatable from cfme.utils.appliance.implementations.ui import n...
RedHatQE/cfme_tests
cfme/automate/import_export.py
Python
gpl-2.0
4,955
# -*- coding: utf-8 -*- # # # This file is a part of 'django-stoba' project. # # Copyright (c) 2016, Vassim Shahir # 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 sourc...
vassim/django-stoba
stoba/core/helper.py
Python
bsd-3-clause
2,583
# -*- coding: utf-8 -*- from collections import deque from sql import Table, Literal from nereid import render_template, route from nereid.globals import session, request, current_app from nereid.helpers import slugify, url_for from nereid import jsonify, Markup from nereid.contrib.pagination import Pagination from ne...
priyankarani/nereid-catalog
product.py
Python
bsd-3-clause
17,920
# -*- coding: utf-8 -*- ############################################################################## # # OERPLib # Copyright (C) 2013 Sébastien Alix. # # 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 ...
etsinko/oerplib
oerplib/service/inspect/relations.py
Python
lgpl-3.0
18,356
import StateMod1 class Board(): # This class is used to reason about the board. # A board is read from file and converted into a 2d array # 'S' is start 'G' is goal '#' is obstacle def __init__(self, filename): inputhandler = InputHandler(filename) self.dimensions = inputhandler.dimens...
pmitche/it3105-aiprogramming
project1/module1/board.py
Python
mit
2,229
__author__ = 'Elliott' from django.http import HttpResponse from models import * def renamejp2(request): log="<html><head></head><body><h1>Successful changes</h1><div>" errors="<h1>ERRORS</h1><div>" #Get all page legacy records pl=PageLegacy.objects.all() #Try to get page on server ...
kcl-ddh/chopin-online
ocve/scripts/renamejp2.py
Python
gpl-3.0
493
from __future__ import division, absolute_import, print_function import re import os import sys import types from copy import copy from distutils.ccompiler import * from distutils import ccompiler from distutils.errors import DistutilsExecError, DistutilsModuleError, \ DistutilsPlatformEr...
nan86150/ImageFusion
lib/python2.7/site-packages/numpy/distutils/ccompiler.py
Python
mit
22,819
import datetime import glob import importlib import logging import os import re import sys import time import traceback from django.core.management.base import BaseCommand from django.conf import settings # from django.core.management.base import CommandError from watchdog.observers import Observer from watchdog.even...
mnieber/shared-goal
django/django_dominate/management/commands/update_python_templates.py
Python
apache-2.0
3,450
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-07 10:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0004_warningconstraint'), ] operations = [ migrations.AlterField( ...
c3cashdesk/c6sh
src/postix/core/migrations/0005_auto_20160207_1138.py
Python
agpl-3.0
485
# coding: utf-8 # Author: Milan Kubik
apophys/ipaqe-dyndir
tests/__init__.py
Python
mit
38
# coding = utf-8 """ 多个线程队列轮询 Ref: http://python3-cookbook.readthedocs.io/zh_CN/latest/c12/p13_polling_multiple_thread_queues.html """ import queue import socket import os class PollableQueue(queue.Queue): def __init__(self): super().__init__() # 创建一对链接的套接口 if os.name == "posix": self._putsocket, self._getso...
Ginkgo-Biloba/Misc-Python
cookbook/PollableQueue.py
Python
gpl-3.0
1,349
# Copyright (c) 2018 Red Hat, Inc. # All Rights Reserved. import dateutil import logging from django.db.models import ( Count, F, ) from django.db import transaction from django.shortcuts import get_object_or_404 from django.utils.timezone import now from django.utils.translation import ugettext_lazy as _ fr...
wwitzel3/awx
awx/api/views/mixin.py
Python
apache-2.0
13,324
#!/usr/bin/python import OpenSSL.crypto import argparse import base64 import glob import k8s import os import shutil import yaml def sn(): sn = int(open("/etc/origin/master/ca.serial.txt").read(), 16) sntext = "%X" % (sn + 1) if len(sntext) % 2: sntext = "0" + sntext open("/etc/origin/maste...
RedHatEMEA/aws-ose3
target/reip.py
Python
apache-2.0
18,095
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course_groups', '0001_initial'), ('bulk_email', '0003_config_model_feature_flag'), ] operations = [ migrations.CreateModel( name='Target', fields=[ ...
eduNEXT/edx-platform
lms/djangoapps/bulk_email/migrations/0004_add_email_targets.py
Python
agpl-3.0
1,465
# Copyright (C) 2016 Ross D Milligan # GNU GENERAL PUBLIC LICENSE Version 3 (full notice can be found at https://github.com/rdmilligan/PyMovieStudio) from constants import * from pygame import mixer from time import sleep class Screen: # initialise def __init__(self, config_provider, disk, display, replay, g...
rdmilligan/PyMovieStudio
scripts/screen/screen.py
Python
gpl-3.0
1,267
from django import http from django.utils.translation import ugettext from olympia.access import acl from olympia.addons.models import Addon from olympia.amo.feeds import NonAtomicFeed from olympia.amo.templatetags.jinja_helpers import absolutify, page_name from olympia.amo.urlresolvers import reverse from olympia.bro...
harry-7/addons-server
src/olympia/bandwagon/feeds.py
Python
bsd-3-clause
2,373
# # try: # from numpy import * # a=zeros((rows,cols),float) # except ImportError: # #use a list if we have to # a=[] # for i in range(rows): # a+=[[0.]*cols] # #use a list if we have to try: from numpy import * def matrix(rows, cols): return zeros((rows,cols),float) e...
kaspermunch/MultiPurpose
MultiPurpose/Needle.py
Python
gpl-2.0
10,265
import numpy as np from bokeh.document import Document from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid from bokeh.models.glyphs import Rect from bokeh.plotting import show N = 9 x = np.linspace(-2, 2, N) y = x**2 w = x/15.0 + 0.3 h = y/20.0 + 0.3 source = ColumnDataSource(dict(x=x, y=y...
phobson/bokeh
tests/glyphs/Rect.py
Python
bsd-3-clause
924
import Rohwabot import random import glob import serverPackets import exceptions import userHelper import time import systemHelper """ Commands callbacks Must have fro, chan and messages as arguments fro -- name of who triggered the command chan -- channel where the message was sent message -- list containing argume...
RlSEN/bannedcho
c.ppy.sh/RohwabotCommands.py
Python
gpl-3.0
10,057
# -*- coding: utf-8 -*- """ logbook ~~~~~~~ Simple logging library that aims to support desktop, command line and web applications alike. :copyright: (c) 2010 by Armin Ronacher, Georg Brandl. :license: BSD, see LICENSE for more details. """ import os from logbook.base import LogRecord, Logger...
agustinhenze/logbook.debian
logbook/__init__.py
Python
bsd-3-clause
1,683
import sys from os import path, getpid from dsat.state import state_wrapper from dsat.linux_mtime import m_time as time from random import randint from time import sleep from dsat.state import get_connection, construct_info import sched from time import sleep import logging cpu_f = open("/proc/loadavg") def every(x...
jul/dsat
example/cpu.py
Python
bsd-2-clause
1,061
import numpy as np from numpy import linalg as LA import matplotlib.pyplot as plt from dynamic_graph import plug from dynamic_graph.sot.application.stabilizer import LinearizedTableCartDevice, ZMPtoCoMAlgerbraicController import math cart = LinearizedTableCartDevice("cart") controller = ZMPtoCoMAlgerbraicController("c...
amifsud/sot-stabilizer
src/prototyping/simu.py
Python
lgpl-3.0
1,980
# -*- coding: utf-8; -*- # This file is a part of sensbiotk # Contact : sensbio@inria.fr # Copyright (C) 2014 INRIA (Contact: sensbiotk@inria.fr) # # 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 Foundatio...
sensbio/sensbiotk
examples/pedometer/pedometer.py
Python
gpl-3.0
3,521
from south.db import db from django.db import models from mypage.pages.models import * class Migration: def forwards(self, orm): # Deleting field 'WidgetInPage.rendered_widget' db.delete_column('pages_widgetinpage', 'rendered_widget_id') def backwards(self, orm...
ella/mypage
mypage/pages/migrations/0004_remove_rendered_widget_fk.py
Python
bsd-3-clause
3,021
from __future__ import absolute_import import pygame import sappho.layers from .common import compare_surfaces class TestSurfaceLayers(object): """ Do not need to test create_surface_layers(), because it's inherent to SurfaceLayers' initialization and everything else tested. """ NUMBER_OF...
lillian-gardenia-seabreeze/sappho
tests/test_layers.py
Python
mit
2,612
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './ConfigurationPages/Form_HubPage.ui' # # Created: Mon Sep 9 21:29:22 2013 # by: PyQt4 UI code generator 4.8.6 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QStri...
dlintott/gns3
src/GNS3/Ui/ConfigurationPages/Form_HubPage.py
Python
gpl-2.0
2,806
# -*- test-case-name: twisted.words.test.test_irc -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Internet Relay Chat Protocol for client and server. Future Plans ============ The way the IRCClient class works here encourages people to implement IRC clients by subclassing th...
hortonworks/hortonworks-sandbox
desktop/core/ext-py/Twisted/twisted/words/protocols/irc.py
Python
apache-2.0
83,138
# encoding: utf-8 # Copyright: 2013 Ivan Korobkov <ivan.korobkov@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
pdef/pdef-python
python/src/pdef/__init__.py
Python
apache-2.0
999
import inspect import dill import sys import ast from .custom_exceptions import * from .connector import * def format(sourceLines): # removes indentation head = sourceLines[0] while head[0] == ' ' or head[0] == '\t': sourceLines = [l[1:] for l in sourceLines] head = sourceLines[0] return ...
Catalearn/catalearn
catalearn/runner.py
Python
mit
5,437
# -*- coding: utf-8 -*- # # Copyright 2016-2022 BigML # # 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 ...
bigmlcom/python
bigml/api_handlers/batchtopicdistributionhandler.py
Python
apache-2.0
5,155
#bprop.py #Author: Nicholas Smith import numpy as np #Array of layer sizes ls = np.array([2, 4, 4, 1]) n = len(ls) #List of weight matrices (each a numpy array) W = [] #Initialize weights to small random values for i in range(n - 1): W.append(np.random.randn(ls[i], ls[i + 1]) * 0.1) #List of bias vectors initialize...
nicholastoddsmith/pythonml
bprop.py
Python
mit
1,935
from base.iterativeRecommender import IterativeRecommender import numpy as np from util import config from collections import defaultdict from math import log,exp from scipy.sparse import * from scipy import * class CoFactor(IterativeRecommender): def __init__(self, conf, trainingSet=None, testSet=None, fold='[1]'...
recq-cse/RecQ
model/ranking/CoFactor.py
Python
gpl-3.0
7,469
# 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 # distributed under t...
midonet/kuryr
kuryr/schemata/network_create.py
Python
apache-2.0
1,892
from django.contrib.auth.models import User, Group from django.contrib.auth import login, authenticate from django.shortcuts import redirect from disciplinesite.demo.models import * from disciplinesite.tools import * from discipline.models import * def index(request): grp = Group.objects.get(name="editors") f...
boronine/discipline
disciplinesite/demo/views.py
Python
mit
778
#!/usr/bin/python # android-build.py # Build android # # use cocos console to build tests import sys import os, os.path import shutil from optparse import OptionParser CPP_SAMPLES = ['cpp-empty-test', 'cpp-tests', 'game-controller-test'] LUA_SAMPLES = ['lua-empty-test', 'lua-tests', 'lua-game-controller-test'] ALL_SA...
tofurama3000/The-Obscurity-Project
cocos2d/build/android-build.py
Python
mit
3,466
from google.appengine.api import mail from secrets import * import logging def send_email(to, subject, body): logging.info('sending an email from ' + Secrets.EMAIL_FROM + ' to: ' + to) message = mail.EmailMessage(sender=Secrets.EMAIL_FROM, subject=subject, body=body, to=to) message.send() def send_email_to_admi...
bbondy/brianbondy.gae
emailController.py
Python
mit
540
""" Test of the classical LM model for language modelling """ from groundhog.datasets import LMIterator from groundhog.trainer.SGD_momentum import SGD as SGD_m from groundhog.trainer.SGD import SGD from groundhog.mainLoop import MainLoop from groundhog.layers import MultiLayer, \ RecurrentMultiLayer, \ Re...
vseledkin/LV_groundhog
tutorials/DT_RNN_Tut.py
Python
bsd-3-clause
14,392
#!/usr/bin/env python3 from __future__ import print_function, division from rnnlm_ops import RnnlmOp, run_epoch from dataset import SingleSentenceData from config import Config import sys from util import SpeedCounter import tensorflow as tf class Loglikes(RnnlmOp): def __init__(self, config, params): super(Log...
pltrdy/tf_rnnlm
loglikes.py
Python
apache-2.0
1,460
from datetime import datetime import logging from sqlalchemy import Table, Column, ForeignKey, or_ from sqlalchemy import DateTime, Integer, Unicode import meta log = logging.getLogger(__name__) twitter_table = Table( 'twitter', meta.data, Column('id', Integer, primary_key=True), Column('create_time', ...
whausen/part
src/adhocracy/model/twitter.py
Python
agpl-3.0
2,128
#!/usr/bin/env python3 # encoding: utf-8 """ test_user_db.py Created by Aaron Crosman on 2015-02-18. This file is part of historia. historia 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...
acrosman/historia
src/tests/test_user_db.py
Python
gpl-3.0
14,746
class TestOSD(object): def test_osds_are_all_collocated(self, node, host): # TODO: figure out way to paramaterize node['vars']['devices'] for this test osd_auto_discovery = node["vars"].get('osd_auto_discovery', False) if osd_auto_discovery: node["vars"]["devices"] = ["/dev/sda...
bengland2/ceph-ansible
tests/functional/tests/osd/test_journal_collocation.py
Python
apache-2.0
597
config = { # This config file will be detected in localhost environment and values defined here will overwrite those in config.py 'environment': "localhost", # ----> ADD MORE CONFIGURATION OPTIONS HERE <---- }
shupelneker/gae_new_structure
config/localhost.py
Python
lgpl-3.0
212
from opencog.atomspace import types, TruthValue, get_type_name import formulas from pln.rule import Rule ''' Some Rules evaluate various kinds of logical links based explicitly on set membership. A set = a ConceptNode. Other Rules calculate them heuristically, based on set probabilities and logical links. ''' # Todo:...
zhaozengguang/opencog
opencog/python/pln/rules/inheritance_rules.py
Python
agpl-3.0
9,893
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
ovnicraft/openerp-restaurant
point_of_sale/wizard/pos_receipt.py
Python
agpl-3.0
2,288
class dbscan(): """ This class can be used to locate areas of the interplanetsry space that are 'dense' at one epoch. Essentially, it locates planet clusters """ from PyKEP.core import AU, EARTH_VELOCITY def _axis_equal_3d(self, ax): """Rescales 3D axis limits using equal scale.""" ...
Yawgmoth90/pykep
PyKEP/phasing/_dbscan.py
Python
gpl-3.0
6,903
#-*-coding:utf-8-*- # 输时的图像 import pygame from pygame.locals import * from sys import exit from pylib.vector import Vector class Lost(object): def __init__(self,surface): self.surface=surface pygame.image.save(self.surface,'./images/lost.png')# 存储背景图片 self.background_image=pygame.image.loa...
lavotap/2048
gui/lost.py
Python
gpl-2.0
1,912
#!/usr/bin/env python __version__ = '$Revision: 4791 $'.split()[1] __date__ = '$Date: 2012-10-20 $'.split()[1] __author__ = 'xmlbinmsg' __doc__=''' Autogenerated python functions to serialize/deserialize binary messages. Generated by: ../scripts/aisxmlbinmsg2py.py Need to then wrap these functions with the outer A...
stregoika/aislib
ais/ais_msg_9.py
Python
gpl-3.0
48,470
# -*- coding: utf-8 -*- # Copyright 2014-2018 Rumma & Ko Ltd # License: BSD, see LICENSE for more details. """ Defines the :rst:dir:`sigal_image` directive. .. rst:directive:: sigal_image .. _picsel: https://github.com/lsaffre/picsel .. _Shotwell: https://en.wikipedia.org/wiki/Shotwell_%28software%29 .. _digiKam: ht...
khchine5/atelier
atelier/sphinxconf/sigal_image.py
Python
bsd-2-clause
8,318
#!/usr/bin/env python # coding: latin-1 """ This module is designed to communicate with the ZeroBorg Use by creating an instance of the class, call the Init function, then command as desired, e.g. import ZeroBorg ZB = ZeroBorg.ZeroBorg() ZB.Init() # User code here, use ZB to control the board Multiple boards can be u...
amorphic/sparkcc-formulapi
race_code/zero_borg.py
Python
mit
28,297
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('boards', '0003_board_channel'), ] operations = [ migrations.AlterModelOptions( name='post', options=...
hedin/paraboard-back
paraboard/boards/migrations/0004_auto_20150415_1513.py
Python
apache-2.0
594
import os import re import redis import pickle import string from enum import Enum from constants import RegistryKeys from voluptuous import Schema, Required, Any, MultipleInvalid # Get redis host and port via environment variable REDIS_HOST = os.environ['REDIS_HOST'] REDIS_PORT = os.environ['REDIS_PORT'] # Redis ke...
lahsivjar/jarvis-kube
core/orchestrator/src/serviceregistry.py
Python
mit
3,331
# Test/__init__.py # # Copyright (C) 2005 Jens Gutzeit <jens@jgutzeit.de> # # 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...
ProgVal/PyCorewar
Test/__init__.py
Python
gpl-2.0
776
# Spreading Udaciousness # One of our modest goals is to teach everyone in the world to program and # understand computer science. To estimate how long this will take we have # developed a (very flawed!) model: # Everyone answering this question will convince a number, spread, (input to # the model) of their friend...
codecakes/random_games
order_of_growth_target.py
Python
mit
2,382
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> 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 right...
croxis/SpaceDrive
spacedrive/renderpipeline/samples/download_samples.py
Python
mit
1,629
#!/usr/bin/env python """ split_file.py [-o <dir>] <path> Take the file at <path> and write it to multiple files, switching to a new file every time an annotation of the form "// BEGIN file1.swift" is encountered. If <dir> is specified, place the files in <dir>; otherwise, put them in the current directory. """ impo...
khizkhiz/swift
utils/split_file.py
Python
apache-2.0
1,030
# -*- coding: UTF-8 -*- # Copyright 2012-2020 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) import logging ; logger = logging.getLogger(__name__) # import os # import yaml # import base64 from unipath import Path from django.db import models from django.conf import se...
lino-framework/xl
lino_xl/lib/beid/mixins.py
Python
bsd-2-clause
9,424
""" FC Driver utils function """ import sys import traceback import hashlib from cinder.openstack.common.gettextutils import _ from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) def log_exception(exception=None): """ :param exception: :return: """ if ex...
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry
volume/drivers/huawei/vrm/utils.py
Python
apache-2.0
1,672
import socket from kmediatorrent import plugin, magnet, scrapers from kmediatorrent.ga import tracked from kmediatorrent.utils import ensure_fanart from kmediatorrent.platform import PLATFORM scrapers = ["eztv","yify","tpb","kickass","bitsnoop","btdigg","extratorrent","nyaa","zelka","cpb"] scrapersToDisplay = [] for s...
jmarth/plugin.video.kmediatorrent
resources/site-packages/kmediatorrent/index.py
Python
gpl-3.0
1,012
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para videos externos de divxstage # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re impor...
dknlght/dkodi
src/plugin.video.animehere/servers/divxstage.py
Python
gpl-2.0
3,303
import os from os import path import datetime from datetime import date, time, timedelta import time def main(): print(os.name) print("Item exists: " + str(path.exists("./PyPractice/conditions.py"))) print("isDirectory ./PyPractice/conditions.py: " + str(path.isdir("./PyPractice/conditions.py"))) print...
mudragada/util-scripts
PyPractice/ospath.py
Python
mit
824
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('stories', '0006_auto_20140821_0859'), ...
peterayeni/dash
dash/stories/migrations/0007_storyimage.py
Python
bsd-3-clause
1,645
from rspecs.src.geni.v3.container.resource import Resource from rspecs.src.geni.v3.container.link import Link class CrafterManager: #TODO: Take into account extensions def __init__(self, resources=[], options={}): self.resources = resources self.options = options self._urn_auth...
dana-i2cat/felix
core/lib/am/rspecs/src/geni/v3/craftermanager.py
Python
apache-2.0
5,625
from setuptools import setup, find_packages import sys, os version = '1.0.0' setup(name='brica1', version=version, description="", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='', author='ktnyt', ...
wbap/V1
python/setup.py
Python
apache-2.0
657
#!/usr/bin/env python3 """ Utilities and classes for Botty plugins. Should be imported by all Botty plugins. """ import os, re import functools CHAT_HISTORY_DIRECTORY = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "@history") class BasePlugin: """Base class for Botty plugins. Should be...
Uberi/botty-bot-bot-bot
src/plugins/utilities.py
Python
mit
8,730
"""Redis cache backend.""" import random import re from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.core.serializers.base import PickleSerializer from django.utils.functional import cached_property from django.utils.module_loading import import_string class RedisSerializer(PickleSe...
ar4s/django
django/core/cache/backends/redis.py
Python
bsd-3-clause
7,684
import pandas as pd t = 600 df = pd.read_csv('player_time.csv') df['team_1_gold'] = (df.gold_t_0 + df.gold_t_1 + df.gold_t_2 + df.gold_t_3 + df.gold_t_4) df['team_2_gold'] = (df.gold_t_128 + df.gold_t_129 + df.gold_t_130 + df.gold_t_131 + df.gold_t_132) df = df[['match_id',...
nathbo/GNTRM
scripts/team_gold.py
Python
mit
795
import csv import numpy def load(f_name): with open(f_name, "rb") as f: reader=csv.reader(f, delimiter=',', quotechar='"') x=list(reader) return numpy.array(x).astype('float') def store(f_name, matrix): numpy.savetxt(f_name, matrix, delimiter=",")
Zomega/thesis
Wurm/Utils/MatrixIO.py
Python
mit
258
from django.forms import widgets from rest_framework import serializers from api.models import Project, Task, Payment, Client from django.contrib.auth.models import User class UserSerializer(serializers.HyperlinkedModelSerializer): #ProjectsOwned = serializers.HyperlinkedRelatedField(many=True,view_name='project-d...
Arlefreak/PlusProjectAPI
api/serializers.py
Python
mit
2,727
#!/usr/bin/env python import sys import os import datetime import logging import argparse import base64 import simplejson from biokbase.workspace.client import Workspace from biokbase.userandjobstate.client import UserAndJobState from biokbase.Transform import handler_utils from biokbase.Transform import script_util...
aekazakov/transform
plugins/scripts/taskrunners/trns_convert_taskrunner.py
Python
mit
11,480
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import sys, os from calibre.customize.conversion import OutputFormatPlugin from cal...
jelly/calibre
src/calibre/ebooks/conversion/plugins/lrf_output.py
Python
gpl-3.0
7,750
import contextlib import re import socket import urllib import uuid from django.conf import settings from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.auth.models import AnonymousUser from django.contrib.sessions.middleware import SessionMiddleware from django.db import transactio...
atiqueahmedziad/addons-server
src/olympia/amo/middleware.py
Python
bsd-3-clause
12,302
from django.db.models import Avg, Count, Sum, Max from django.shortcuts import render from django.template.context_processors import csrf from django.utils.decorators import method_decorator from django.views.generic import View from silk import models from silk.auth import login_possibly_required, permissions_possibl...
jazzband/silk
silk/views/summary.py
Python
mit
4,217
from time import time import argparse import numpy as np from sklearn.dummy import DummyClassifier from sklearn.datasets import fetch_20newsgroups_vectorized from sklearn.metrics import accuracy_score from sklearn.utils.validation import check_array from sklearn.ensemble import RandomForestClassifier from sklearn.en...
kevin-intel/scikit-learn
benchmarks/bench_20newsgroups.py
Python
bsd-3-clause
3,292
# # Copyright (c) 2015 Red Hat, Inc. # # This software is licensed to you under the GNU Lesser General Public # License as published by the Free Software Foundation; either version # 2 of the License (LGPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or implied, # includin...
jortel/gofer
src/gofer/tools/mgt.py
Python
lgpl-2.1
2,014
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2012 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # Copyright(c)2008-2010 SIA "KN dati".(http://kndati.lv) All Rights Reserved. # ...
Micronaet/micronaet-mx
l10n_it_ddt_report_aeroo/__openerp__.py
Python
agpl-3.0
1,959
""" The :mod:`sklearn.utils` module includes various utilities. """ from collections import Sequence import numpy as np from scipy.sparse import issparse import warnings from .murmurhash import murmurhash3_32 from .validation import (as_float_array, check_arrays, safe_asarray, assert_all_fini...
chaluemwut/fbserver
venv/lib/python2.7/site-packages/sklearn/utils/__init__.py
Python
apache-2.0
11,586
# This file is part of Lerot. # # Lerot 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. # # Lerot is distributed in the hope tha...
hubert667/AIR
src/python/comparison/test.py
Python
gpl-3.0
26,919
__author__ = 'Sulantha'
sulantha2006/Conversion
Python/RUSRandomForest/__init__.py
Python
mit
24
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-06-08 23:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('plugins', '0004_auto_20170508_2027'), ] operations = [ migrations.AddField( ...
ava-project/ava-website
website/apps/plugins/migrations/0005_downloadrelease_is_used.py
Python
mit
460
"""Misc. utilities.""" from modoboa.lib.web_utils import NavigationParameters def decode_payload(encoding, payload): """Decode the payload according to the given encoding Supported encodings: base64, quoted-printable. :param encoding: the encoding's name :param payload: the value to decode :ret...
modoboa/modoboa-webmail
modoboa_webmail/lib/utils.py
Python
mit
1,305
#!/usr/bin/env python # # 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. """Creates a TOC file from a Java jar. The TOC file contains the non-package API of the jar. This includes all public/protected/pack...
guorendong/iridium-browser-ubuntu
build/android/gyp/jar_toc.py
Python
bsd-3-clause
3,500
########################################################################### # # Copyright 2021 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/l...
google/starthinker
examples/dv360_targeter_example.py
Python
apache-2.0
5,655
''' #----- Specific Databases ---- if __name__ == '__main__': from multiprocessing import freeze_support freeze_support() helpers.PRINT_CHECKS = True if 'paris' in sys.argv: convert_from_oxford_style(params.PARIS) if 'oxford' in sys.argv: convert_from_oxford_style(params.OXFORD) ...
SU-ECE-17-7/hotspotter
hstest/test_convertdb.py
Python
apache-2.0
474
from __future__ import unicode_literals import unittest import os from flask import Flask, render_template_string from flask.ext.upcdn import UPCDN class DefaultsTest(unittest.TestCase): def setUp(self): self.app = Flask(__name__) self.app.testing = True UPCDN(self.app) def test_d...
stuartgc/flask-upcdn
tests/test_flask_cdn.py
Python
mit
3,968
################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Read the zproject/README.md for information about making permanent changes. # #############################################################################...
zeromq/malamute
bindings/python_cffi/malamute_cffi/cdefs.py
Python
mpl-2.0
164,451
import pylab as pyl import cPickle as pickle from astLib import astStats galaxies = pickle.load(open('galaxies.pickle', 'rb')) galaxies = filter(lambda galaxy: galaxy.ston_I >10. and galaxy.clumps != None, galaxies) f = pyl.figure(1, figsize=(6,4)) f1s1 = f.add_subplot(111) d = [[galaxy.clumps, galaxy.ICD_IH...
boada/ICD
sandbox/lowerSN/plot_icd_clumps.py
Python
mit
1,772
class Error(Exception): pass class DownloadError(Error): def __init__(self, url: str, reason: str) -> None: self.url = url self.reason = reason def __str__(self) -> str: return f"{self.reason}: {self.url}" class NoFileExistsError(Error): def __init__(self, path: str) -> None...
yu-i9/dblpy
dblpy/exceptions.py
Python
mit
347
from flask_restful import Api import logging from . import app, model, api app.logger.setLevel(logging.DEBUG) db_session = model.db.session @app.route('/') def hello_world(): app.logger.debug("hello") return 'Hello World!' rest_api = Api(app) rest_api.add_resource(api.User, "/user/", "/user/<name>/")
lucidfrontier45/flasktest
flask_app/application.py
Python
mit
317