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
from distutils.core import setup import latbin packages = ['latbin'] install_requires = ['numpy>=1.8','scipy>=0.14','pandas>=0.14'] ext_modules = [] setup( name='latbin', author="Tim Anderton, Dylan Gregersen", author_email='<quidditymaster@gmail.com>;<dylan.gregersen@utah.edu>', url="https://github.c...
astrodsg/latbin
setup.py
Python
bsd-3-clause
1,097
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Input/...
Azure/azure-sdk-for-python
sdk/storage/azure-storage-blob/azure/storage/blob/_shared/avro/avro_io_async.py
Python
mit
16,593
# vim: set fileencoding=utf-8: # GNU Solfege - free ear training software # Copyright (C) 2011 Tom Cato Amundsen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
allancarlos123/Solfege
solfege/exercises/toneincontext.py
Python
gpl-3.0
12,319
# Copyright (c) 2013 Steve Milner # 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 conditions...
gouthambs/flask-track-usage
test/test_blueprints_include_exclude.py
Python
bsd-3-clause
4,426
#title :texture_analysis.py #description :This will create a header for a python script. #author :Guillaume Lemaitre #date :2015/04/20 #version :0.1 #notes : #python_version :2.7.6 #============================================================================== # I...
glemaitre/protoclass
protoclass/extraction/texture_analysis.py
Python
gpl-2.0
15,254
#!/usr/bin/env python # ======================================================================== # 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 l...
arbenson/mrtsqr
dumbo/hyy-python-hadoop/examples/SequenceFileWriterDemo.py
Python
bsd-2-clause
1,757
#!/usr/bin/python import imaplib import sys import random import os import threading import time import types import subprocess SERVER = "localhost" USER = ["ftfstest1", "ftfstest2", "ftfstest3", "ftfstest4", "ftfstest5", "ftfstest6", "ftfstest7", "ftfstest8", "ftfstest9", "ftfstest10", "ftfstest11", "ftfstest12", "ft...
oscarlab/betrfs
benchmarks/aging/mailserver/mailserver-aging.py
Python
gpl-2.0
2,672
from channels.routing import route import slack.consumers channel_routing = [ route('background-slack-event', slack.consumers.event), route('background-slack-post', slack.consumers.post), route('background-slack-update', slack.consumers.update), route('background-slack-action', slack.consumers.action),...
trianglefraternitymtu/slack-bridge
server/routing.py
Python
mit
323
''' The MIT License (MIT) Copyright (c) 2015 Olivier Devoisin 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, me...
octopicorn/bcikit
lib/lttb.py
Python
agpl-3.0
3,759
from Foundation import * from PyObjCTools.TestSupport import * try: unicode except NameError: unicode = str class TestNSMetaData (TestCase): def testConstants(self): self.assertIsInstance(NSMetadataQueryDidStartGatheringNotification, unicode) self.assertIsInstance(NSMetadataQueryGatheringP...
albertz/music-player
mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsmetadata.py
Python
bsd-2-clause
2,524
#Add numerals import codecs from collections import Counter import json import re f = codecs.open('new_slovar.json', 'r', 'utf-8') text = f.read() f.close() slovar = json.loads(text) f = codecs.open('numerals.json', 'r', 'utf-8') text = f.read() f.close numerals = json.loads(text) full_slovar = {ke...
nevmenandr/thai-language
dictionary/add_numerals.py
Python
cc0-1.0
578
#pylint: disable=invalid-name # File: ReduceSCD_Parallel.py # # Version 2.0, modified to work with Mantid's new python interface. # # This script will run multiple instances of the script ReduceSCD_OneRun.py # in parallel, using either local processes or a slurm partition. After # using the ReduceSCD_OneRun script to...
dymkowsk/mantid
scripts/SCD_Reduction/ReduceSCD_Parallel.py
Python
gpl-3.0
14,307
# Generated by Django 3.1.8 on 2021-05-05 15:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("document", "0024_auto_20210323_1404"), ] operations = [ migrations.AddField( model_name="document", name="data", ...
fin/froide
froide/document/migrations/0025_auto_20210505_1720.py
Python
mit
572
import sys import random from linked_list_prototype import ListNode from merge_sorted_lists import merge_two_sorted_lists # @include def stable_sort_list(L): # Base cases: L is empty or a single node, nothing to do. if not L or not L.next: return L # Find the midpoint of L using a slow and a fast...
meisamhe/GPLshared
Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/sort_list.py
Python
gpl-3.0
1,171
""" Sentiment prediction module """ import nltk import numpy as np from cPickle import load def get_word_index_array(words, word2index): u""" Transform the words into list of int(word index) Note: Unknown words are dropped >>> words = [u"I", u"love", u"you", u"RANDOM STUFF"] >>> word2ind...
AHAAAAAAA/HackCU2016
sentiment.py
Python
mit
2,307
import pytest def test_test1(): pass @pytest.mark.failure def test_failure1(): assert False def test_test2(): pass @pytest.mark.skipped def test_skipped1(): pytest.skip("") def test_test3(): pass @pytest.mark.skipped def test_skipped2(): pytest.skip("") def test_test4(): pass ...
russell/bb-pytest
bb_pytest/test/fixture.py
Python
gpl-3.0
654
#!/usr/bin/env python # coding=utf-8 """Test scriptworker.utils """ import asyncio import os import re import shutil import tempfile import time import mock import pytest import scriptworker.utils as utils from scriptworker.exceptions import Download404, DownloadError, ScriptWorkerException, ScriptWorkerRetryExceptio...
escapewindow/scriptworker
tests/test_utils.py
Python
mpl-2.0
23,175
__author__ = 'joe krall' from pom3_requirements_tree import * import random def random_cost(): return random.randint(1, 100) def random_value(): return random.randint(1, 100) class pom3_requirements: def __init__(requirements, decisions): requirements.heap = requirements_tree() requirements.coun...
ase16-ta/performance
pom3/pom3_requirements.py
Python
mit
3,628
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2018-03-28 22:44 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('blog', '0004_remove_link_tags'), ] operations = [ migrations.DeleteModel( ...
alphageek-xyz/site
blog/migrations/0005_delete_tag.py
Python
bsd-3-clause
352
#!/usr/bin/python import json import os import time import requests from PIL import Image from StringIO import StringIO from requests.exceptions import ConnectionError def go(query, path): """Download full size images from Google image search. Don't print or republish images without permission. I used this to...
ronhandler/gitroot
opencv/google_ripper/google_ripper.py
Python
unlicense
1,618
""" Cisco_IOS_XR_spirit_install_instmgr_oper This module contains a collection of YANG definitions for Cisco IOS\-XR spirit\-install\-instmgr package operational data. This module contains definitions for the following management objects\: software\-install\: Install operations info Copyright (c) 2013\-2015 by Ci...
abhikeshav/ydk-py
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_spirit_install_instmgr_oper.py
Python
apache-2.0
74,791
#!/usr/bin/env python # # Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
MapofLife/MOL
earthengine/google-api-python-client/samples/gtaskqueue_sample/setup.py
Python
bsd-3-clause
1,951
""" Grader class to handle assessment of submissions """ from quiz.models import Question, QuestionHistory, Submission class Grader(): """ Grader class to handle assessment of submissions """ question = None question_history = None the_question = None submission = None def __init__(s...
kartikshah1/Test
quiz_old/grader.py
Python
mit
4,599
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Person', fields=[ ('id', models.AutoField(verbo...
xianjunzhengbackup/code
data science/machine_learning_for_the_web/chapter_6/test_server/addressesapp/migrations/0001_initial.py
Python
mit
738
from .constants import ( APP_NAME, DEBUG, INITIAL_URL, MANUFACTURERS, SECRET_KEY, URL_PREFIX, )
jackdbd/dash-fda
dash_fda/constants/__init__.py
Python
mit
120
# Copyright 2013 Canonical Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
rahulunair/nova
nova/tests/unit/virt/vmwareapi/test_vif.py
Python
apache-2.0
12,542
from __future__ import absolute_import import psycopg2 import six from django.db.utils import DatabaseError, InterfaceError def can_reconnect(exc): if isinstance(exc, (psycopg2.InterfaceError, InterfaceError)): return True # elif isinstance(exc, psycopg2.OperationalError): # exc_msg = six.te...
mvaled/sentry
src/sentry/db/postgres/helpers.py
Python
bsd-3-clause
783
import os import numpy from keras.callbacks import EarlyStopping from keras.layers import Dense from keras.layers import LSTM from keras.models import Sequential, model_from_json # fix random seed for reproducibility from preprocessData import getDataXY # load dataset trainX, trainY, testX, testY, validX, validY = ...
TheaGao/SklearnModel
kerasLSTM.py
Python
mit
2,402
''' @author: Virupaksha Swamy @email: vswamy@usc.edu @description: Program to build the model for HMM tagging! ''' import sys import os import time import json class Model: def __init__(self, path): self.path = path self.iv = {} self.tp = {} self.ep = {} self.tags ...
vswamy/NLP
homework6/hmmlearn3.py
Python
mit
3,591
#!/usr/bin/env python import os,sys from pyOpt_history import History from pyOpt_parameter import Parameter from pyOpt_variable import Variable from pyOpt_gradient import Gradient from pyOpt_constraint import Constraint from pyOpt_objective import Objective from pyOpt_optimization import Optimization from pyOpt_optim...
svn2github/pyopt
pyOpt/__init__.py
Python
gpl-3.0
787
# -*- coding: utf-8 -*- from flask_wtf import Form from wtforms import TextField, PasswordField from wtforms.validators import DataRequired, Email, EqualTo, Length from .models import User, Invite_Code class PasswordResetForm(Form): password = PasswordField('Password', validators=[DataRequired(), Length(min=6, m...
codeforamerica/comport
comport/user/forms.py
Python
bsd-3-clause
2,247
""" Miscellaneous utilities for PyGauges displays """ ## The Solarized color theme ## Todo: we need a nicer way to define customizable color themes colors = { 'base03': (0x00, 0x2b, 0x36), 'base02': (0x07, 0x36, 0x42), 'base01': (0x58, 0x6e, 0x75), 'base00': (0x65, 0x7b, 0x83), 'base0': (0x83, 0x94...
rshk/PyGauges
pygauges/utils.py
Python
apache-2.0
1,361
# -*- coding: utf-8 -*- import datetime import copy from django.utils import timezone from django.http import HttpResponse from app.blog_log.models import AccIP, ReqRecord from app.decorater import api_times from app.utils import encodejson @api_times def get_chart_message(req): body = {} now = timezone.now...
madarou/angular-django
app/blog_lab/chart/views.py
Python
bsd-2-clause
1,363
from captcha.fields import CaptchaField from django import forms from django.utils.translation import ugettext_lazy as _ from midnight_main.models import AppUser, PageComment from midnight_main.widgets import AdminImageWidget class Feedback(forms.Form): """ Форма обратной связи """ name = forms.Char...
webadmin87/midnight
midnight_main/forms.py
Python
bsd-3-clause
1,978
import _plotly_utils.basevalidators class LValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="l", parent_name="layout.slider.pad", **kwargs): super(LValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_t...
plotly/python-api
packages/python/plotly/plotly/validators/layout/slider/pad/_l.py
Python
mit
439
import sys from context.config import get_named_stoplist from context.content import get_article from context.nlp.keywords import get_keywords from context.nlp.entities import get_entities from context.services.twitter import search, screen_name_filter from context.query import twitter_query def topictweets(url): ...
NUinfolab/context
examples/topictweets.py
Python
mit
812
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # Copyright (c) 2008-2021 pyglet contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follo...
calexil/FightstickDisplay
pyglet/media/drivers/openal/__init__.py
Python
gpl-3.0
2,086
''' Copyright (C) 2016 Travis DeWolf This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope t...
studywolf/blog
train_AHF/plot_error.py
Python
gpl-3.0
4,956
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2017 Nippon Telegraph and Telephone Corporation. # # 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/l...
beluganos/beluganos
src/fabricflow/fibc/lib/fibccnv_test.py
Python
apache-2.0
7,224
# sum of numbers in array using loop def sum(arr): total = 0 for i in arr: total += i return total # sum of numbers in array using recursion def sum2(arr): if arr == []: return 0 return arr[0] + sum(arr[1:]) # recursive function to count the number of items in a list def count(lst)...
frainfreeze/studying
home/DataStructures-Algorithms/grokking-algorithms/divide-conquer.py
Python
mit
759
from django.conf.urls import url import actions urlpatterns = [ url(r'^create', actions.create), url(r'^update/(?P<tag_id>[-\w]+)', actions.update), url(r'^delete/(?P<tag_id>[-\w]+)', actions.delete), url(r'^search/(?P<search_text>[-\w]+)', actions.get_search), url(r'^(?P<tag_id>[-\w]+)', actions.g...
EndyKaufman/django-postgres-angularjs-blog
app/tag/api_v1_urls.py
Python
mit
365
import time import JumpScale.baselib.redis from JumpScale import j def main(q, args, params, tags, tasklet): log=args["logobj"] redis=j.clients.redis.getRedisClient("127.0.0.1",9999) log.gid = int(log.gid) if log.epoch==0: log.epoch=int(time.time()) incrkey="%s_%s"%(log.gid,log.nid) ...
Jumpscale/jumpscale6_core
apps/agentcontroller/processmanager/loghandling/1_init.py
Python
bsd-2-clause
527
# Copyright 2019 The Oppia 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 applicable ...
prasanna08/oppia
core/controllers/subtopic_viewer_test.py
Python
apache-2.0
10,476
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from data_aggregator.management.commands._base import CreateJobCommand from data_aggregator.management.commands._mixins import RunJobMixin class Command(CreateJobCommand, RunJobMixin): help = ("Create job(s) for the specified...
uw-it-aca/canvas-analytics
data_aggregator/management/commands/create_and_run_jobs.py
Python
apache-2.0
582
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 r...
xclxxl414/rqalpha
tests/mod/sys_accounts/test_account_model.py
Python
apache-2.0
2,003
#!/usr/bin/python # -*- coding: utf-8 -*- # EHS (20 March 2013): This is the list of general functions. # The list is continuation from Rens's and Dominik's. import shutil import subprocess import datetime import random import os import gc import re import math import sys import types import net...
edwinkost/edwin_simple_tools
netcdf_to_pcraster/virtualOS.py
Python
gpl-2.0
59,924
import datetime import factory from apps.videos.models import Video from apps.videos.models import VideoUrl from apps.teams.models import Team from apps.teams.models import Partner from apps.teams.models import TeamMember from apps.teams.models import MembershipNarrowing from apps.teams.models import Task from apps.te...
ujdhesa/unisubs
apps/webdriver_testing/data_factories.py
Python
agpl-3.0
4,253
import os import sys import json import gitlab """ DESCRIPTION this script will output outdated terraform modules in your terraform code, by scanning gitlab tags and your local filesystem simplified workflow: - get latest tags from gitlab for all projects in a specific group (terraform mods group) - get used tags ...
garmann/playground
python/outdated-terraform-modules/app.py
Python
mit
5,950
from __future__ import division import collections # Simple representations of Points and rectangles Point = collections.namedtuple('Point', ['x', 'y']) Coordinates = collections.namedtuple('Coordinates', ['x0', 'y0', 'x1', 'y1']) class Rect(collections.namedtuple('Rect', ['left', 'top', 'width', 'height'])): ...
NaturalHistoryMuseum/gouda
gouda/strategies/roi/rect.py
Python
mit
1,374
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: mcxiaoke # @Date: 2015-07-09 20:46:37 import os import sys from os import path def handler(arg, dirname, names): print "process dir: %s" % dirname for name in names: filename = path.join(dirname, name) print "process file: %s" % filen...
mcxiaoke/python-labs
labs/file_name_unicode.py
Python
apache-2.0
694
import json import correlation import category import tools import settings from matplotlib.backends.backend_pdf import PdfPages def process_data(data_type, stats, highlights): print("Starting student data processing.") all_pdf_path, highlight_pdf_path = (None,None) question_types, demographic_question...
code-ape/SocialJusticeDataProcessing
stats.py
Python
apache-2.0
3,877
from __future__ import absolute_import # Keras. from keras import optimizers from keras.preprocessing.image import ImageDataGenerator from keras.optimizers import sgd # Peoject files. from model.cnn_v1 import leNet from model.alexnet import alexnet_v1 from model.resnet import resnet34, resnet34orig from project2.exam...
kcyu2014/ml_project2
project2/train_cnn.py
Python
mit
5,284
class Solution: def isPerfectSquareLinear(self, num: int) -> bool: n, sq = 0, 0 while sq <= num: n += 1 sq = n * n if sq == num: return True return False def isPerfectSquareMath(self, num: int) -> bool: i = 1 while num ...
l33tdaima/l33tdaima
p367e/perfect_square.py
Python
mit
910
''' RP_extract: Rhythm Patterns Audio Feature Extractor @author: 2014-2015 Alexander Schindler, Thomas Lidy Re-implementation by Alexander Schindler of RP_extract for Matlab Matlab version originally by Thomas Lidy, based on Musik Analysis Toolbox by Elias Pampalk ( see http://ifs.tuwien.ac.at/mir/downloads.html ) ...
bastustrump/genimpro
rp_extract.py
Python
mit
39,383
"""Common settings and globals.""" from os.path import abspath, basename, dirname, join, normpath from sys import path ########## PATH CONFIGURATION # Absolute filesystem path to the Django project directory: DJANGO_ROOT = dirname(dirname(abspath(__file__))) # Absolute filesystem path to the top-level project fold...
ibamacsr/indicar-process
indicarprocess/indicarprocess/settings/base.py
Python
agpl-3.0
8,490
import usbtmc from .channel import Channel from .generator import Generator from .oscilloscope import Oscilloscope from .oscilloscopy import list_devices, get_instrument
davidrft/PyOscilloscope
src/oscilloscopy/__init__.py
Python
mit
171
class Currency(object): """ Currency in splitwise. Attributes: code(str): Code of the currency unit(str): Unit of the currency """ def __init__(self, data=None): """ Args: data(:obj:`json`, optional): JSON object representing currency object """ ...
namaggarwal/splitwise
splitwise/currency.py
Python
mit
718
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
joshmoore/zeroc-ice
py/demo/book/printer/Server.py
Python
gpl-2.0
987
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache/airflow
airflow/providers/google/cloud/links/base.py
Python
apache-2.0
1,684
"""Consts used by Speedtest.net.""" from __future__ import annotations from typing import Final from homeassistant.components.sensor import ( STATE_CLASS_MEASUREMENT, SensorEntityDescription, ) from homeassistant.const import DATA_RATE_MEGABITS_PER_SECOND, TIME_MILLISECONDS DOMAIN: Final = "speedtestdotnet" ...
sander76/home-assistant
homeassistant/components/speedtestdotnet/const.py
Python
apache-2.0
1,543
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.forms import ( CharField, ChoiceField, Form, HiddenInput, IntegerField, ModelForm, ModelMultipleChoiceField, MultipleChoiceField, RadioSelect, Select, TextInput, ) from django.test import TestCase, ignore_warnings from django.utils...
iambibhas/django
tests/forms_tests/tests/test_regressions.py
Python
bsd-3-clause
8,041
from PyQt4 import QtCore, QtGui, uic from decimal import Decimal from wallet import wallet from tablemodel import TableModel, ProxyModel import logging class OffersTableModel(TableModel): _columns = ['Price', 'Quantity', 'Total', 'MyOffer'] _alignment = [ QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter...
chromaway/ngcccbase
ui/tradepage.py
Python
mit
19,804
# -*- coding: utf-8 -*- # Resource object code # # Created: Wed Mar 20 11:17:11 2013 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x1b\x48\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
Distrotech/PyQt-x11
examples/animation/states/states_rc2.py
Python
gpl-2.0
140,937
# Hidden Markov Models # # Author: Ron Weiss <ronweiss@gmail.com> # and Shiqiao Du <lucidfrontier.45@gmail.com> # API changes: Jaques Grobler <jaquesgrobler@gmail.com> """ The :mod:`sklearn.hmm` module implements hidden Markov models. **Warning:** :mod:`sklearn.hmm` is orphaned, undocumented and has known numerical s...
florian-f/sklearn
sklearn/hmm.py
Python
bsd-3-clause
45,124
""" REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation. OpenAPI spec version: v1 ...
Kiesum/tfrs-1
server/models/Group.py
Python
apache-2.0
1,106
from sqlalchemy import Column, Integer, ForeignKey from sqlalchemy.orm import relationship import random from database.main import Base, session class LootTableSchema(Base): """ The loot table of a specific monster. entry - the unique ID of this loot table itemX_ID - the ID of the item this creature ...
Enether/python_wow
models/items/loot_table.py
Python
mit
6,803
import tensorflow as tf from controller import BaseController # class RecurrentController(BaseController): # # def network_vars(self): # print('--define core rnn controller variables--') # self.lstm_cell = tf.nn.rnn_cell.LSTMCell(self.hidden_dim) # if not isinstance(self.drop_out_keep, int)...
thaihungle/deepexp
gen-dnc/recurrent_controller.py
Python
mit
4,538
#!/usr/bin/env python """ [PlantUML][] Extension for [Python-Markdown][] ============================================== This plugin implements a block extension which can be used to specify a [PlantUML][] diagram which will be converted into an image and inserted in the document. Syntax: ::uml::...
zrong/wpcmd
wpcmd/mde/plantuml.py
Python
bsd-3-clause
6,934
""" Connection module for Amazon Data Pipeline .. versionadded:: 2016.3.0 :depends: boto3 """ import logging import salt.utils.versions log = logging.getLogger(__name__) try: import boto3 import botocore.exceptions boto3.set_stream_logger(level=logging.CRITICAL) logging.getLogger("botocore").set...
saltstack/salt
salt/modules/boto_datapipeline.py
Python
apache-2.0
7,103
"""Package for experimental code that is not part of core pyvol distribution. This is generally where you should put your own estimators so you can experiment with them or submit them to pyvol contests without interfering with the main source tree. """
eiriks/pyvol
pyvol/experimental/__init__.py
Python
mit
260
#!/usr/bin/env python try: # If possible, use setuptools from setuptools import setup except ImportError: from distutils.core import setup setup( name='pyenvelope', version='0.1', description='Minimum bounding rectangle calculation', author='Andrey Kaygorodov', author_email='andreykay...
kaygorodov/pyenvelope
setup.py
Python
gpl-2.0
491
from django.conf import settings # whether to display cancelled occurrences # (if they are displayed then they have a css class "cancelled") # this controls behaviour of Period.classify_occurrence method SHOW_CANCELLED_OCCURRENCES = getattr(settings, "SHOW_CANCELLED_OCCURRENCES", False) # Callable used to check if a ...
llazzaro/django-scheduler
schedule/settings.py
Python
bsd-3-clause
2,531
from livinglots_owners.models import BaseOwner, BaseOwnerContact class Owner(BaseOwner): class Meta(BaseOwner.Meta): ordering = ('name',) class OwnerContact(BaseOwnerContact): pass
596acres/livinglots-la
livinglotsla/owners/models.py
Python
gpl-3.0
202
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime, timedelta from uuid import uuid4 from django.db import models try: # available from Django1.4 from django.utils.timezone import now except ImportError: now = datetime.now from django.utils.translation import ugettext_lazy as _ fr...
magopian/django-payline
payline/models.py
Python
bsd-3-clause
3,481
import os spotify = dict( username=os.environ.get("USERNAME"), Client_ID=os.environ.get("CLIENT_ID"), Client_Secret=os.environ.get("CLIENT_SECRET"), Redirect_URI=os.environ.get("REDIRECT_URI"), )
threecgreen/SpotiGraph
spotigraph/test_config.py
Python
mit
214
import six from django.conf import settings from django.core.management import call_command from django.db.models import loading from django.db import models from django.utils import unittest from django_extensions.db.fields import UUIDField class TestModel_field(models.Model): a = models.IntegerField() uuid...
bop/bauhaus
lib/python2.7/site-packages/django_extensions/tests/uuid_field.py
Python
mit
2,129
# # Copyright (C) 2004-2007 Paul Rotering # # 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 p...
nod/dealerbot
deck.py
Python
gpl-2.0
3,868
from django.core.cache import cache from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.template import RequestContext from django.utils.translation import ungettext, ugettext as _ from misago import messages from misago.conf import settings as misago_settings from misago.form...
Maronato/aosalunos
misago/apps/admin/settings/views.py
Python
gpl-2.0
5,665
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt def execute(): import webnotes webnotes.reload_doc("manufacturing", "doctype", "production_order") webnotes.reload_doc("stock", "doctype", "stock_entry") webnotes.conn.sql("""update...
saurabh6790/test-med-app
patches/november_2012/production_order_patch.py
Python
agpl-3.0
578
# -*- coding: utf-8 -*- """ Sphinx directive to support embedded IPython code. This directive allows pasting of entire interactive IPython sessions, prompts and all, and their code will actually get re-executed at doc build time, with all prompts renumbered sequentially. It also allows you to input code as a pure pyth...
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/IPython/sphinxext/ipython_directive.py
Python
bsd-3-clause
41,235
# This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # 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 version 3 of the # License, or (at your option) any later ver...
simonzhangsm/voltdb
lib/python/voltcli/future.d/start.py
Python
agpl-3.0
833
# -*- 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...
inovtec-solutions/OpenERP
openerp/addons/account_analytic_plans/account_analytic_plans.py
Python
agpl-3.0
24,226
''' 参考文献https://pypi.python.org/pypi/redis/2.10.5 redis模块可实现redis的单机版、sentinel模式,支持Publish/Subscribe、pineline、线程等功能 ''' import pickle, redis, logging from library.config.database import redis_config from library.utils.type_conv import bytes2string class Op_Redis(): ''' 连接并操作redis ''' def __init__(se...
lykops/lykchat
library/storage/database/redis_api.py
Python
gpl-3.0
14,216
############################################### # RabbitMQ in Action # Chapter 9 - RMQ User Manager ############################################### # # USAGE: # # user_vhost_manager.py "host" "auth_user" "auth_pass" create 'user' 'password' 'true/false' # "host" "auth_user" "auth...
rabbitinaction/sourcecode
python/chapter-9/user_manager.py
Python
bsd-2-clause
2,826
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import re from itertools import chain, combinations, cycle, islice from collections import namedtuple def sent_tokenize(context): """ ...
jeroyang/txttk
txttk/nlptools.py
Python
bsd-3-clause
5,696
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
mganeva/mantid
scripts/AbinsModules/AtomsData.py
Python
gpl-3.0
3,937
# -*- coding: utf-8 -*- import os, doxter class PageProcessor(doxter.Processor): def __init__(self): self.page = doxter.Struct(egg='chicken') doxter.set_config('page', self.page) def process(self, root, extension, content): self.page.clear() self.page.set('basename', os.path.basename(root)) self.page.set(...
icebreaker/doxter
doxter/processors/pageprocessor.py
Python
mit
383
# -*- coding: utf-8 -*- """" This program analysis the condition number of Hilbert Matrices. Marina von Steinkirch, spring/2013 (based on Mike Zingale's codes) """ import numpy as npy from scipy import linalg from gaussElimination import gaussElim from createHilbert import createHilbert from calculatePrecisio...
NicovincX2/Python-3.5
Analyse (mathématiques)/Analyse numérique/Conditionnement/condition_number_Hilbert_Matrices.py
Python
gpl-3.0
2,029
#!/usr/bin/python # -*- coding: utf-8 -*- # Generador de nombres fantásticos # Programado por Alfonso Saavedra "Son Link" # http://son-link.github.io # Bajo licencia GPL 3 # 1.0.0 import sys, random, csv import locale, json, re from os import access, path, R_OK from fng import fng from gui import * from PyQt5.QtCore ...
son-link/fantasy_name_generator
fantasynamesgenerator.py
Python
gpl-3.0
3,015
import pytest from pnc_cli import utils from pnc_cli.swagger_client.apis.buildrecords_api import BuildrecordsApi from test import testutils @pytest.fixture(scope='function', autouse=True) def get_builds_api(): global builds_api builds_api = BuildrecordsApi(utils.get_api_client()) def test_get_all_invalid_p...
jianajavier/pnc-cli
test/integration/test_buildrecords_api.py
Python
apache-2.0
3,751
from functools import wraps from flask import redirect from flask import session as login_session def login_required(f): '''Checks to see whether a user is logged in''' @wraps(f) def x(*args, **kwargs): if 'username' not in login_session: return redirect('/login') return f(*args...
RoyalFlush24/Item-Catalog
login_decorator.py
Python
mit
345
# -*- mode: python; coding: utf-8 -*- # Copyright 2017 the HERA Collaboration # Licensed under the 2-clause BSD license. """Testing for `hera_mc.weather`. """ import os from math import floor import pytest import numpy as np from astropy.time import Time, TimeDelta from .. import weather from . import onsite # co...
HERA-Team/Monitor_and_Control
hera_mc/tests/test_weather.py
Python
bsd-2-clause
8,627
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Nov 25 13:17:15 2013 @author: Alan Yorinks Copyright (c) 2013-14 Alan Yorinks All right reserved. 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 Fre...
memakura/s2a_fm
s2a_fm_class.py
Python
gpl-3.0
5,940
import exceptions class Error(exceptions.StandardError): pass class DatabaseError(exceptions.StandardError): pass class DataError(DatabaseError): pass class Warning(exceptions.StandardError): pass class InterfaceError(Error): pass class InternalError(DatabaseError): pass class OperationalError...
danielmt/vshard
vendor/github.com/youtube/vitess/py/vtdb/dbexceptions.py
Python
mit
1,802
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from datetime import datetime from ...worksheet import Worksheet class TestConvertDateTime(unittest.TestCase): """ Test t...
jvrsantacruz/XlsxWriter
xlsxwriter/test/worksheet/test_date_time_01.py
Python
bsd-2-clause
7,088
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from flask import Flask from flask_track_usage import TrackUsage from flask_track_usage.storage.redis_db import RedisStorage from datetime import datetime app = Flask(__name__) redis = RedisStorage() track = TrackUsage(app, redis) @app.route('/') def index()...
ipinak/flask-track-usage
src/test_app.py
Python
bsd-3-clause
681
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
alunarbeach/spark
python/pyspark/sql/functions.py
Python
apache-2.0
79,982
try: import psyco ; psyco.full() from psyco.classes import * except ImportError: pass import traceback import StringIO import sys import struct import amun_logging import random import peercast_shellcodes class vuln(object): __slots__ = ("vuln_name", "stage", "welcome_message", "shellcode", "reply", "log_obj") ...
zeroq/amun
vuln_modules/vuln-peercast/peercast_modul.py
Python
gpl-2.0
2,483
import _plotly_utils.basevalidators class XValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="x", parent_name="isosurface.caps", **kwargs): super(XValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, data_c...
plotly/python-api
packages/python/plotly/plotly/validators/isosurface/caps/_x.py
Python
mit
1,178
from __future__ import absolute_import from __future__ import unicode_literals import io import os.path import sqlite3 import mock import pytest import six from pre_commit.store import _get_default_directory from pre_commit.store import Store from pre_commit.util import cmd_output from pre_commit.util import cwd fro...
Lucas-C/pre-commit
tests/store_test.py
Python
mit
5,138