code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
#!/usr/bin/env python from ConfigParser import SafeConfigParser, NoSectionError, Error import argparse import os import smtplib import re import sys def main(): argument_parser = argparse.ArgumentParser(prog='mail') argument_parser.add_argument('subject', help='The subject of the email') argument_parser...
cmcdowell/CLI-email
emailer.py
Python
mit
2,010
# coding: utf-8 """ Qc API Qc API # noqa: E501 The version of the OpenAPI document: 3.0.0 Contact: cloudsupport@telestream.net Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from telestream_cloud_qc.configuration import Configuration class...
Telestream/telestream-cloud-python-sdk
telestream_cloud_qc_sdk/telestream_cloud_qc/models/active_format_test.py
Python
mit
4,684
import doshlib import pprint import dateutil.parser as dp def help(command): print "listdroplets" print "dropletup <droplet ID>" print "dropletdown <droplet ID>" print "dropletsnapshots <droplet ID>" def invalid(command): print "Invalid command: " + command def listdroplets(args): result = do...
mvanorder/dosh
doshlib/commands/__init__.py
Python
mit
2,196
from django.core.management.base import NoArgsCommand from django.contrib.auth.models import User from api.models import EyeHistory class Command(NoArgsCommand): help = 'Detects and removes duplicated history entries' def handle(self, **options): self.stdout.write('Beginning update...\n') us...
haystack/eyebrowse-server
common/management/commands/remove_duplicate_history.py
Python
mit
949
import base64 import pathlib import pickle import textwrap from docutils.nodes import FixedTextElement, General, SkipNode from uqbar.book.extensions import Extension from uqbar.strings import normalize from supriya.ext import websafe_audio from supriya.io import Player class RenderExtension(Extension): template...
Pulgama/supriya
supriya/ext/book.py
Python
mit
2,339
from flaskiwsapp.users.controllers.userControllers import get_user_by_id, get_user_by_email from flaskiwsapp.snippets.customApi import DUMMY_ERROR_CODE from flask_jwt import JWTError from flask import jsonify from flaskiwsapp.snippets.exceptions.userExceptions import UserInactiveException, UserDoesNotExistsException fr...
rafasis1986/EngineeringMidLevel
flaskiwsapp/auth/jwt.py
Python
mit
1,655
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Codec: __SERIALIZE_TAG = '#' def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode ...
QuincyWork/AllCodes
Python/Codes/Practice/LeetCode/297 Serialize and Deserialize Binary Tree.py
Python
mit
1,913
"""empty message Revision ID: 6d8e9e4138bf Revises: 445667ce6268 Create Date: 2016-03-03 10:36:03.205829 """ # revision identifiers, used by Alembic. revision = '6d8e9e4138bf' down_revision = '445667ce6268' from alembic import op import app import sqlalchemy as sa def upgrade(): ### commands auto generated by...
Maethorin/concept2
migrations/versions/6d8e9e4138bf_.py
Python
mit
760
from __future__ import print_function from django.core.management.base import BaseCommand, CommandError from django.conf import settings from insekta.network.models import Address from insekta.network.utils import ip_to_int, int_to_ip, cidr_to_netmask class Command(BaseCommand): args = '<fill [amount=100] | dump...
teythoon/Insekta
insekta/network/management/commands/network.py
Python
mit
1,830
# 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/v2017_08_01/models/troubleshooting_result_py3.py
Python
mit
1,603
#!/usr/bin/python2.7 """Twitter Project""" __version__ = '1.1.1' from setuptools import find_packages, setup setup(name = 'Pytweets', package = ['Pytweets'], version = '0.3', descripiton = 'A test module:Pytweets', Summary = 'A test module:dPytweets', long_description = 'A module for printing all the tweets/r...
Rahul91/Pytweets
setup.py
Python
mit
666
""" Intersects ... faster. Suports GenomicInterval datatype and multiple chromosomes. Copyright: James Taylor james@jamestaylor.org This code is part of the bx-python package license: bsd licensed https://bitbucket.org/james_taylor/bx-python/src/ebf9a4b352d3267303657afd57bd184f379eaf28/lib/bx/intervals/operations/qui...
smartkiwi/interval_calculator
interval_calculator/bx/quicksect.py
Python
mit
6,110
# # acrosby 2013 # def __call__(nc): s = {} for attr in nc.ncattrs(): s[attr] = nc.getncattr(attr) return s
acrosby/netcdf4-getncattrs
getncattrs.py
Python
mit
129
import re import sys import yaml import pprint import torch.nn as nn import torch.optim as optim sys.path.insert(0, '.') sys.path.insert(0, '..') # from ptutils.model import AlexNet from ptutils.session import Session from ptutils.utils import frozendict # from ptutils.module import Module, State, Configuration from p...
alexandonian/ptutils
tests/_test_config.py
Python
mit
600
### @author Rishi Jatia import json import re import string def decode_unicode(data, replace_boo=True): # dictionary which direct maps unicode values to its letters dictionary = {'0030':'0','0031':'1','0032':'2','0033':'3','0034':'4','0035':'5','0036':'6','0037':'7','0038':'8','0039':'9','0024':'$','0040':'@',...
usc-isi-i2/etk
etk/data_extractors/htiExtractors/unicode_decoder.py
Python
mit
22,630
import nibabel as nib import numpy as np from nilabels.tools.aux_methods.utils_rotations import get_small_orthogonal_rotation from nilabels.tools.aux_methods.utils_path import get_pfi_in_pfi_out, connect_path_tail_head from nilabels.tools.aux_methods.utils_nib import modify_image_data_type, \ modify_affine_transfo...
SebastianoF/LabelsManager
nilabels/agents/header_controller.py
Python
mit
6,482
from django.core.management.base import BaseCommand, CommandError from geography.models import Place class Command(BaseCommand): help = u"""Add new places""" usage_str = 'USAGE: ./manage.py add_places map_name STATE|CITY|RIVER|LAKE|... [difficulty]' def handle(self, *args, **options): if len(args...
slaweet/autoskola
main/geography/management/commands/add_places.py
Python
mit
985
"""Package setup for tumblr-block""" import setuptools if __name__ == '__main__': setuptools.setup( name='tumblr_block', version='2.0.0', description=( 'Auto blocking for tumblr' ), url='https://github.com/Deafjams/tumblr-block', author='Emma Foster', ...
Deafjams/tumblr-block
setup.py
Python
mit
804
_ = input() # number of test cases; we can ignore this since it has no significance temps = map(int, input().split()) # all the temps stored to a list with type int subercold = 0 # how many temps below 0 we got for i in temps: # for every temp we recorded if it's less than 0 add +1 to subercold if i < 0: ...
6ftunder/open.kattis
py/Cold-puter Science/cold_puter.py
Python
mit
358
# let guys could run Goodvibes by python -m goodvibes <args> # Copied from __main__.py in pip from __future__ import absolute_import import os import sys # If we are running from a wheel, add the wheel to sys.path # This allows the usage python pip-*.whl/pip install pip-*.whl if __package__ == '': path = os.path...
bobbypaton/GoodVibes
goodvibes/__main__.py
Python
mit
485
from ..apibits import * from .. import Client from . import * class Bank(APIResource): def remove(self, params={}, headers={}): params = ParamsBuilder.merge({ "bank_id" : self.id, }, params) method = APIMethod("post", "/bank/delete", params, headers, self) json = self.c...
synapsepayments/synapse_pay-python
synapsepay/resources/bank.py
Python
mit
1,073
import incursion as indb from .utils import InfluxDBClientTest class TestResponseParser(InfluxDBClientTest): def test_simple(self): self.generateData() query = indb.q('page_views').limit(None) resp = indb.get_result(query, conn=self.client) series = resp.get('page_views') ...
voidfiles/incursion
tests/test_client.py
Python
mit
1,150
# coding=utf-8 """ Collect the elasticsearch stats for the local node. Supports multiple instances. When using the 'instances' parameter the instance alias will be appended to the 'path' parameter. #### Dependencies * urlib2 """ import urllib2 import ssl import re from diamond.collector import str_to_bool try: ...
Netuitive/netuitive-diamond
src/collectors/elasticsearch/elasticsearch.py
Python
mit
18,479
import os import re import json import extrasettings from django.conf import settings from django.apps import AppConfig from django.db.utils import OperationalError from extrasettings.models import Extrasetting class ExtrasettingsConfig(AppConfig): name = 'extrasettings' verbose_name = "Djang...
pistacchio/django-extrasettings
extrasettings/apps.py
Python
mit
1,917
import logging import os import warnings from ..util import SysOutCapture from .base import Tool, Issue, ToolIssue # Hacks to prevent pyroma from screwing up the logging system for everyone else old_config = logging.basicConfig try: logging.basicConfig = lambda **k: None from pyroma import projectdata, rati...
jayclassless/tidypy
src/tidypy/tools/pyroma.py
Python
mit
4,228
import numpy MAX_ITERATIONS = 100 INFINITY = 1000 class Point: def __init__(self, coordinates, label=None): # self.x = x # self.y = y self.coordinates = coordinates self.label = label def __str__(self): return '{coordinates} labeled {label}'.format( coordi...
mileto94/Data-Mining
homework9/kmeans.py
Python
mit
3,653
# -*- 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 model 'UserStars' db.delete_table('qanda_app_userstars') # Adding model 'UserRelations' ...
alpsayin/django-qanda
qanda/qanda_app/migrations/0008_auto__del_userstars__add_userrelations.py
Python
mit
15,243
from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup # fetch values from package.xml setup_args = generate_distutils_setup( packages=['turtlebot_prey_behaviour'], package_dir={'': 'src'}) setup(**setup_args)
cdondrup/turtlebot_behaviours
turtlebot_prey_behaviour/setup.py
Python
mit
259
"""Unit Types.""" from construct import ( Struct, Float32l, Int16ul, Byte, Embedded, Switch, If, Int32ul, Array, String, Padding, IfThenElse, this ) from mgz.util import find_version, find_save_version, Version attribute = "attribute"/Struct( "type"/Int16ul, "amount"/Float32l, "flag"/Byte ) damage...
happyleavesaoc/aoc-mgz
mgz/header/unit_type.py
Python
mit
6,598
# -*- coding: utf-8 -*- # Build configuration file. # This file is execfile()d with the current directory set to its # containing dir. # Note that not all possible configuration values are present in this # autogenerated file. # All configuration values have a default; values that are commented out # serve to show the ...
a25kk/apm
docs/conf.py
Python
mit
5,991
from django.contrib import admin from Toury.models import * admin.site.register(Marker)
xran-deex/Toury-Django
Toury/admin.py
Python
mit
91
import sys filepath = sys.argv[1] delim = '\t' if len(sys.argv) > 2: delim = sys.argv[2] indegrees = {} for line in open(filepath): entry = line.rstrip().split(delim) src = entry[0] dst = entry[1] tag = entry[2] if not dst in indegrees: indegrees[dst] = 0 indegrees[dst] += 1 distribution ...
yamaguchiyuto/icwsm15
indegree_distribution.py
Python
mit
510
""" This software is an implementation of Deep MRI brain extraction: A 3D convolutional neural network for skull stripping You can download the paper at http://dx.doi.org/10.1016/j.neuroimage.2016.01.024 If you use this software for your projects please cite: Kleesiek and Urban et al, Deep MRI brain extraction: A 3...
GUR9000/Deep_MRI_brain_extraction
NNet_Core/NN_Analyzer.py
Python
mit
4,154
import sys import os def main(qrelFile, threshold): curr_topic_id = None with open(qrelFile, "r") as f: while f: line = f.readline() if not line: break (topic_id, blank, doc_id, judgement) = line.split() v= int(judgement) if...
leifos/tar
scripts/convert_qrels_to_binary_qrels.py
Python
mit
1,186
import sys from rpython.memory.gc.semispace import SemiSpaceGC from rpython.memory.gc.semispace import GCFLAG_EXTERNAL, GCFLAG_FORWARDED from rpython.memory.gc.semispace import GC_HASH_TAKEN_ADDR from rpython.memory.gc import env from rpython.rtyper.lltypesystem.llmemory import NULL, raw_malloc_usage from rpython.rtype...
oblique-labs/pyVM
rpython/memory/gc/generation.py
Python
mit
30,342
from django import template register = template.Library() # Used to create the generated link url for the templates @register.filter def get_link_filter(obj, arg): base = obj.get_link(arg) return base # Used to create the base url of the generated link for the templates @register.filter def get_base_link_fil...
djorda9/Simulated-Conversations
vagrant/simcon/templatetags/generatelink_extras.py
Python
mit
376
#!/usr/bin/env python import json import sys import numpy as np rewards = [] for line in sys.stdin: if not line.startswith("REWARD"): continue cols = line.strip().split("\t") data = json.loads(cols[1]) rewards.append(data['reward']) rmin, rmax = np.min(rewards), np.max(rewards) rrange = rmax - rmin num_bins ...
matpalm/malmomo
p/reward_freqs.py
Python
mit
605
# 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 ...
rjschwei/azure-sdk-for-python
azure-mgmt-web/azure/mgmt/web/models/conn_string_info.py
Python
mit
1,434
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # -----------------------------------------------------------...
petrvanblokland/Xierpa3
xierpa3/attributes/frames.py
Python
mit
1,825
from gc import collect from inspect import isawaitable from pytest import mark, raises from graphql import graphql_sync from graphql.execution import execute, execute_sync from graphql.language import parse from graphql.type import GraphQLField, GraphQLObjectType, GraphQLSchema, GraphQLString from graphql.validation ...
graphql-python/graphql-core
tests/execution/test_sync.py
Python
mit
7,073
__all__ = ["test_avl", "test_binary", "test_bloom", "test_fortune", "test_hashtable", "test_kd", "test_kd_factory", "test_knapsack", "test_mergesort", "test_quad", "test_R"]
heineman/algorithms-nutshell-2ed
PythonCode/test/__init__.py
Python
mit
199
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from .modes import Modes from . import models from . import bridges from . import layers from . import processing from .libs import * # noqa from . import activations from . import initializations from . import losses from . imp...
polyaxon/polyaxon-api
polyaxon_lib/__init__.py
Python
mit
572
from collections import OrderedDict import logging import os import shutil import subprocess import simtk.unit as units from intermol.desmond.desmond_parser import load, save DES_PATH = '' logger = logging.getLogger('InterMolLog') # terms we are ignoring for now. #'en': 'Raw Potential', #'E_x': 'Extended En.', un...
ctk3b/InterMol
intermol/desmond/__init__.py
Python
mit
3,879
GnomeXzPackage ('atk', version_major = '2.16', version_minor = '0')
BansheeMediaPlayer/bockbuild
packages/atk.py
Python
mit
68
# coding=utf-8 from django.contrib.auth.models import User from django.db import models # Create your models here. from django.db.models.base import Model from django.db.models.fields import CharField, TextField, DateTimeField, BooleanField, FloatField from django.db.models.fields.related import ForeignKey class Bas...
HigorSilvaRosa/ForumGeolocalizado
core/models.py
Python
mit
2,327
#!/usr/bin/env python3 import logging import requests logger = logging.getLogger(__name__) class PackageMeta: def __init__(self, api, package_name) -> None: self.api = api self.package_name = package_name self.details = self.app_details() if not self.details: excepti...
ClaudiuGeorgiu/PlaystoreDownloader
playstoredownloader/playstore/meta.py
Python
mit
1,902
""" Copyright (C) 2010 David Fong and Michael Saunders Distributed under the same license as Scipy Testing Code for LSMR. 03 Jun 2010: First version release with lsmr.py David Chin-lung Fong clfong@stanford.edu Institute for Computational and Mathematical Engineering Stanford University Michael Saunders ...
DailyActie/Surrogate-Model
01-codes/scipy-master/scipy/sparse/linalg/isolve/tests/test_lsmr.py
Python
mit
4,984
from unittest import TestCase from preggy import expect from remotecv.image_processor import ImageProcessor from tests import read_fixture class ImageProcessorTest(TestCase): def test_when_detector_unavailable(self): image_processor = ImageProcessor() with expect.error_to_happen(AttributeError):...
thumbor/remotecv
tests/test_image_processor.py
Python
mit
1,812
# -*- coding: utf-8 -*- import os from setuptools import setup, find_packages EXCLUDE_FROM_PACKAGES = ['test_*',] VERSION = "1.1.0" INSTALL_REQUIRES = [ 'requests', 'Flask' ] TESTS_REQUIRE = [ 'nose', 'httpretty' ] setup( name='Flask-HTTP-Forwarding', version=VERSION, url='http://www.gi...
casetext/flask-http-forwarding
setup.py
Python
mit
1,109
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2020 """ Module to handle the work related to the many AWS Lambda Triggers. """ import gzip import json import base64 from io import BytesIO import opentracing as ot from ...log import logger STR_LAMBDA_TRIGGER = 'lambda.trigger' def get_context(tracer, e...
instana/python-sensor
instana/instrumentation/aws/triggers.py
Python
mit
10,212
""" Created on Wed Apr 18 16:02:24 2012 @author: rsignell """ import netCDF4 import numpy as np import datetime import scipy.interpolate def surf_vel(x,y,url,date_mid=datetime.datetime.utcnow(),uvar='u',vvar='v',isurf_layer=0,lonvar='lon',latvar='lat', tvar='time',hours_ave=24,lon360=False,ugrid=False,lonlat_sub=...
rsignell-usgs/ocean_map
code/west_coast/surf_vel.py
Python
mit
2,525
from .pyfirmata import * from .boards import BOARDS __version__ = '1.0.3' # Use bumpversion! # shortcut classes class Arduino(Board): """ A board that will set itself up as a normal Arduino. """ def __init__(self, *args, **kwargs): args = list(args) args.append(BOARDS['arduino']) ...
jochasinga/pyFirmata
pyfirmata/__init__.py
Python
mit
1,176
from mock import Mock, patch, MagicMock from lxc4u.meta import * def test_initialize_lxc_meta(): meta1 = LXCMeta() meta1['hello'] = 'hello' meta2 = LXCMeta(initial=dict(hello=123)) assert meta1['hello'] == 'hello' assert meta2['hello'] == 123 @patch('__builtin__.open') @patch('json.loads') @pa...
ravenac95/lxc4u
tests/test_meta.py
Python
mit
2,809
# Copyright (c) 2017, Neil Booth # # All rights reserved. # # See the file "LICENCE" for information about the copyright # and warranty status of this software. import asyncio import logging import os import signal import sys import time from functools import partial class ServerBase(object): '''Base class serve...
erasmospunk/electrumx
lib/server_base.py
Python
mit
4,398
from datetime import date from django.core.paginator import Paginator, InvalidPage from django.db.models import Q from django.shortcuts import render from .models import Showing, Show # All your search and not search needs in one place (as long as template is not missing any var assignments in links # and etc.) - S...
WarwickAnimeSoc/aniMango
showings/views.py
Python
mit
1,605
from django.db import models from jsonfield import JSONField from collections import OrderedDict class BaseObject(models.Model): """ The base model from which all apps inherit """ # Type represents the app that uses it. Assets, Persons, Orgs, etc type = models.CharField(max_length=256) # Rel...
jerynmathew/AssetManager
AssetManager/core/baseobject/models.py
Python
mit
1,839
#!/usr/bin/python # coding: utf-8 # Copyright (c) 2013 Mountainstorm # # 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,...
mountainstorm/MobileDevice
crashmover.py
Python
mit
4,328
from __future__ import print_function import pandas from sklearn.naive_bayes import MultinomialNB from sklearn.cross_validation import train_test_split from sklearn.preprocessing import LabelEncoder def main(): train_all = pandas.DataFrame.from_csv('train.csv') train = train_all[['Survived', 'Sex', 'Fare']][:...
noelevans/sandpit
kaggle/titanic/categorical_and_scaler_prediction.py
Python
mit
773
# Copyright (c) 2019 Dubalu LLC # Copyright (c) 2017 Elasticsearch # # 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 unde...
Kronuz/Xapiand
contrib/python/xapiand-py/xapiand/transport.py
Python
mit
15,871
#!/usr/bin/env python """ This is a hacked version of PyUnit that extends its reporting capabilities with optional meta data on the test cases. It also makes it possible to separate the standard and error output streams in TextTestRunner. It's a hack rather than a set of subclasses because a) Steve had used doub...
skyostil/tracy
src/generator/Cheetah/Tests/unittest_local_copy.py
Python
mit
34,313
from vanilla.vanillaBase import VanillaBaseObject, VanillaBaseControl, VanillaError from vanilla.vanillaBox import Box, HorizontalLine, VerticalLine from vanilla.vanillaBrowser import ObjectBrowser from vanilla.vanillaButton import Button, SquareButton, ImageButton, HelpButton from vanilla.vanillaCheckBox import CheckB...
moyogo/vanilla
Lib/vanilla/__init__.py
Python
mit
2,699
from imgurpython import ImgurClient import webbrowser import credentials client = ImgurClient(credentials.imgur['client_id'], credentials.imgur['client_secret']) # Authorization flow, pin example (see docs for other auth types) authorization_url = client.get_auth_url('pin') print authorization_url webbrowser.open(au...
hexagonist/RedditDaltonizerBot
get_imgur_tokens.py
Python
mit
540
#abstract_component.py import threading class AbstractComponent: logger = None def init(self): pass def finalize(self): pass class AbstractQueryProviderComponent(AbstractComponent): async_query_availabale = False def getAvailableQueryCodeSet(self): raise NotImplementedError('You have to overri...
3WiseMen/python
pystock/pystock_xingAPI/abstract_component.py
Python
mit
1,088
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Andrey Klychkov (@Andersson007) <aaklychkov@mail.ru> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {...
SergeyCherepanov/ansible
ansible/ansible/modules/database/postgresql/postgresql_idx.py
Python
mit
17,072
# -*- coding:utf-8 -*- import unittest import nose from mobileclick import Iunit, Intent, Summary, SummaryError class SummaryTestCase(unittest.TestCase): def setUp(self): self.qid = 'MC2-E-0001' self.i1 = Intent(self.qid, '%s-INTENT0001' % self.qid, 'Link') self.i2 = Intent(self.qid, '%s-IN...
mpkato/mobileclick
tests/summary_test.py
Python
mit
3,680
LOGIN_URL = '/user/login' LOGIN_REDIRECT_URL = '/' LOGOUT_REDIRECT_URL = '/' AUTHENTICATION_BACKENDS = [ 'user.backend.AuthenticationBackend', 'user.backend.EmailBackend', ] AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, ...
ava-project/ava-website
website/core/settings/common/auth.py
Python
mit
608
""" Activity logs. """ import asyncio import datetime import json import websockets from . import base from shellish.layout import Table class Log(base.PlexCommand): """ Show activity log """ name = 'log' type_map = { 'StatusNotification': 'Status', 'ProgressNotification': 'Progress' ...
mayfield/plexcli
plexcli/commands/activity.py
Python
mit
1,539
from django.contrib import admin from homepage.models import Rotw admin.site.register(Rotw)
shubhendusaurabh/referiend
homepage/admin.py
Python
mit
94
__author__ = 'rcj1492' __created__ = '2016.10' __license__ = 'MIT' def retrieve_service_name(service_root): service_name = '' # construct registry client from os import path from pocketlab import __module__ from labpack.storage.appdata import appdataClient registry_client = appdataCli...
collectiveacuity/pocketLab
pocketlab/methods/service.py
Python
mit
8,378
# Generated by Django 2.0.8 on 2018-09-26 03:47 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('conservation', '0001_squashed_0027_auto_20180509_1048'), ] operations = [ ...
parksandwildlife/wastd
conservation/migrations/0002_auto_20180926_1147.py
Python
mit
646
""" __ProcDef.py_____________________________________________________ Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY) Author: gehan Modified: Sat Aug 30 18:23:40 2014 _________________________________________________________________ """ from ASGNode import * from ATOM3Type import * from ATOM3...
levilucio/SyVOLT
UMLRT2Kiltera_MM/ProcDef.py
Python
mit
3,435
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange # ----------------------------------------------------------------------------- try: basestri...
ccxt/ccxt
python/ccxt/coinbasepro.py
Python
mit
53,861
__all__ = [ 'ClassificationDataset', 'RegressionDataset', 'BaseDataset', 'check_compatibility', 'pyradigm', 'MLDataset', 'cli_run'] from sys import version_info if version_info.major >= 3: from pyradigm.base import BaseDataset from pyradigm.classify import ClassificationDataset f...
raamana/pyradigm
pyradigm/__init__.py
Python
mit
792
import csv with open('guided_least.csv', 'rb') as csvfile: spamreader = csv.reader(csvfile) url = open('url.csv','w') for row in spamreader: url.write(row[0]+',') url.write(row[1]+',') url.write(row[2]+',') url.write("/"+row[1]+row[2]+',') ...
LighthouseHPC/lighthouse
sandbox/lily/django_orthg/orthg/database/writeUrl.py
Python
mit
396
from emailcongress.settings.shared import * ALLOWED_HOSTS += CONFIG_DICT['django']['allowed_hosts'] # see http://developer.yahoo.com/performance/rules.html#expires AWS_HEADERS = { 'Expires': 'Thu, 31 Dec 2099 20:00:00 GMT', 'Cache-Control': 'max-age=94608000', } AWS_ACCESS_KEY_ID = CONFIG_DICT['aws']['access...
sunlightlabs/emailcongress
emailcongress/settings/production.py
Python
mit
856
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='nirvaris-profile', version='3.0', ...
nirvaris/nirvaris-profile
setup.py
Python
mit
1,256
from starcluster.clustersetup import ClusterSetup from starcluster.logger import log class GessInstaller(ClusterSetup): def run(self, nodes, master, user, user_shell, volumes): for node in nodes: log.info("Installing GESS 1.0 on %s" % (node.alias)) node.ssh.execute('wget -c -P /opt/software/gess/1.0 http://co...
meissnert/StarCluster-Plugins
gess_1_0.py
Python
mit
962
import unittest from mock import MagicMock, call from copernicus import Copernicus __author__ = 'Krzysztof "gronostaj" Smialek' class OnDeviceTests(unittest.TestCase): def test_should_copy_knob_to_servo(self): serial_mock = MagicMock() serial_mock.read = MagicMock(side_effect=map(chr, [64, 64 + ...
gronostajo/copernicus-api
tests/testOnDevice.py
Python
mit
912
class SampError(Exception): pass class RconError(SampError): pass class InvalidRconPassword(RconError): pass class ConnectionError(SampError): def __init__(self, socket_error): self.socket_error = socket_error self.err_no = socket_error.args[0] self.message = socket_error.a...
mick88/samp-client
samp_client/exceptions.py
Python
mit
601
import cPickle import glob import logging import os import leveldb class ShardedDB(object): ''' Manages a number of leveldb "shards" (partitions). LevelDB does not support concurrent writers, so we create a separate output shard for each reducer. `ShardedDB` provides a unified interface to multiple shards....
HiTechIronMan/openfda
openfda/parallel/sharded_db.py
Python
cc0-1.0
1,844
import tkinter as tk import asyncio import threading from tkevents import TkEventLoop from HardWork import * import concurrent.futures @asyncio.coroutine def async(it, *args): return (yield from asyncio.get_event_loop().run_in_executor(None, it, *args)) class Application(tk.Frame): def __init_...
garoa/concorrente.py
tkinter/tkapp2.py
Python
cc0-1.0
7,362
# Copyright (C) 2011 Mark Armbrust. Permission granted for educational use. """ hasmError.py -- Error handling for Hack Assembler See "The Elements of Computing Systems", by Noam Nisan and Shimon Schocken """ import sys def Error(message, lineNumber=0, line=''): """ Print an error message and continue. ...
benkoo/nand2tetris
06/Python/FileManipulation/FileError.py
Python
cc0-1.0
635
''' Created on Jul 2, 2014 @author: viejoemer I can print a dict as a string in Python? ¿Yo puedo imprimir un dict como un string en Python? str(dict) Produces a printable string representation of a dictionary, but this not work for JSON format. ''' #Definition of a dictionary d = {'three': 3, 'two': 2, 'one': 1...
OxPython/Python-dict-str
dict_str.py
Python
epl-1.0
411
import sys import numpy as np from flopy.mbase import Package from flopy.utils import util_2d,util_3d from flopy.modflow.mfpar import ModflowPar as mfpar class ModflowUpw(Package): 'Upstream weighting package class\n' def __init__(self, model, laytyp=0, layavg=0, chani=1.0, layvka=0, laywet=0, iupwcb...
mjasher/gac
original_libraries/flopy-master/flopy/modflow/mfupw.py
Python
gpl-2.0
13,021
import json from poemtube.errors import InvalidRequest from poemtube.jsonapi.json_errors import JsonInvalidRequest def my_whoami( user ): if user: return { "userid": "http://example.com/oid/andy" } return { "userid": user } else: return { "anonymous" : "" } def do( fn, *args, **kwar...
andybalaam/poemtube
server/src/poemtube/jsonapi/json_whoami.py
Python
gpl-2.0
644
#!/usr/bin/env python from random import randint, choice from copy import deepcopy from math import log import sys import cProfile def fuse(m, x, adj_list): #print 'Fusing ({}) and ({})'.format(self.x, x.x) #for i in self.edges: # print '({})'.format(i.x), #print '' new_edge_list = [] for i...
Ramyak/CodingPractice
algo_practice/coursera-algo-1/min_cuts/minimum_cuts_1_pre.py
Python
gpl-2.0
2,942
from django.db import models import uuid as uuid __author__ = 'jkonieczny' class Genre(models.Model): name = models.CharField(max_length=32) def __str__(self): return self.name class Publisher(models.Model): name = models.CharField(max_length=128) def __str__(self): return self.nam...
Razi91/BiblioTeKa
books/models.py
Python
gpl-2.0
3,611
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved. # # This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA. # # SIPPY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
lemenkov/sippy
sippy/UaStateConnected.py
Python
gpl-2.0
11,513
import pycountry from Acquisition import aq_parent from castle.cms.fragments.interfaces import IFragmentsDirectory from castle.cms.browser.survey import ICastleSurvey from plone import api from plone.registry.interfaces import IRegistry from Products.CMFCore.utils import getToolByName from zope.component import getAllU...
castlecms/castle.cms
castle/cms/vocabularies.py
Python
gpl-2.0
11,750
""" WSGI config for voodoo project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
Smiter/voodoo
voodoo/wsgi.py
Python
gpl-2.0
1,522
import sys import random from variables import Variable, StateVariables try: from criticalx import interpn, index except ImportError: sys.stderr.write("Can't import Cython implementation. Falling back to slower pure-Python.\n") from critical import interpn, index if __debug__: import types import ...
gregbaker/dynmodel
dynmodel/model.py
Python
gpl-2.0
18,776
__author__ = 'rls' class Robot: """Represents a robot, with a name.""" # A class variable, counting the number of robots population = 0 def __init__(self, name): """Initializes the data.""" self.name = name print('(Initializing {})'.format(self.name)) # When this pers...
rlsharpton/byte-of-Python
oop_objvar.py
Python
gpl-2.0
1,127
"""Dynamic Programming algorithms for general usage. This module contains classes which implement Dynamic Programming algorithms that can be used generally. """ class AbstractDPAlgorithms: """An abstract class to calculate forward and backward probabiliies. This class should not be instantiated directly, but...
BlogomaticProject/Blogomatic
opt/blog-o-matic/usr/lib/python/Bio/HMM/DynamicProgramming.py
Python
gpl-2.0
12,644
import MDAnalysis from MDAnalysis.tests.datafiles import GRO, XTC universe = MDAnalysis.Universe(GRO, XTC) #old selection all_selection = universe.selectAtoms('all') #additional old selectAtoms selection (this comment shouldn't be modified despite containing the method name) all_selection.selectAtoms('bynum 1:10') #...
alejob/mdanalysis
package/MDAnalysis/migration/test_dummy_old_MDA_code.py
Python
gpl-2.0
6,334
# Gmail IMAP folder support # Copyright (C) 2008 Riccardo Murri <riccardo.murri@gmail.com> # Copyright (C) 2002-2007 John Goerzen <jgoerzen@complete.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free So...
aroig/offlineimap
offlineimap/folder/Gmail.py
Python
gpl-2.0
15,648
# boss_interface.py # Anaconda main DBUS module & module manager. # # Copyright (C) 2017 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later v...
vathpela/anaconda
pyanaconda/modules/boss/boss_interface.py
Python
gpl-2.0
3,496
# #####BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distribu...
laydrop/i3-Berlin
Blender/python/curve_tools.py
Python
gpl-2.0
40,346
# encoding: 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 'MailQueueItem' db.create_table(u'mailq', ( ('id', self.gf('django.db.models.fi...
liveaverage/baruwa
src/baruwa/status/migrations/0001_initial.py
Python
gpl-2.0
2,911
import tornado.web import tornado.gen from tornado.concurrent import run_on_executor from concurrent.futures import ThreadPoolExecutor from tools.dbcore import ConnPool from tools.encode import UTF8StrToBase64Str, Base64StrToUTF8Str from UIModule.MsgModule import renderMSG from Crawler.BnuVJCrawler.BnuVJCrawler impo...
CKboss/VirtualJudgePY
Handlers/ProblemHandler.py
Python
gpl-2.0
4,706
# This file is part of MyPaint. # Copyright (C) 2007-2008 by Martin Renold <martinxyz@gmx.ch> # # 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 opt...
achadwick/mypaint
lib/tiledsurface.py
Python
gpl-2.0
42,966