code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
from typing import Any
class Dataset(object):
"""A unit of entities. A dataset is a set of data, sez W3C."""
def __init__(self, name: str, title: str) -> None:
self.name = name
self.title = title
def __eq__(self, other: Any) -> bool:
try:
return not not self.name == o... | pudo/nomenklatura | nomenklatura/dataset.py | Python | mit | 662 |
from distutils.core import setup
import py2exe
setup(console=['DTR2Sync.py'])
| LeGoldFish/DTR2Sync | setup.py | Python | mit | 79 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests models.parameters
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import itertools
import numpy as np
from numpy.testing import utils
from . import irafutil
from .. import model... | piotroxp/scibibscan | scib/lib/python3.5/site-packages/astropy/modeling/tests/test_parameters.py | Python | mit | 21,265 |
from __future__ import division
from __future__ import print_function
import os
import sys
import functools
# Update path
root = os.path.join(os.getcwd().split('proj1')[0], 'proj1')
if root not in sys.path:
sys.path.append(root)
import numpy as np
import pandas as pd
import multiprocessing
from pdb import set_tra... | rahlk/CSC579__Computer_Performance_Modeling | simulation/proj1/tasks/task5.py | Python | mit | 2,063 |
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copi... | himaaaatti/qtile | libqtile/layout/columns.py | Python | mit | 13,874 |
# coding: utf-8
# pylint: disable = invalid-name, C0111
import json
import lightgbm as lgb
import pandas as pd
from sklearn.metrics import mean_squared_error
# load or create your dataset
print('Load data...')
df_train = pd.read_csv('../regression/regression.train', header=None, sep='\t')
df_test = pd.read_csv('../reg... | cbecker/LightGBM | examples/python-guide/simple_example.py | Python | mit | 1,762 |
#! /usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, absolute_import, division)
import unittest
import os
from os.path import isfile
import shutil
from lib import constants as const
from lib import utils
from lib import library
from tests import mock_constants
from tests import mo... | eirki/script.service.koalahbonordic | tests/test_library.py | Python | mit | 9,102 |
#!/usr/bin/env python
import argparse
import os
import numpy as np
from skimage import io, util
from pysmurfs import SMURFS, qSMURFS, rSMURFS, qrSMURFS, visualize
base_dir = os.path.dirname(os.path.realpath(__file__))
smurfs_desc ='SMURFS: Superpixels from Multiscale Refinement of Super-regions'
parser = argparse.... | imaluengo/SMURFS-Superpixels | run_smurfs.py | Python | mit | 1,927 |
import logging
import requests
from bs4 import BeautifulSoup
from http_request_randomizer.requests.parsers.UrlParser import UrlParser
from http_request_randomizer.requests.proxy.ProxyObject import ProxyObject, AnonymityLevel, Protocol
logger = logging.getLogger(__name__)
__author__ = 'pgaref'
class FreeProxyParser... | pgaref/HTTP_Request_Randomizer | http_request_randomizer/requests/parsers/FreeProxyParser.py | Python | mit | 3,551 |
from audio.io import *
| Curly-Mo/audio | __init__.py | Python | mit | 23 |
from __future__ import division
import numpy as np
def iP2(a):
return a**(1/2)
def iP3(a):
return a**(1/3)
def iP4(a):
return a**(1/4)
def iPN(a, n=None):
return a**(1/n)
def iA2(a):
return (-np.log(1-a))**(1/2)
def iA3(a):
return (-np.log(1-a))**(1/3)
def iA4(a):
return (-np.log(... | jobliz/solid-state-kinetics | ssk/models/theoretical.py | Python | mit | 1,630 |
from .base import *
SECRET_KEY = os.environ.get('SECRET_KEY')
DEBUG = True
INSTALLED_APPS += (
'debug_toolbar',
)
MIDDLEWARE += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'dev',
'USER': 'de... | hadrianpaulo/project_deathstar | core/core/settings/dev.py | Python | mit | 1,120 |
#!/usr/bin/env python
# coding=utf-8
import subprocess
import os
import shutil
import filecmp
TEMPLATE_VERSION = 2
new_default_file_path = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Source"
new_file_category_path = "/Applications/Xcode.app... | spWang/gitHooks | xcodetemplate.py | Python | mit | 5,507 |
# -*- coding: utf-8 -*-
"""
Django settings for skeleton project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
# import django.conf.global_settings as... | haakenlid/django-skeleton | settings/base.py | Python | mit | 5,649 |
from __future__ import division, print_function, absolute_import
import copy
import math
import numpy as np
from .distrib import ProbabilityDistribution
class Experience(object):
"""Experience base class.
Representation of an experience occurring from acting in the environment.
Parameters
--------... | evenmarbles/mlpy | mlpy/mdp/stateaction.py | Python | mit | 42,394 |
"""Machine learning model"""
from copy import deepcopy
import logging
from operator import itemgetter
from pathlib import Path
import shutil
from tempfile import TemporaryDirectory
from typing import List, Tuple, Dict, Any, Callable
import tensorflow as tf
from tensorflow.estimator import ModeKeys, Estimator
from ten... | yoeo/guesslang | guesslang/model.py | Python | mit | 6,714 |
'''
working exercise from sentex tutorials. with mods for clarification + api doc references.
How to program the Best Fit Line - Practical Machine Learning Tutorial with Python p.9
https://youtu.be/KLGfMGsgP34?list=PLQVvvaa0QuDfKTOs3Keq_kaG2P55YRn5v
linear regression model y=mx+b
m = mean(x).mean(y) - mean (x.y)
... | aspiringguru/sentexTuts | PracMachLrng/sentex_ML_demo7.py | Python | mit | 1,403 |
#!/usr/bin/env python
'''
Run this script inside of src/ and it will look for all the files
that were changed this year that still have the last year in the
copyright headers, and it will fix the headers on that file using
a perl regex one liner.
For example: if it finds something like this and we're in 2014
// Copyr... | jn2840/bitcoin | contrib/devtools/fix-copyright-headers.py | Python | mit | 1,492 |
import time
import json
import logging
import re
import requests
from telegram import InlineQueryResultArticle, InputTextMessageContent, ParseMode
from telegram.ext import ConversationHandler
from keybaseproofbot.models import Proof
from keybaseproofbot.proof_handler import check_proof_message, lookup_proof, store_pr... | pingiun/keybaseproofbot | keybaseproofbot/handlers.py | Python | mit | 15,489 |
# -*- coding: utf-8 -*
import numpy as np
import sys
def load_data_test(file_test, window):
# read the test data and mount the matrix
file_test = open(file_test, 'r')
dic_u_test = {}
dic_i_test = {}
for line in file_test:
try:
line = line.rstrip()
values = line.... | diego-carvalho/FAiR | app/src/loadData.py | Python | mit | 5,565 |
from .. import Provider as BaseProvider
class Provider(BaseProvider):
# jobs parsed from a list provided by State Treasury:
# http://www.valtiokonttori.fi/download/noname/%7BF69EA5BD-C919-49FE-8D51-91434E4B030D%7D/82158
jobs = [
"Agrologi",
"Aikuiskoulutusjohtaja",
"Aineenopettaja"... | joke2k/faker | faker/providers/job/fi_FI/__init__.py | Python | mit | 6,120 |
# -:- coding: utf-8 -:-#
"""
A resolver to query top-level domains via publicsuffix.org.
"""
from __future__ import absolute_import
NAME = "publicsuffix"
HELP = "a resolver to query top-level domains via publicsuffix.org"
DESC = """
This resolver returns a PTR record pointing to the top-level domain of the
hostname i... | skion/junkdns | src/resolvers/publicsuffix.py | Python | mit | 5,429 |
#include header
def new_method(msg):
greeting(msg)
print(msg)
| lkouame/cs3240-labdemo | new.py | Python | mit | 71 |
from datetime import datetime
from flask_login import UserMixin, AnonymousUserMixin
from typing import List
from app import db, constants
from app.models.base_model import BaseEntity
from app.models.education import Education
from app.models.group import Group
class AnonymousUser(AnonymousUserMixin):
"""
Has... | viaict/viaduct | app/models/user.py | Python | mit | 5,021 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from core import FeatureExtractorRegistry
from twinkle.connectors.core import ConnectorRegistry
class FeatureExtractorPipelineFactory(object):
"""
Factory object for creating a pipeline from a file
"""
def __init__(self):
"""
"""
pass
def buildInput(self,... | emCOMP/twinkle | twinkle/feature_extraction/pipelines.py | Python | mit | 2,688 |
#!/usr/bin/env python
"""
Extract atomic parameters for QEq potential.
Usage:
extract_bvs_params.py [options] DATA_FILE NAME [NAME...]
Options:
-h, --help Show this message and exit.
"""
from __future__ import print_function
from docopt import docopt
__author__ = "RYO KOBAYASHI"
__version__ = "180112"
out_Co... | ryokbys/nap | pmd/force_params/QEq_params/extract_QEq_params.py | Python | mit | 3,310 |
import sys
import pkg_resources
from style.styled_string_builder import _StyledStringBuilder
try:
__version__ = pkg_resources.get_distribution('style').version
except Exception:
__version__ = 'unknown'
_enabled = sys.stdout.isatty()
if '--color' in sys.argv:
_enabled = True
elif '--no-color' in sys.argv:... | lmittmann/clr | style/__init__.py | Python | mit | 533 |
"""List A users permissions."""
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
@click.command()
@click.argument('identifier')
@environment.pass_env
def cli(env, identifier):
"""User Permissions. TODO change to list all pe... | kyubifire/softlayer-python | SoftLayer/CLI/user/permissions.py | Python | mit | 1,893 |
import os
import numpy
__author__ = 'Milan'
class NewXS(Exception):
pass
# noinspection PyUnboundLocalVariable
def parse_material(data_file_name):
xs = ''
new_xs = ''
xs_data = dict()
data_buffer = []
xs_names = \
{
'St': 'St',
'Ss': 'Ss',
'nSf': 'nSf',
'chi': 'chi',
'Q... | mhanus/GOAT | material_data_parser.py | Python | mit | 2,467 |
#!/usr/bin/env python
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Greg Aitkenhead
#
# 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 ... | HarryLoofah/gae-bead-calculator | main.py | Python | mit | 8,656 |
import optparse, yaml, json
class OptionResolver(object):
"""Resolve user input options"""
def __init__(self):
self.parser = optparse.OptionParser()
self.set_options()
def set_options(self):
"""Use optparser to manage options"""
self.parser.add_option(... | hcpss-banderson/py-tasc | optionresolver.py | Python | mit | 1,993 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "i2o.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Avocarrot/i2o | manage.py | Python | mit | 246 |
import os
import argparse
from pentest import __version__
def get_parser():
"""
Creates a new argument parser.
"""
parser = argparse.ArgumentParser('jarvis')
version = '%(prog)s ' + __version__
parser.add_argument('--version', '-v', action='version', version=version)
return parser
def m... | BastienFaure/jarvis | src/pentest/tests/__main__.py | Python | mit | 1,036 |
__author__ = 'Jwely'
from build_tex_figs_by_run import *
from build_tex_tables import *
from synthesize_piv_uncertainty_images import *
from test_piv_dynamic_plots import *
from test_piv_plots import *
| Jwely/pivpr | py/controler/__init__.py | Python | mit | 203 |
#!/usr/bin/env python
# based on:
#
# Reversing CRC - Theory and Practice.
# HU Berlin Public Report
# SAR-PR-2006-05
# May 2006
# Authors:
# Martin Stigge, Henryk Plotz, Wolf Muller, Jens-Peter Redlich
FINALXOR = 0xff... | tholum/PiBunny | system.d/library/tools_installer/tools_to_install/impacket/examples/uncrc32.py | Python | mit | 997 |
# -*- 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),
]
operations = [
migrations.Create... | shelag/piggybank | saving/migrations/0001_initial.py | Python | mit | 1,468 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2018-08-31 12:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('basicviz', '0073_auto_20180831_1203'),
]
operations = [
migrations.AddField... | sdrogers/ms2ldaviz | ms2ldaviz/basicviz/migrations/0074_auto_20180831_1206.py | Python | mit | 670 |
from stock_up.settings.base import * | astrodsg/django-stock-up | stock_up/settings/__init__.py | Python | mit | 36 |
'''
Copyright (c) 2008 Georgios Giannoudovardis, <vardis.g@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 rights
to use,... | vardis/pano | src/pano/actions/BaseAction.py | Python | mit | 1,446 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
# Copyright (c) 2015 Wikimedia Foundation
# EXIF optimizer, aims to r... | wikimedia/thumbor-exif-optimizer | wikimedia_thumbor_exif_optimizer/__init__.py | Python | mit | 3,157 |
import logging
from spacel.provision.app.base_decorator import BaseTemplateDecorator
logger = logging.getLogger('spacel.provision.app.db')
class BaseDbTemplateDecorator(BaseTemplateDecorator):
def __init__(self, ingress):
super(BaseDbTemplateDecorator, self).__init__()
self._ingress = ingress
... | pebble/spacel-provision | src/spacel/provision/app/db/base.py | Python | mit | 874 |
# Test for creating custom render targets.
from SRPScripting import *
import utils
rt = ri.CreateRenderTarget()
testTexCallback = utils.GetTestTextureCallback(ri, rt, "FullscreenTexture_PS", "tex")
def RenderFrame(context):
context.Clear((1, 0.5, 0, 1), [rt])
testTexCallback(context)
ri.SetFrameCallback(RenderF... | simontaylor81/Syrup | SRPTests/TestScripts/Python/RenderTarget.py | Python | mit | 326 |
# /////////////////////////////////////////////////////////////////////
#
# oomtypes.py : Common type definitions used by multiple OOM modules
#
# Copyright 2015 Finisar Inc.
#
# Author: Don Bollinger don@thebollingers.org
#
# ////////////////////////////////////////////////////////////////////
import struct
from ... | ocpnetworking-wip/oom | oom/oomtypes.py | Python | mit | 811 |
__author__ = 'Tom'
import pickle
import urllib2
import os
import pymel.core as pm
import project_data as prj
reload(prj)
class updater():
def __init__(self):
self.master_url = 'https://raw.githubusercontent.com/tb-animator/tbtools/master/'
self.realPath = os.path.realpath(__file__)
self.ba... | tb-animator/tbtools | updater.py | Python | mit | 5,495 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_probe.py | Python | mit | 3,438 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/node_transition_result.py | Python | mit | 1,347 |
"""List of supported formats
"""
from collections import namedtuple
_FORMAT = namedtuple('FormatDefinition', 'mime_type,'
'extension, schema')
_FORMATS = namedtuple('FORMATS', 'GEOJSON, JSON, SHP, GML, GEOTIFF, WCS,'
'WCS100, WCS110, WCS20, WFS, WFS100,'
... | ricardogsilva/PyWPS | pywps/inout/formats/lists.py | Python | mit | 1,471 |
# encoding: utf-8
__author__ = "Nils Tobias Schmidt"
__email__ = "schmidt89 at informatik.uni-marburg.de"
'''
Holds some constants/settings related to celery.
'''
from androlyze.settings import *
############################################################
#---Max retry wait time
##################################... | nachtmaar/androlyze | androlyze/celery/CeleryConstants.py | Python | mit | 1,276 |
import unittest
class TestPyBN(unittest.TestCase):
def sample_test(self):
self.assertEqual(1, 1)
| jaideepcoder/PyBN | tests/Tests.py | Python | mit | 112 |
# -----------------------------------------------------------------------------
# @brief: Define some signals used during parallel
# -----------------------------------------------------------------------------
# it makes the main trpo agent push its weights into the tunnel
START_SIGNAL = 1
# it ends the training
E... | WilsonWangTHU/neural_graph_evolution | util/parallel_util.py | Python | mit | 825 |
import sys
def find_motif_locations(dna, motif):
motif_locations = []
if len(dna) < len(motif):
raise ValueError('Motif can\'t be shorter than sequence')
if len(motif) == len(dna) and motif != dna:
return motif_locations
for _ in range(len(dna) - len(motif) + 1):
if dna[_:_ ... | afreeorange/rosalind | SUBS/motif.py | Python | mit | 684 |
import sys
from PyQt4 import QtCore, QtGui, uic
#import gaea
import globals
import repo
import commit
#import clint libraries
from clint.arguments import Args
from clint.textui import puts, colored, indent
form_class = uic.loadUiType("list.ui")[0] # Load the UI
class MyWindowClass(QtGui.QMainWindow, ... | shivanshuag/gaea | listview.py | Python | mit | 706 |
#!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | Azure/azure-sdk-for-python | sdk/storagepool/azure-mgmt-storagepool/setup.py | Python | mit | 2,679 |
# coding=utf-8
import os
import re
import sys
from textwrap import dedent
import py
import pytest
from pluggy import PluginManager
from six import PY2
from virtualenv.info import IS_PYPY
import tox
from tox.config import (
CommandParser,
DepOption,
PosargsOption,
SectionReader,
get_homedir,
ge... | tox-dev/tox | tests/unit/config/test_config.py | Python | mit | 123,326 |
# This file was *autogenerated* from the file reimport_knowls_and_userdb.sage
from sage.all_cmdline import * # import sage library
_sage_const_0 = Integer(0)
os.chdir("/home/edgarcosta/lmfdb/")
import lmfdb
db = lmfdb.db_backend.db
DelayCommit = lmfdb.db_backend.DelayCommit
load("/home/edgarcosta/lmfdb-gce/transiti... | edgarcosta/lmfdb-gce | transition_scripts/reimport_knowls_and_userdb.sage.py | Python | mit | 4,038 |
import sugartensor as tf
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from model import *
__author__ = 'namju.kim@kakaobrain.com'
# set log level to debug
tf.sg_verbosity(10)
#
# hyper parameters
#
batch_size = 100
# random uniform seed
z = tf.random_uniform((batch_size, z_dim))
# ge... | buriburisuri/ebgan | mnist_ebgan_generate.py | Python | mit | 943 |
"""Python interface to GenoLogics LIMS via its REST API.
LIMS interface.
Per Kraulis, Science for Life Laboratory, Stockholm, Sweden.
Copyright (C) 2012 Per Kraulis
"""
__all__ = ['Lab', 'Researcher', 'Project', 'Sample',
'Containertype', 'Container', 'Processtype', 'Process',
'Artifact', 'Lims... | SciLifeLab/genologics | genologics/lims.py | Python | mit | 29,765 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# playlistfromsong documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in t... | schollz/playlistfromsong | docs/conf.py | Python | mit | 8,685 |
import mock
from datetime import datetime, timezone
import pytz
from nose.tools import assert_equals, assert_raises
from vogeltron import baseball
from bs4 import BeautifulSoup
YEAR = datetime.today().year
def date_for_month(month, day, hour, minute):
timez = pytz.timezone('US/Pacific')
return timez.localize... | kyleconroy/vogeltron | tests/test_sports.py | Python | mit | 6,742 |
"""
使用requests包装的页面请求
"""
import requests
from .headers import Headers
from proxy import proxy
class TimeoutException(Exception):
"""
连接超时异常
"""
pass
class ResponseException(Exception):
"""
响应异常
"""
pass
class WebRequest(object):
"""
包装requests
"""
def __init__(sel... | bobobo80/python-crawler-test | web_get/webget.py | Python | mit | 1,636 |
import nltk
from nltk.corpus import state_union
from nltk.tokenize import PunktSentenceTokenizer
train_text = state_union.raw("2005-GWBush.txt")
sample_text = state_union.raw("2006-GWBush.txt")
custom_sent_tokenizer = PunktSentenceTokenizer(train_text)
tokenized = custom_sent_tokenizer.tokenize(sample_text)
def pro... | abhishekjiitr/my-nltk | examples/ex6.py | Python | mit | 762 |
import sys
import re
def decompress(data):
decompressed = ""
d = ''.join(data.split('\n'))
while len(d):
s = re.match(r'^.*?(\((\d+?)x(\d+?)\))(.*)', d)
if s is None:
decompressed += d
break
dec, marker, d = d.partition(s.group(1))
decompressed += dec... | madfist/aoc2016 | aoc2016/day09/main.py | Python | mit | 1,216 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py | Python | mit | 24,059 |
from bucket.local import LocalProvider
import config
import statestore
import logging
import os
import threading
import traceback
import messages
from send2trash import send2trash
from worker import BaseWorker
class Download(BaseWorker):
def __init__(self, objectStore, outputQueue):
BaseWorker.__init__(se... | Sybrand/digital-panda | panda-tray/download.py | Python | mit | 12,881 |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2015, Jairus Martin.
Distributed under the terms of the MIT License.
The full license is in the file COPYING.txt, distributed with this software.
Created on Jun 11, 2015
"""
import sys
from atom.atom import set_default
from atom.api import (
Callable,
Int,
Tuple,
... | frmdstryr/enamlx | enamlx/widgets/plot_area.py | Python | mit | 6,354 |
import _plotly_utils.basevalidators
class FixedrangeValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="fixedrange", parent_name="layout.yaxis", **kwargs):
super(FixedrangeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | plotly/python-api | packages/python/plotly/plotly/validators/layout/yaxis/_fixedrange.py | Python | mit | 456 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mainapp', '0011_widget_is_raw'),
]
operations = [
migrations.AddField(
model_name='widget',
name='bl... | vesellov/callfeed.net | mainapp/migrations/0012_auto_20150525_1959.py | Python | mit | 2,217 |
#!/usr/bin/python3 -B
# coding=utf8
# ------------------------------------------------------------------------------
import os
import sys
import math
import random
import matplotlib.pyplot as plt
import matplotlib.ticker as pltckr
import matplotlib.lines as pltlns
import numpy as np
from statistics import mean
from co... | matus-chochlik/various | atmost/presentation/tools/plot-link-actu-pred.py | Python | mit | 3,063 |
#!/usr/bin/env python3
import sys
import text_parsers as tp
import os
infilenames = sys.argv[1:len(sys.argv)-1]
nameprefix = sys.argv[len(sys.argv)-1]
for infilename in infilenames:
outfilename = f'{os.environ["HOME"]}/{os.path.basename(infilename)}.h5'
data = tp.parse_txt_xy(infilename)
data['metadata']['n... | BiRG/Omics-Dashboard | modules/sbin/batch_parse_txtxy.py | Python | mit | 457 |
# Created by Johannes Schriewer on 2011-11-30. Modified by Roy Marmelstein 2015-08-05
# Copyright (c) 2011 planetmutlu.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributio... | marinehero/Localize-Swift | genstrings.py | Python | mit | 5,230 |
import os
import sys
import site
import site_utils
def test_site_dir_exists():
result = site_utils.site_dir_exists("test")
def test_create_site_dir():
site_utils.create_site_dir("test")
tdir = os.path.join(site.getuserbase(), "test")
#print "tdir: %s" % str(tdir)
assert os.path.exists(tdir)
s... | CospanDesign/python | site/test_site_utils.py | Python | mit | 415 |
import hashlib
secret_key = 'ckczppom'
hex_md5 = ''
num_tries = 0
while not hex_md5.startswith('000000'):
num_tries += 1
hex_md5 = hashlib.md5(secret_key + str(num_tries)).hexdigest()
print(num_tries)
print(hex_md5)
| antsant/adventofcode | src/4b_the_ideal_stocking_stuffer.py | Python | mit | 223 |
class Element:
def _render(self):
raise NotImplementedError('No render method implemented for this class.')
def __str__(self):
return self._render()
| megamandos/spiderbox | html/ElementModule.py | Python | mit | 174 |
#!/usr/bin/env python3
'''
bm = sd.Bitmap(Width,Height)
for x in xrange(Height*Width):
j= x // Width
i= x % Width
col = Color[x]
bm.SetPixel(i,j,col)
bm.Save(PathWrite,sd.Imaging.ImageFormat.Bmp)
'''
from PIL import Image
w = h = 255
img = Image.new( 'RGB', (w, h), "black") # Create a new black image... | michielkauwatjoe/Meta | meta/rgb.py | Python | mit | 524 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-18 07:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_post_subtitle'),
... | ayushjain786/Wtproject | blog/migrations/0003_comment.py | Python | mit | 978 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib
matplotlib.use('Agg')
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib import rc
x = np.arange(-10, 10, 0.1)
y = np.minimum(x,2)
z = np.minimum(0,x+2)
fig, axes = plt.subplots(1, 2, sharey=True)
fig.set_size_in... | hugombarreto/credibility_allocation | visualizations/utility.py | Python | mit | 645 |
"""Bootstrap"""
from __future__ import absolute_import, unicode_literals
import logging
import sys
import traceback
from contextlib import contextmanager
from subprocess import CalledProcessError
from threading import Lock, Thread
from virtualenv.info import fs_supports_symlink
from virtualenv.seed.embed.base_embed i... | TeamSPoon/logicmoo_workspace | packs_web/butterfly/lib/python3.7/site-packages/virtualenv/seed/embed/via_app_data/via_app_data.py | Python | mit | 6,059 |
import sys
import time
class display:
def __init__(self,width,height):
# store pixels in rows (screen has height many lists that are width long)
self.screen = []
self.width = width
self.height = height
for i in range(0,height):
self.screen.append([])
for j in range(0,width):
self.scree... | tbjoern/adventofcode | Eight/script.py | Python | mit | 1,976 |
# Find average price of products in a text file, grouped by sex and age
# Infant, Kid, Men, Unisex, Woman
def average(prices):
return sum(prices) / len(prices)
infant_prices = []
kid_prices = []
men_prices = []
unisex_prices = []
woman_prices = []
with open('catalogs/catalog_sample.csv') as f:
for line in f... | natla/softuni-python | SoftUni-L3-Functions/t2_average_price_by_sex_age.py | Python | mit | 2,695 |
# -*- coding: utf-8 -*-
"""
django-twitter
~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
__title__ = 'django-twitter'
__version__ = '0.1.0'
__author__ = 'Antonio Hinojo'
__license__ = 'MIT'
| ahmontero/django-twitter | twitter/__init__.py | Python | mit | 212 |
# Test reading hdf5 file that I created
import numpy as np
import Starfish
from Starfish.grid_tools import HDF5Interface
myHDF5 = HDF5Interface()
wl = myHDF5.wl
flux = myHDF5.load_flux(np.array([6100, 4.5, 0.0]))
| jason-neal/companion_simulations | misc/starfish_tests/read_HDF5.py | Python | mit | 215 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
from viaspider.settings import SUMMARY_LIMIT
class ViaspiderItem(scrapy.Item):
# define the fields for your item here like:
url = scrapy.Field()... | barisariburnu/viaspider | viaspider/items.py | Python | mit | 2,467 |
from django.contrib import admin
from repository.models import Repository, RepositoryAccess, RepositoryStar, RepositoryFork
admin.site.register(Repository)
admin.site.register(RepositoryStar)
admin.site.register(RepositoryFork)
admin.site.register(RepositoryAccess)
| Djacket/djacket | core/backend/repository/admin.py | Python | mit | 269 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def StorageIORMConfigOption(vim, *args, **kwargs):
'''Configuration setting ranges for IO... | xuru/pyvisdk | pyvisdk/do/storage_iorm_config_option.py | Python | mit | 1,080 |
import graphene
from gollahalli_cms.editor import schema
class Query(schema.Query, graphene.ObjectType):
"""
GraphQL query class.
"""
pass
query = graphene.Schema(query=Query)
| akshaybabloo/gollahalli-com | gollahalli_cms/gollahalli/schema.py | Python | mit | 197 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
################################################################################
#
# Project Euler -- Problem 211
#
################################################################################
#
# Divisor sum squares
#
#################################################... | byung-u/ProjectEuler | Problem_200_299/euler_211_artVark.py | Python | mit | 16,299 |
# -*- coding: utf-8 -*-
import json
import sqlalchemy as sa
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.types import UserDefinedType
from flask.ext.jsontools import JsonSerializableBase
from util import ratebeer_url
Base = declarative_base(cls=(Json... | atlefren/beerdatabase | web/models.py | Python | mit | 13,140 |
from Tkinter import *
import tkMessageBox
from functools import partial
import os
import sys
import hashlib
import gzip
class niUpdater:
def __init__(self, parent):
self.myParent = parent
self.topContainer = Frame(parent)
self.topContainer.pack(side=TOP, expand=1, fill=X, anchor=NW)
self.btmContainer = Frame(... | Naozumi/hashgen | ni_hashGen.py | Python | mit | 3,412 |
__description__ = "MASTER event parser and VOEvent publisher"
__url__ = "http://rtml.saao.ac.za/"
__author__ = "Tim-Oliver Husser"
__contact__ = "husser@astro.physik.uni-goettingen.de"
__version__ = "0.1"
from rtml import RTML | thusser/rtml-parse | rtmlparse/__init__.py | Python | mit | 227 |
from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^api/', include('api.urls')),
url(r'^', include('base.urls'))
)
| tedle/acdb | acdb/acdb/urls.py | Python | mit | 163 |
from rpython.jit.codewriter.effectinfo import EffectInfo
from rpython.jit.metainterp.optimizeopt.optimizer import Optimization
from rpython.jit.metainterp.resoperation import rop
def is_raw_free(op, opnum):
if not op.is_real_call():
return False
einfo = op.getdescr().get_extra_info()
return einfo... | jptomo/rpython-lang-scheme | rpython/jit/metainterp/optimizeopt/earlyforce.py | Python | mit | 992 |
../../Adafruit-Raspberry-Pi-Python-Code/Adafruit_MCP230xx/Adafruit_MCP230xx.py | stevenkword/PiCurious | lib/Adafruit-Raspberry-Pi-Code/Adafruit_CharLCDPlate/Adafruit_MCP230xx.py | Python | mit | 78 |
def print_lyrics():
print("I'm a lumberjack, and I'm okay.")
print('I sleep all night and I work all day.')
def repeat_lyrics():
print_lyrics()
print_lyrics()
repeat_lyrics() | mkhuthir/learnPython | Book_pythonlearn_com/05_functions/lyrics.py | Python | mit | 192 |
from flask import Flask, request, abort
import json
import ndb_util
import model
from google.appengine.api import users
from google.appengine.ext import ndb
from flask_restful import Resource
#TODO auth stuff
class OrganizationApi(Resource):
def get(self, id=None):
id = str(id)
if id is None:
... | jtovar2/demo_app | backend/resources/org_api.py | Python | mit | 2,570 |
from setuptools import setup
from controlhost import version
setup(name='controlhost',
version=version,
url='https://github.com/tamasgal/controlhost/',
description='A set of classes and tools wich uses the ControlHost protocol.',
author='Tamas Gal',
author_email='himself@tamasgal.com',
... | tamasgal/controlhost | setup.py | Python | mit | 751 |
#! /usr/bin/env python3
"""Get historical status data as a CSV file
Walks the Git history of the repo, loading each revision where data/ changed,
and recording the number of packages for each status.
When an existing data file is specified with --update, the file is repeated,
with commits that aren't in it appended.
... | irushchyshyn/portingdb | scripts/get-history.py | Python | mit | 5,840 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_pool.py | Python | mit | 2,589 |
#testing
"""
Basic MUD server module for creating text-based Multi-User Dungeon (MUD) games.
Contains one class, MudServer, which can be instantiated to start a server running
then used to send and receive messages from players.
author: Mark Frimston - mfrimston@gmail.com
"""
import socket
import select
import time... | PowerOfJusam/JusamMud | mudserver.py | Python | mit | 15,734 |
"""Test loading historical builds and jobs."""
from __future__ import absolute_import, unicode_literals
from travis_log_fetch.config import _get_travispy
from travis_log_fetch._target import Target
from travis_log_fetch.get import (
get_travis_repo,
get_historical_builds,
get_historical_build,
get_his... | jayvdb/travis_log_fetch | tests/test_historical.py | Python | mit | 5,569 |
"""
radish
~~~~~~
The root from red to green. BDD tooling for Python.
:copyright: (c) 2019 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
from collections import namedtuple
from pathlib import Path
import click
import colorful as cf
import radish.loader as loader
from radish.__... | radish-bdd/radish | src/radish/step_testing/__main__.py | Python | mit | 3,589 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.