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 setuptools import setup, find_packages
setup(
name='abl.pivotal_client',
version='1.1.0',
description='A simple client for Pivotal Tracker',
author='Ableton Web Team',
author_email='webteam@ableton.com',
url='http://ableton.com/',
zip_safe=False,
install_requires=[],
packages=f... | AbletonAG/abl.pivotal_client | setup.py | Python | mit | 453 |
"""Working example of the ReadDirectoryChanges API which will
track changes made to a directory. Can either be run from a
command-line, with a comma-separated list of paths to watch,
or used as a module, either via the watch_path generator or
via the Watcher threads, one thread per path.
Examples:
watch_director... | one2pret/winsys | cookbook/watch_directory.py | Python | mit | 4,394 |
import theano
import theano.tensor as T
from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable,
host_from_gpu,
gpu_contiguous, HostFromGpu,
gpu_alloc_empty)
from theano.sandbox.... | yilei0620/3D_Conditional_Gan | lib/ops.py | Python | mit | 4,533 |
import asyncio
import logging
import concurrent.futures
class EchoServer(object):
"""Echo server class"""
def __init__(self, host, port, loop=None):
self._loop = loop or asyncio.get_event_loop()
self._server = asyncio.start_server(self.handle_connection, host=host, port=port)
def start(s... | kaefik/zadanie-python | echoserver.py | Python | mit | 1,395 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import mysql.connector
import datetime
HEADER_TEMPLATE = \
"HTTP/1.1 200 OK\r\n" \
"Server: webhttpd/2.0\r\n" \
"Cache-Control: no-cache, no-store, must-revalidate\r\n" \
"Connection: keep-alive\r\n" \
"Content-Type: text/html; charset=utf-8\r\n" \
... | eamars/webserver | site-package/index2.py | Python | mit | 3,741 |
import numpy as np
import matplotlib.pyplot as plt
__all__ = ('error_plot',)
def error_plot(network, logx=False, ax=None, show=True):
""" Makes line plot that shows training progress. x-axis
is an epoch number and y-axis is an error.
Parameters
----------
logx : bool
Parameter set up lo... | stczhc/neupy | neupy/plots/error_plot.py | Python | mit | 1,872 |
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import dask.dataframe as dd
from dask.dataframe.utils import (shard_df_on_index, meta_nonempty, make_meta,
raise_on_meta_error)
import pytest
def test_shard_df_on_index():
df = pd.DataFrame({'x': [1, 2, 3, 4... | jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/dask/dataframe/tests/test_utils_dataframe.py | Python | mit | 7,032 |
__title__ = 'fobi.contrib.plugins.form_elements.fields.select_multiple.apps'
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2017 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = ('Config',)
try:
from django.apps import AppConfig
class Config(AppConfig):
... | mansonul/events | events/contrib/plugins/form_elements/fields/select_multiple/apps.py | Python | mit | 516 |
#! python 3
# -*- coding: utf8 -*-
from coverage import coverage
cov = coverage(branch=True, omit=['venv/*', 'tests.py'])
cov.start()
import os
import unittest
from datetime import datetime, timedelta
import bcrypt
from config import basedir, SQLALCHEMY_DATABASE_URI
from application import app, db
from application.... | evereux/flask_template | tests.py | Python | mit | 1,928 |
import wave
import struct
BPM = 320.0
BEAT_LENGTH = 60.0 / BPM
START_BEAT = 80.0 # beat 80 is the 'huh' of the first 'uuh-huh'
START_TIME = START_BEAT * BEAT_LENGTH
BEAT_COUNT = 16.0
CLIP_LENGTH = BEAT_LENGTH * BEAT_COUNT
FRAME_RATE = 50.0
FRAME_LENGTH = 1 / FRAME_RATE
FRAME_COUNT = int(FRAME_RATE * CLIP_LENGTH)
PIC... | gasman/kisskill | scripts/oscilloscope.py | Python | mit | 859 |
import click
from json import dumps, load
import os
import sys
from tabulate import tabulate
@click.group('request')
@click.pass_context
def cli(ctx):
pass
@cli.command(name='unpause', help='Unpause a request')
@click.argument('request-id')
@click.pass_context
def request_unpause(ctx, request_id):
res = ctx.o... | yieldbot/singularity-py | singularity/commands/cmd_request.py | Python | mit | 10,225 |
#!/usr/bin/env python3
import os
import sys
import copy
import re
import time
import datetime
from urllib.request import urlopen
import numpy as np
import nltk
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.stem.porter import PorterStemmer
import json
import torch
import torch.autograd as autograd
import... | WayneDW/Sentiment-Analysis-in-Event-Driven-Stock-Price-Movement-Prediction | util.py | Python | mit | 13,305 |
from enum import Enum, unique
from pathlib import Path
from tempfile import NamedTemporaryFile
from threading import Lock
import os
from typing import Callable, Dict
from useintest.common import MissingDependencyError
_UTF8_ENCODING = "utf-8"
@unique
class _KeyType(Enum):
""""
Types of keys.
"""
P... | wtsi-hgi/startfortest | useintest/modules/gitlab/helpers.py | Python | mit | 3,675 |
from flask import Flask
from flask_socketio import SocketIO
# создаем экземпляр класса Flask
app = Flask(__name__)
# создаем экземпляр класса SocketIO
socketio = SocketIO(app)
from app.views import home
| fouk666/xoxo | XOXO/app/__init__.py | Python | mit | 258 |
import numpy
from chainer import cuda
from chainer import optimizer
_default_hyperparam = optimizer.Hyperparameter()
_default_hyperparam.rho = 0.95
_default_hyperparam.eps = 1e-6
class AdaDeltaRule(optimizer.UpdateRule):
"""Update rule of Zeiler's ADADELTA.
See :class:`~chainer.optimizers.AdaDelta` for t... | kashif/chainer | chainer/optimizers/ada_delta.py | Python | mit | 2,971 |
def _identify_what_to_count(signature_component_weight):
signature_component_dict = {}
signature_component_differing_dict = {}
signature_component_before_dict = {}
signature_component_before_differing_dict = {}
for signature_component, weight in signature_component_weight.items():
sign... | UCSD-CCAL/ccal | ccal/_identify_what_to_count.py | Python | mit | 2,352 |
# -*- coding: utf-8 -*-
from acq4.devices.OptomechDevice import OptomechDevice
from acq4.devices.DAQGeneric import DAQGeneric
class PMT(DAQGeneric, OptomechDevice):
def __init__(self, dm, config, name):
self.omConf = {}
for k in ['parentDevice', 'transform']:
if k in config:
... | acq4/acq4 | acq4/devices/PMT/PMT.py | Python | mit | 705 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ClusterDestroyedEvent(vim, *args, **kwargs):
'''This event records when a cluster is ... | xuru/pyvisdk | pyvisdk/do/cluster_destroyed_event.py | Python | mit | 1,147 |
#!/usr/bin/python
import math
def outlierCleaner(predictions, ages, net_worths):
"""
Clean away the 10% of points that have the largest
residual errors (difference between the prediction
and the actual net worth).
Return a list of tuples named cleaned_data where
each tuple... | seansu4you87/kupo | projects/MOOCs/udacity/ud120-ml/projects/outliers/outlier_cleaner.py | Python | mit | 753 |
# -*- coding: utf-8 -*-
from django import forms
from datetime import date
from dateutil.relativedelta import *
from django.contrib.auth.models import User
from custom_form_app.forms.base_form_class import *
from account_app.models import *
from website.exceptions import *
import logging, sys
# force utf8 read data
r... | entpy/beauty-and-pics | beauty_and_pics/custom_form_app/forms/delete_user_form.py | Python | mit | 2,518 |
'''
Config/Settings for ER Tweet Matching Service
'''
from datetime import date
# GLOBAL
# Maximum size a database can grow to (should be a multiple of 10MB)
MAX_DB_SIZE = 10485760 * 1000 * 100 # 10MB -> 10GB -> 1TB
## ER SERVICE
# Credentials
ER_USER = 'luis.rei@ijs.si'
ER_PASS = ''
# Log ER Requests?
ER_LOG =... | lrei/er_match | ermcfg.py | Python | mit | 2,864 |
import random
import string
from model.project import Project
def rand_string(prefix, maxlen):
chars = string.ascii_letters + string.digits + string.punctuation + " " * 10
return prefix + "".join([random.choice(chars) for i in range(random.randrange(maxlen))])
def generate_project_data(n):
return [Proje... | spcartman/mantis_tests | data/project.py | Python | mit | 699 |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import os
AUTHOR = u'Eric Carmichael'
SITENAME = u"Eric Carmichael's Nerdery"
SITEURL = os.environ.get("PELICAN_SITE_URL", "")
TIMEZONE = 'Europe/Paris'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when develop... | ckcollab/ericcarmichael | pelicanconf.py | Python | mit | 1,128 |
from __future__ import absolute_import, division, print_function, unicode_literals
from django.core.management.base import BaseCommand, CommandError
import subprocess
from pgrunner import bin_path
from pgrunner.commands import get_port
class Command(BaseCommand):
help = 'Run psql with correct database'
def ... | wojas/django-pgrunner | pgrunner/management/commands/pg_psql.py | Python | mit | 539 |
#The Diablo II statstring parsing within this module makes use of findings by
#iago, DarkMinion, and RealityRipple, among others
from pbuffer import debug_output
long_name = {'SSHR': 'Starcraft Shareware',
'JSTR': 'Starcraft Japanese',
'STAR': 'Starcraft',
'SEXP': 'Starcraft Bro... | pjurik2/javabot | plugins/chat/statstring.py | Python | mit | 10,219 |
from fsa import *
from nameGenerator import *
class IncrementalAdfa(Dfa):
"""This class is an Acyclic Deterministic Finite State Automaton
constructed by a list of words.
"""
def __init__(self, words, nameGenerator = None, sorted = False):
if nameGenerator is None:
nameGenerator ... | jpbarrette/moman | finenight/python/iadfa.py | Python | mit | 4,303 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Driver for ecoli.py
import os, re, time, subprocess
iterModDiv = 1
dirPathList = ["/home/tomas/documenten/modelling/diatomas_symlink/results/as_low_bridging_seed2"]
for d in dirPathList:
print(time.strftime('%H:%M:%S ') + d)
dAbs = d + "/output"
fileList = [... | tomasstorck/diatomas | blender/asdriver_nofil.py | Python | mit | 1,371 |
from importlib import import_module
from json import load
from os.path import basename, dirname, join
from sys import argv, exit
from pyramid.paster import get_appsettings, setup_logging
from pyramid.scripts.common import parse_vars
from transaction import manager
from app.fixtures import __file__ as fixture_base_dir... | ejelome/archaic | py/alchemified/app/app/scripts/initializedb.py | Python | mit | 1,965 |
from flask import session, Blueprint
from lexos.managers import session_manager
from lexos.helpers import constants
from lexos.models.consensus_tree_model import BCTModel
from lexos.views.base import render
consensus_tree_blueprint = Blueprint("consensus-tree", __name__)
@consensus_tree_blueprint.route("/consensus-t... | WheatonCS/Lexos | lexos/views/consensus_tree.py | Python | mit | 1,164 |
#!/usr/bin/env python3
import math
from collections import Counter
import operator
import functools
DICT_FACTORS = dict()
def factorize(n):
if n in DICT_FACTORS:
return DICT_FACTORS[n]
cnt = Counter()
sqrtn = int(math.sqrt(n)) + 1
for i in range(2, sqrtn + 1):
if n % i == 0:
... | arekfu/project_euler | p0012/p0012.py | Python | mit | 839 |
from setuptools import setup # type: ignore[import]
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="objname",
version="0.12.0",
packages=["objname"],
package_data={
"objname": ["__init__.py", "py.typed", "_module.py",
"test_objname.py"],
... | AlanCristhian/namedobject | setup.py | Python | mit | 1,413 |
# USAGE
# python motion_detector.py
# python motion_detector.py --video videos/example_01.mp4
# import the necessary packages
import argparse
import datetime
import imutils
import time
import cv2
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video", he... | SahSih/ARStreaming360Display | RealTimeVideoStitch/motion_detector.py | Python | mit | 2,815 |
#!/usr/bin/python3
import os
import os.path
import cgi, cgitb
import re
#own packages
import dbcPattern
def dbc_main(): # NEW except for the call to processInput
contents = createHTML() # process input into a page
print(contents)
return -1
def createHTML():
file=open("Header_Saved.html")
html_string = file.... | mauerflitza/Datalogger | Webpage/cgi-bin/loading.py | Python | mit | 952 |
from hearinglosssimulator.gui.wifidevice.wifidevicewidget import WifiDeviceWidget
from hearinglosssimulator.gui.wifidevice.qwificlient import QWifiClient, ThreadAudioStream
from hearinglosssimulator.gui.wifidevice.gui_debug_wifidevice import WindowDebugWifiDevice
udp_ip = "192.168.1.1"
udp_port = 6666
def test_qwi... | samuelgarcia/HearingLossSimulator | hearinglosssimulator/gui/wifidevice/tests/test_qwificlient.py | Python | mit | 586 |
"""
Django settings for sample_project 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/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ... | ebertti/django-admin-easy | test_project/settings.py | Python | mit | 2,792 |
# coding=utf-8
import mock
from lxml import html
from wtforms import ValidationError
from dmapiclient.errors import HTTPError
from app.main.helpers.frameworks import question_references
from .helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup_method(self, method):
s... | alphagov/digitalmarketplace-supplier-frontend | tests/app/test_application.py | Python | mit | 4,526 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from functools import partialmethod
from pymongo.operations import UpdateOne, InsertOne
from .cache import CachedModel
from .errors import ConfigError, ArgumentError
from .metatype import DocumentType, EmbeddedDocumentType
from .fields import EmbeddedField... | observerss/yamo | yamo/document.py | Python | mit | 10,377 |
# coding: utf-8
from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from songwriter import views
urlpatterns = [
url(r'^$', views.api_root,
name="root"),
url(r'^songs/list/$', views.SongList.as_view(),
name="songs_list"),
url(r'^songs/list/pagin... | giliam/turbo-songwriter | backend/songwriter/urls.py | Python | mit | 5,095 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ImageTranslationTranslation'
db.create_table('cmsplugin_filer_image_translated_imagetranslat... | bitmazk/cmsplugin-filer-image-translated | cmsplugin_filer_image_translated/migrations/0004_auto__add_imagetranslationtranslation__add_unique_imagetranslationtran.py | Python | mit | 12,501 |
# 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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_configuration.py | Python | mit | 2,950 |
import json
import hashlib
from daemonutils.auto_balance import add_node_to_balance_for
import config
import base
import models.node
import models.cluster
import models.task
from models.cluster_plan import ClusterBalancePlan, get_balance_plan_by_addr
REDIS_SHA = hashlib.sha1('redis').hexdigest()
def _get_balance_pl... | HunanTV/redis-ctl | test/auto_balance.py | Python | mit | 15,140 |
"""
Test upgrading L{_SubSchedulerParentHook} from version 2 to 3.
"""
from axiom.test.historic.stubloader import StubbedTest
from axiom.scheduler import _SubSchedulerParentHook
from axiom.substore import SubStore
from axiom.dependency import _DependencyConnector
class SubSchedulerParentHookUpgradeTests(StubbedTes... | hawkowl/axiom | axiom/test/historic/test_parentHook2to3.py | Python | mit | 1,325 |
from openpnm.algorithms import TransientReactiveTransport
from openpnm.utils import logging
logger = logging.getLogger(__name__)
class TransientNernstPlanck(TransientReactiveTransport):
r"""
A subclass of GenericTransport to perform steady and transient simulations
of pure diffusion, advection-diffusion a... | TomTranter/OpenPNM | openpnm/algorithms/TransientNernstPlanck.py | Python | mit | 2,989 |
# get_words.py
# returns a list of words from the relevant lines of a speech
# J. Hassler Thurston
# RocHack Hackathon December 7, 2013
import csv
import nltk
def get_words(line_list):
sentences = parse_to_sentences(line_list)
#print sentences
words = [nltk.word_tokenize(sent) for sent in sentences]
return senten... | jthurst3/newspeeches | get_words.py | Python | mit | 836 |
import datetime
import requests
from django.test import TestCase
from wikidata import wikidata
from person.models import Person
from person.util import parse_name_surname_initials, parse_surname_comma_surname_prefix
class TestFindName(TestCase):
@classmethod
def setUpTestData(cls):
cls.p1 = Person... | openkamer/openkamer | person/tests.py | Python | mit | 11,436 |
#!/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 thumbor@googlegroups.com
from shutil import which
from unittest.mock import patch
from urllib... | thumbor/thumbor | tests/handlers/test_base_handler_with_auto_webp.py | Python | mit | 7,701 |
import os
from unittest.mock import patch
from django.contrib.auth.models import User
from django.core.management import call_command
from django.test import TestCase
from experiments_manager.models import ChosenExperimentSteps, Experiment
from git_manager.models import GitRepository
from user_manager.models import W... | MOOCworkbench/MOOCworkbench | pylint_manager/tests.py | Python | mit | 2,789 |
#!/usr/bin/python
import sys, getopt, os, urllib2
import Overc
from flask import Flask
from flask import jsonify
from flask import request
from flask_httpauth import HTTPBasicAuth
from passlib.context import CryptContext
app = Flask(__name__)
# Password hash generation with:
#python<<EOF
#from passlib.context import... | jwessel/meta-overc | meta-cube/recipes-support/overc-system-agent/files/overc-system-agent-1.2/run_server.py | Python | mit | 11,160 |
import csv
import os
import os.path
import sys
import pybcb.flags as flags
__TWILIGHT = 'twi_fp'
__SUPERFAMILY = 'sup_fp'
def join(*args):
flags.assert_flag('sabmark-dir')
flags.assert_flag('sabmark-set')
if flags.config.sabmark_set == 'twilight':
return os.path.join(flags.config.sabmark_dir, _... | TuftsBCB/pybcb | pybcb/sabmark.py | Python | mit | 1,530 |
# 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/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py | Python | mit | 5,336 |
"""Support for Peewee ORM (https://github.com/coleifer/peewee)."""
from __future__ import annotations
import typing as t
import marshmallow as ma
import muffin
import peewee as pw
from apispec.ext.marshmallow import MarshmallowPlugin
from marshmallow_peewee import ForeignKey, ModelSchema
from muffin.typing import JS... | klen/muffin-rest | muffin_rest/peewee/__init__.py | Python | mit | 5,302 |
#!/usr/bin/env python
from setuptools import setup
import re
import platform
import os
import sys
install_requires = ["bottle>=0.11",
"requests>=1.1.0",
"pyyaml>=0.0",
"czipfile>=1.0.0",
"prometheus-client"]
def load_version(filename='.... | provoke-vagueness/reststore | setup.py | Python | mit | 2,099 |
# Customize django settings:
DEBUG = True
INSTALLED_APPS = (
'django_translate',
'example_basic.translate'
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django_translate.middleware.LocaleMiddleware',
)
SEC... | adamziel/django_translate | examples/example_basic/example_basic/settings.py | Python | mit | 2,421 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
url(r'', include('main.urls')),
# Examples:
# url(r'^$', 'whereami.views.home', name='home'),
# url(r'^whereami/'... | doismellburning/whereami | whereami/whereami/urls.py | Python | mit | 598 |
def makefastqdumpScript(sraFileNameListFileName, outputDirectory, scriptFileName):
# Make a script that will run fastq-dump on each of a list of SRA files
sraFileNameListFile = open(sraFileNameListFileName)
scriptFile = open(scriptFileName, 'w+')
for line in sraFileNameListFile:
# Iterate through the SRA ... | imk1/IMKTFBindingCode | makefastqdumpScript.py | Python | mit | 788 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
WTF_CSRF_ENABLED = True
SECRET_KEY = '33stanlake#'
DEBUG = True
APP_TITLE = 'Cloud of Reproducible Records API'
VERSION = '0.1-dev'
MONGODB_SETTINGS = {
'db': 'corr-production',
'host': '0.0.0.0',
'port': 27017
}
# STORMPATH_API_KEY_FILE =... | wd15/corr | corr-api/config.py | Python | mit | 436 |
from typing import Any
import pytest
from permutation import Permutation
EQUIV_CLASSES = [
[
Permutation(),
Permutation(1),
Permutation(1, 2),
Permutation(1, 2, 3, 4, 5),
Permutation.cycle(),
Permutation.from_cycles(),
Permutation.from_cycles(()),
],
... | jwodder/permutation | test/test_eq.py | Python | mit | 2,573 |
import numpy as np
def plane_error(results, target):
"""
Computes angle between target orbital plane and actually achieved plane.
:param results: Results struct as output by flight_manager (NOT flight_sim_3d).
:param target: Target struct as output by launch_targeting.
:return: Angle... | ubik2/PEGAS-kRPC | kRPC/plane_error.py | Python | mit | 987 |
from __future__ import absolute_import
# Copyright (c) 2010-2016 openpyxl
from openpyxl.styles.alignment import Alignment
from openpyxl.styles.borders import Border, Side
from openpyxl.styles.colors import Color
from openpyxl.styles.fills import PatternFill, GradientFill, Fill
from openpyxl.styles.fonts import Font, ... | aragos/tichu-tournament | python/openpyxl/styles/__init__.py | Python | mit | 470 |
# 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_09_01/models/effective_route.py | Python | mit | 2,684 |
"""magulbot URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | magul/magulbot | magulbot/magulbot/urls.py | Python | mit | 765 |
import sys
sys.path.insert(0, r'../')
import os
import re
import numpy as np
import gensim
from collections import defaultdict
import argparse
from argparse import ArgumentParser
from utilities import readConll, writevec, writey, traversaltree
from data.dataprocessing import streamtw, streamtwElec
from tdparse import l... | bluemonk482/tdparse | src/naive-seg.py | Python | mit | 17,309 |
from sage.misc.functional import symbolic_sum
from sage.calculus import var
def from_pattern_family_10j_1(j, variable=var('t')):
"""
This function allow to build a pair of functions (d, h) to
build a Riordan array for the pattern family (10)**j1, for a given j.
"""
def make_sum(from_index): ... | massimo-nocentini/master-thesis | sympy/riordan_avoiding_patterns.py | Python | mit | 2,308 |
import daisychain.steps.input
from daisychain.executor import Executor, Execution, ExecutorAborted, ConsoleInput, CheckStatusException
from . import test_step
from mock import patch
import py3compat
if py3compat.PY2:
input_function = 'daisychain.steps.input.input'
else:
import builtins
input_function = 'bu... | python-daisychain/daisychain | test/test_executor.py | Python | mit | 9,094 |
list2=['tom','jerry','mickey']
list1=['hardy','bob','minnie']
print(list1+list2)
print(list2+list1)
print(list1*3)
print(list2+['disney','nick','pogo']) | zac11/AutomateThingsWithPython | Lists/list_concat.py | Python | mit | 155 |
""" @Imports """
from cuescience_shop.tests.support.support import ClientTestSupport
from django.test.testcases import TestCase
class _NatSpecTemplate(TestCase):
def setUp(self):
self.client_test_support = ClientTestSupport(self)
def test(self):
""" @MethodBody """ | cuescience/cuescience-shop | shop/tests/models/_NatSpecTemplate.py | Python | mit | 293 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | kongsally/Deep-Learning-for-Automated-Discourse | FirstChatbot/seq2seq_model.py | Python | mit | 14,119 |
import numpy
from GenOpt import GeneticOptimizer
##Booths Function but with an additional slack variable to show the constraint feature.
def BoothsFnc(x):
return (x[:, 0] + 2*x[:, 1] - 7)**2 + (2*x[:, 0] + x[:, 1] - 5)**2
InitialSolutions = [numpy.array([numpy.random.uniform(), numpy.random.uniform(), numpy.random.... | kevinlioi/GenOpt | examples/constrained_optimization.py | Python | mit | 762 |
"""
pybufrkit.mdquery
~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import
from __future__ import print_function
import logging
from pybufrkit.errors import MetadataExprParsingError
__all__ = ['MetadataExprParser', 'MetadataQuerent', 'METADATA_QUERY_INDICATOR_CHAR']
log = logging.getLogger(__file__)
METADA... | ywangd/pybufrkit | pybufrkit/mdquery.py | Python | mit | 1,958 |
import argparse
# parse argument
import datetime
from tinydb import TinyDB
import config
parser = argparse.ArgumentParser(description='Refill Gold To Bot')
parser.add_argument('-n', help='Number of credits', required=True)
parser.add_argument('-c', help='Currency', required=True)
parser.add_argument('-p', help='Pric... | magayorker/magatip | scripts/add_gold.py | Python | mit | 735 |
class School:
def __init__(self):
pass
def add_student(self, name, grade):
pass
def roster(self):
pass
def grade(self, grade_number):
pass
def added(self):
pass
| exercism/python | exercises/practice/grade-school/grade_school.py | Python | mit | 225 |
# -*- coding: utf-8 -*-
import numpy as np
import scipy.sparse as sp
from scipy.sparse import lil_matrix
from nltk.tokenize import RegexpTokenizer
from keras import backend as K
from keras.models import Sequential
from keras.engine.topology import Layer
from keras.constraints import unitnorm
from keras.regularizers imp... | AlexHung780312/SmilNN | example/cdssm_pred.py | Python | mit | 3,956 |
# Copyright (c) 2014 Rich Porter - see LICENSE for further details
import accessor
import decimal
import json as json_
import message
import MySQLdb, MySQLdb.cursors
import os.path
import Queue
import re
import socket
import sys
import threading
########################################################################... | rporter/verilog_integration | python/mdb/_mysql.py | Python | mit | 4,513 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'ItemStock.in_stock'
db.delete_column(u'cleartherack_itemstock', 'in_stock')
# Add... | artsturdevant/425supplemental_material | sevens/cleartherack/migrations/0002_auto__del_field_itemstock_in_stock__add_field_itemstock_stock_status.py | Python | mit | 5,841 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu),
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu)
#
# ... | Molecular-Image-Recognition/Molecular-Image-Recognition | code/rmgpy/data/kinetics/common.py | Python | mit | 16,818 |
from .lsm import *
| WeKeyPedia/toolkit-python | wekeypedia/metrics/__init__.py | Python | mit | 19 |
from .howdoi import command_line_runner
command_line_runner()
| gleitz/howdoi | howdoi/__main__.py | Python | mit | 63 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.utils.translation import ugettext as _
def error_page(request, errormsg=''):
"""Show error page with message"""
if not errormsg:
errormsg = _('Wrong access')
return render(
req... | genonfire/bbgo | core/utils.py | Python | mit | 1,561 |
# 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/v2020_05_01/aio/operations/_security_rules_operations.py | Python | mit | 22,467 |
#coding:utf-8
from typing import Any, Tuple, List, Iterable, Callable, Union, IO, Optional as Opt
import pickle
from time import time
from numpy import ndarray
from torch import autograd, nn, optim, from_numpy, stack
from torch.nn.modules import loss
from torch.nn.utils import clip_grad_norm
from .util import cuda_ava... | mattHawthorn/sk-torch | sktorch/interface.py | Python | mit | 40,749 |
"""
WSGI config for optboard project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | tanutarou/OptBoard | optboard/wsgi.py | Python | mit | 394 |
from .mtproto_plain_sender import MtProtoPlainSender
from .authenticator import do_authentication
from .mtproto_sender import MtProtoSender
from .connection import Connection, ConnectionMode
| andr-04/Telethon | telethon/network/__init__.py | Python | mit | 191 |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#! This file is a literate Python program. You can compile the documentation
#! using mylit (http://pypi.python.org/pypi/mylit/).
## title = "glitter Example: Qt"
## stylesheet = "pygments_style.css"
# <h1><i>glitter</i> Example: Qt</h1>
# <h2>Summary</h2>
# Thi... | swenger/glitter | examples/qt.py | Python | mit | 9,648 |
#!/usr/bin/env python
from server import Serve
from utils import get_authenticated_user
import os
import sys
authenticated_user = None
try:
authenticated_user = get_authenticated_user('server.cfg')
except IOError:
print ("File 'server.cfg' doesn't exist on disk. Please ensure that it"
" does and ... | csridhar/58A78C12-3B74-48F6-B265-887C33ED5F98-odat-5DD613ED-1FE0-4D6A-8A20-4C26C3F2C95B | src/main.py | Python | mit | 528 |
#!/usr/bin/python
"""This module allows the use of a remote ftp as a local mountpoint"""
import sys, os, urllib, logging, signal, time
from fs import ftpfs
from fs.errors import PermissionDeniedError, RemoteConnectionError
from fs.expose import fuse
def mount_ftp(ftpaddress, mountpoint, login=None, password=None):
""... | Ntcha/tools | mount_ftp.py | Python | mit | 1,898 |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | Harmon758/discord.py | discord/types/sticker.py | Python | mit | 2,414 |
from functools import lru_cache
def sequence(n):
'bad idea'
while n is not 1:
yield n
n = 3*n+1 if n%2 else n/2
yield n
def next_num(n):
if n % 2:
return 3 * n + 1
else:
return n / 2
@lru_cache(None)
def collatz_length(n):
if n == 1:
return 1
else:
... | dawran6/project-euler | 14-longest-collatz-sequence.py | Python | mit | 588 |
'''
This file loads in data from /data/interim/interim_data.hdf and then
applies a sinusoidal regression model to the temperature data to remove
the yearly predictable variation.
NOTE: This file is intended to be executed by make from the top
level of the project directory hierarchy. We rely on os.getcwd()
and it wil... | RJTK/dwglasso_cweeds | src/data/sinusoid_regression.py | Python | mit | 2,984 |
import gzip
import cPickle
import numpy as np
import theano
import theano.tensor as T
from neuralmind import NeuralNetwork
from layers import HiddenLayer
from layers import ConvolutionLayer
from layers import FlattenLayer
import activations
def load_data(dataset):
print '... loading data'
# Load the dataset
f =... | miguelpedroso/neuralmind | examples/mnist_lenet2.py | Python | mit | 1,475 |
# -*- coding: utf-8 -*-
# 正处于设计开发阶段
from PyQt5 import QtCore
class datcomEvent(QtCore.QEvent):
"""
自定义的Datcom事件系统
"""
dtTypeID = QtCore.QEvent.registerEventType()
def __init__(self, type = dtTypeID):
"""
构造函数
"""
super(datcomEvent, self).__init__(type)... | darkspring2015/PyDatcomLab | PyDatcomLab/Core/datcomEventManager.py | Python | mit | 2,614 |
#!/usr/bin/env python
import rospy
from pprint import pformat
from tf_conversions import transformations
from math import pi
from nav_msgs.msg import Odometry
class odom_reader:
def __init__(self):
self.image_sub = rospy.Subscriber("/odom",
Odometry, self.call... | LCAS/teaching | cmp3103m-code-fragments/scripts/odom_reader.py | Python | mit | 833 |
import xml.etree.ElementTree as ET
import csv
'''
Tara O'Kelly - G00322214,
Graph Theory Assignment,
Third Year, Graph Theory, Software Development.
A program to parse the xml file with data taken from http://timetable.gmit.ie/.
'''
# adapted from https://docs.python.org/3/library/xml.etree.elementtree.html
out = ... | taraokelly/Graph-Theory-Assignment | data/progParser.py | Python | mit | 3,689 |
from __future__ import print_function
from string import ascii_lowercase
SYMBOLTABLE = list(ascii_lowercase)
def move2front_encode(strng, symboltable):
sequence, pad = [], symboltable[::]
for char in strng:
indx = pad.index(char)
sequence.append(indx)
pad = [pad.pop(indx)] + pad
re... | aligoren/pyalgo | move_to_front_algo.py | Python | mit | 857 |
import unittest
import datetime
from classes.score_board import ScoreBoard
class DateTimeStub(object):
def now(self):
return "test_date_time"
class ScoreBoardTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(ScoreBoardTest, self).__init__(*args, **kwargs)
self.score_board = Scor... | Baseyoyoyo/Higher-or-Lower | tests/score_board_test.py | Python | mit | 1,622 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ricecooker documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 21 19:57:19 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
#... | jayoshih/ricecooker | docs/conf.py | Python | mit | 19,912 |
#!/usr/bin/env python3
def progress(pos, scale):
pixels_per_char = 6
max_chars = 16
max_progress = max_chars * pixels_per_char
progress = (pos/scale)*max_progress
print(int ((pos/scale)*max_chars) )
for i in range(0,max_chars):
if i==int((pos/scale)*max_chars):
print("|",end="")
elif i< ((pos/scale)*max_... | imakin/CharMenu | v3/test/calc/progress.py | Python | mit | 1,261 |
import logging
import pendulum
from pynamodb.attributes import (UnicodeAttribute, UTCDateTimeAttribute)
from pynamodb.exceptions import DoesNotExist
from pynamodb.models import Model
from . import BaseLocker, Lock, LockAccessDenied
log = logging.getLogger(__name__)
class DynamoLock(Model):
class Meta:
... | jwplayer/rssalertbot | rssalertbot/locking/dynamo.py | Python | mit | 2,370 |
#!/usr/bin/env python
__author__ = "Jesse Zaneveld"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Jesse Zaneveld", "Rob Knight"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Jesse Zaneveld"
__email__ = "zaneveld@gmail.com"
__status__ = "Development"
from sys import argv
from... | sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/cogent/parse/kegg_taxonomy.py | Python | mit | 3,470 |
#!/usr/bin/env python3
# Copyright(c) 2014-2019 Daniel Kraft
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Utility routines for auxpow that are needed specifically by the regtests.
# This is mostly about actually *solving* an ... | rnicoll/dogecoin | test/functional/test_framework/auxpow_testing.py | Python | mit | 2,342 |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import asyncio
from azure.identity.aio import DefaultAzureCredential
from azure.keyvault.certificates.aio import CertificateClient
from azure.keyvault.certific... | Azure/azure-sdk-for-python | sdk/keyvault/azure-keyvault-certificates/samples/issuers_async.py | Python | mit | 4,030 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.