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 |
|---|---|---|---|---|---|
# 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.
# --------------------------------------------------------------------... | Azure/azure-sdk-for-python | sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.1/async_samples/sample_recognize_custom_forms_async.py | Python | mit | 6,386 |
from evostream.default import api
from evostream.management.base import BaseEvoStreamCommand
class Command(BaseEvoStreamCommand):
help = 'Returns a list with all push/pull configurations.'
requires_system_checks = False
def get_results(self, *args, **options):
return api.list_config()
| tomi77/django-evostream | evostream/management/commands/listconfig.py | Python | mit | 310 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import bawebauth.apps.bawebauth.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
o... | mback2k/django-bawebauth | bawebauth/apps/bawebauth/migrations/0001_initial.py | Python | mit | 1,925 |
from horizon import tables
from django.utils.translation import ugettext_lazy as _
import utils
import whisper
import time
def get_vcpu_load_avgs(instance):
cpu_files = utils.get_whisper_files_by_metric(
"cpu",
utils.get_whisper_files_by_instance_id(instance.id))
if not cpu_fi... | arunpn123/cloudmon | src/horizon_monitor/ubuntu/horizon/dashboards/nova/monitor/tables.py | Python | mit | 2,419 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: Qiang Li
# Email: liqiangneu@gmail.compile
# Time: 10:27, 03/30/2017
import sys
import codecs
import argparse
import random
from io import open
argparse.open = open
reload(sys)
sys.setdefaultencoding('utf8')
if sys.version_info < (3, 0):
sys.stderr = codecs.g... | liqiangnlp/LiNMT | scripts/hint.aware/chunk/eng/LiNMT-postprocess-text-chunking-rmNP.py | Python | mit | 2,875 |
class CloudFoundryApp(object):
environment_variables = []
instances = 0
meta = {}
created = 0
debug = None
version = 0
running_instances = 0
services = []
state = ""
uris = []
def __init__(self, name, env=None, instances=None, meta=None, created=None, debug=None, version=No... | KristianOellegaard/python-cloudfoundry | cloudfoundry/apps.py | Python | mit | 1,241 |
# Directives using the toolchain
# documentation.
import docutils
def setup(app):
app.add_object_type("asmdirective", "asmdir");
app.add_object_type("asminstruction", "asminst");
app.add_object_type("ppexpressionop", "ppexprop");
app.add_object_type("ppdirective", "ppdir");
app.add_object_type("li... | DCPUTeam/DCPUToolchain | docs/sphinxext/toolchain.py | Python | mit | 335 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
CSRF_ENABLED = True
SECRET_KEY = 'f35fc593c73a35956a70d0a7eeac9bdb'
| anokata/pythonPetProjects | flaskChat/config.py | Python | mit | 206 |
"""
Implementation of the WebhostingService API endpoint
"""
from transip.client import MODE_RW, Client
class WebhostingService(Client):
"""
Transip_WebhostingService
"""
def __init__(self, *args, **kwargs):
super().__init__('WebhostingService', *args, **kwargs)
def get_webhosting_domain... | benkonrath/transip-api | transip/service/webhosting.py | Python | mit | 2,545 |
from __future__ import unicode_literals
import unittest
import frappe
from frappe.website.router import resolve_route
import frappe.website.render
from frappe.utils import set_request
test_records = frappe.get_test_records('Web Page')
def get_page_content(route):
set_request(method='GET', path = route)
response = f... | saurabh6790/frappe | frappe/website/doctype/web_page/test_web_page.py | Python | mit | 2,204 |
# finances.settings
# The common Django settings for the Finance Analysis project.
#
# Author: Benjamin Bengfort <bengfort@cs.umd.edu>
# Created: Tue Jan 19 20:43:16 2016 -0500
#
# Copyright (C) 2015 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: settings.py [] benjamin@bengfort.com $
"""
Django se... | bbengfort/financial-analysis | finances/settings.py | Python | mit | 6,172 |
from bs4 import BeautifulSoup as Soup
import json
import re
import requests
from common import *
from nltk.corpus import words
entries = []
WEBSITE = 'http://www.mechon-mamre.org/jewfaq/glossary.htm'
SITE_TITLE = "Mechon Mamre"
source_object = {"site":WEBSITE, "title":SITE_TITLE}
def main():
parseMechonMamre()
... | JudaismBot/JudaismBot | scrapers/mechonMamre.py | Python | mit | 2,147 |
# This is a hangman game.
# Your game must do the following things.
# Everytime a user guesses a character, it should tell them if their character
# is in the secret word or not.
#
# Also, it should print the guessed character in the following format
# if the secret word is unicorn and the user guessed the letter 'n'
#... | vinaymayar/python-game-workshop | lesson7/hangman.py | Python | mit | 2,668 |
from asposeslides import Settings
from com.aspose.slides import Presentation
from com.aspose.slides import SaveFormat
from javax import ImageIO
from java.io import File
class Thumbnail:
def __init__(self):
# Generating a Thumbnail from a Slide
self.create_thumbnail()
... | ali-salman/Aspose.Slides-for-Java | Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Thumbnail.py | Python | mit | 4,221 |
"""Module with Caffe models."""
from django.db import models
from employees.models import Employee
class Caffe(models.Model):
"""Stores one cafe."""
name = models.CharField(max_length=100, unique=True)
city = models.CharField(max_length=100)
street = models.CharField(max_length=100)
# CharField... | VirrageS/io-kawiarnie | caffe/caffe/models.py | Python | mit | 931 |
# coding: utf-8
# Copyright 2015 Jonathan Goble
#
# 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, ... | jcgoble3/luapatt | tests/test_lua1_basics.py | Python | mit | 6,266 |
from .logging import debug, exception_log
from .typing import Any, List, Dict, Callable, Optional, IO
import os
import shutil
import subprocess
import threading
def add_extension_if_missing(server_binary_args: List[str]) -> List[str]:
if len(server_binary_args) > 0:
executable_arg = server_binary_args[0]
... | tomv564/LSP | plugin/core/process.py | Python | mit | 2,769 |
import sys
import sublime_plugin
if sys.version_info < (3,):
from sublime_lib.path import root_at_packages, get_package_name
else:
from .sublime_lib.path import root_at_packages, get_package_name
PLUGIN_NAME = get_package_name()
COMPLETIONS_SYNTAX_DEF = ("Packages/%s/Syntax Definitions/Sublime Co... | teedoo/dotfiles | .sublime/Packages/PackageDev/completions_dev.py | Python | mit | 921 |
# -*- coding: utf-8 -*-
"""
TDDA constraint discovery and verification is provided for a number
of DB-API (PEP-0249) compliant databases, and also for a number of other
(NoSQL) databases.
The top-level functions are:
:py:func:`tdda.constraints.discover_db_table`:
Discover constraints from a single databas... | tdda/tdda | tdda/constraints/db/constraints.py | Python | mit | 17,342 |
#-------------------------------------------------------------------------
# The Azure Batch Apps Python Client
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated docu... | Azure/azure-batch-apps-python | batchapps/test/unittest_job_manager.py | Python | mit | 6,952 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 thomasv@gitorious, kyuupichan@gmail
#
# 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,... | cryptapus/electrum-uno | lib/wizard.py | Python | mit | 12,442 |
#! /usr/bin/env python
import argparse
import sys
from yamltempl import yamlutils, vtl
def main():
parser = argparse.ArgumentParser(
description="Merge yaml data into a Velocity Template Language template")
parser.add_argument('yamlfile',
metavar='filename.yaml',
... | butwhywhy/yamltempl | yamltempl/yaml_templates_command.py | Python | mit | 1,406 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-01-24 07:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('appauth', '0016_userprofile_numq'),
]
operations = [
migrations.AddField(
... | PrefPy/opra | compsocsite/appauth/migrations/0017_userprofile_exp_data.py | Python | mit | 453 |
# Purpose: Test Script to Ensure that as the complexity of the Scripts Grows functionality can be checked
#
# Info: Uses py.test to test each of the track building functions are working
#
# Running the Test from the COMMAND LINE: py.test test.py
#
# Developed as part of the Software Agents Course at City Universi... | dandxy89/rf_helicopter | pytests.py | Python | mit | 5,028 |
import datetime
import decimal
import inspect
import itertools
import re
import socket
import time
import uuid
from io import BytesIO
from operator import itemgetter
import gridfs
import pymongo
from bson import SON, Binary, DBRef, ObjectId
from bson.int64 import Int64
from pymongo import ReturnDocument
try:
impo... | MongoEngine/mongoengine | mongoengine/fields.py | Python | mit | 90,689 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-06 20:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CodeRu... | RadoRado/EuroPython2017 | run_python_run/repl/migrations/0001_initial.py | Python | mit | 665 |
"""Tests for registry module - datasets method"""
import vcr
from pygbif import registry
@vcr.use_cassette("test/vcr_cassettes/test_datasets.yaml")
def test_datasets():
"registry.datasets - basic test"
res = registry.datasets()
assert dict == res.__class__
@vcr.use_cassette("test/vcr_cassettes/test_data... | sckott/pygbif | test/test-registry-datasets.py | Python | mit | 952 |
from django import forms
import markdown
from core.admin.fields import MarkdownAdminField
from ..models import Category
class CategoryModelForm(forms.ModelForm):
"""
Saves the field description as html version of the raw_description field.
"""
raw_description = MarkdownAdminField(label=u"Description... | ministryofjustice/cla_backend | cla_backend/apps/legalaid/admin_support/forms.py | Python | mit | 601 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.dev20160107235441 on 2016-10-03 18:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('groups', '0001_initial'),
]
operations = [
migrations.AddFi... | yayoiukai/signalserver | groups/migrations/0002_auto_20161003_1842.py | Python | mit | 633 |
import fileinput
def str_to_int(s):
return([ int(x) for x in s.split() ])
# args = [ 'line 1', 'line 2', ... ]
def proc_input(args):
return str_to_int(args[1])
def find(ints, offset):
min = float('inf')
min_index = -1
for k, v in enumerate(ints[offset:]):
if v < min:
min = v
min_index = k + offset
retu... | cripplet/practice | codeforces/489/attempt/a_sort.py | Python | mit | 1,271 |
from __future__ import print_function
import aaf
import aaf.mob
import aaf.define
import aaf.iterator
import aaf.dictionary
import aaf.storage
import aaf.component
import aaf.util
import traceback
import unittest
import os
from aaf.util import AUID, MobID
cur_dir = os.path.dirname(os.path.abspath(__file__))
sandbox... | markreidvfx/pyaaf | tests/test_SourceClip.py | Python | mit | 1,541 |
# Generated from java-escape by ANTLR 4.5
from antlr4 import *
# This class defines a complete listener for a parse tree produced by ODLv21Parser.
class ODLv21Listener(ParseTreeListener):
# Enter a parse tree produced by ODLv21Parser#label.
def enterLabel(self, ctx):
pass
# Exit a parse tree prod... | godber/pds3label | pds3label/vendor/pds3_python/ODLv21Listener.py | Python | mit | 5,308 |
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from name_generator import get_random_name
FONT_SIZE = 14
FONT = ImageFont.truetype("appletext.ttf", FONT_SIZE)
def generate_new_tombstone(name, inscription):
img = Image.open("created_tombstones/base_tombstone.png")
draw = ImageDraw.Dr... | jroyal/OTTGaaS | generator.py | Python | mit | 1,651 |
#!/usr/bin/env python
import os
import sys
import shutil
import glob
import fnmatch
mydir = os.path.dirname(os.path.realpath(__file__))
projectdir = os.path.realpath(mydir + "/../")
dirs = ['dist','deb_dist','build','.tox','.eggs','.cache','psicrawler.egg-info']
files = ['.coverage']
def out(msg):
sys.stdout.wri... | psiopic2/psicrawler | build-scripts/clean.py | Python | mit | 977 |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... | globaltoken/globaltoken | test/functional/test_runner.py | Python | mit | 23,006 |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9554")
else:
access = Ser... | yardsalecoin/yardsalecoin | contrib/bitrpc/bitrpc.py | Python | mit | 7,836 |
import re
import copy
import logging
import datetime
import objectpath
from indra.statements import *
logger = logging.getLogger(__name__)
class EidosProcessor(object):
"""This processor extracts INDRA Statements from Eidos JSON-LD output.
Parameters
----------
json_dict : dict
A JSON dicti... | johnbachman/belpy | indra/sources/eidos/processor.py | Python | mit | 18,394 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-20 03:46
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | econti/quora-clone | quora/questions/migrations/0001_initial.py | Python | mit | 3,169 |
# coding=utf-8
"""
Based on the paper:
http://arxiv.org/pdf/1601.06581v2.pdf
And some improvements from :
https://arxiv.org/pdf/1609.05935v2.pdf
This model is:
Acoustic RNN trained with ctc loss
"""
import tensorflow as tf
from tensorflow.python.client import timeline
import numpy as np
import time
import os
from... | inikdom/rnn-speech | models/AcousticModel.py | Python | mit | 45,676 |
#-*-*- encoding: utf-8 -*-*-
from django.shortcuts import render
from django.template import RequestContext, loader, Context
from django.http import JsonResponse
from .models import Airburst
def index(request):
return render(request, 'NextGenThreat/index.html', {})
def radar(request):
latest_airburst_list = Airbu... | Razican/Exploding-Stars | web/spaceappsbilbao/NextGenThreat/views.py | Python | mit | 2,281 |
# not optimized yet, should be optimized by dp
def combine(word, k):
if k < 1 or k > len(word):
return []
if k == 1:
return [word[i] for i in range(len(word))]
res = combine(word[:-1], k)
tmp = combine(word[:-1], k - 1)
for t in tmp:
res.append(t + word[-1])
return res
... | Chasego/codi | comp/zenefits/skype/WordCombinations.py | Python | mit | 386 |
import numpy as np
import pyroomacoustics as pra
def compute_rir(order):
fromPos = np.zeros((3))
toPos = np.ones((3, 1))
roomSize = np.array([3, 3, 3])
room = pra.ShoeBox(roomSize, fs=1000, absorption=0.95, max_order=order)
room.add_source(fromPos)
mics = pra.MicrophoneArray(toPos, room.fs)
... | LCAV/pyroomacoustics | pyroomacoustics/tests/test_issue_162.py | Python | mit | 663 |
# -*- coding:utf-8 -*-
import re
# Обработка телефонных номеров
phonePattern = re.compile(r'^(\d{3})\D*(\d{3})\D*(\d{4})\D*(\d*)$')
print phonePattern.search('80055512121234').groups()
# ('800', '555', '1212', '1234')
print phonePattern.search('800.555.1212 x1234').groups()
# ('800', '555', '1212', '1234')
print ph... | janusnic/21v-python | unit_13/re6.py | Python | mit | 469 |
import os
import unittest
os.environ['SIMULATE_HARDWARE'] = '1'
os.environ['LOCK_SETTINGS_PATH'] = 'test-settings'
import db
from app import app
primary_pin = '1234'
sub_pin = '0000'
class AppTestCase(unittest.TestCase):
def setUp(self):
app.testing = True
self.app = app.test_client()
d... | remotelockbox/remotelockbox | app_test.py | Python | mit | 1,992 |
"""
Module containing useful functions to link PASTIS MCMC posterior samples with
the bayev package.
"""
import os
import pickle
import importlib
import numpy as np
import PASTIS_NM
import PASTIS_NM.MCMC as MCMC
from PASTIS_NM import resultpath, configpath
def read_pastis_file(target, simul, pastisfile=None):
""... | exord/bayev | pastislib.py | Python | mit | 7,786 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shutil
from migrate import exceptions
from migrate.versioning import version, repository
from migrate.versioning.script import *
from migrate.versioning.util import *
from migrate.tests import fixture
from migrate.tests.fixture.models import t... | razzius/sqlalchemy-migrate | migrate/tests/versioning/test_script.py | Python | mit | 9,323 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('get_feedback', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='course',
name='fee... | david30907d/feedback_django | example/get_feedback/migrations/0002_auto_20160519_0326.py | Python | mit | 1,184 |
"""
HDF5 in memory object
Britton Smith <brittonsmith@gmail.com>
"""
import h5py
import numpy as np
import sys
class H5InMemory(object):
def __init__(self, fh):
self.attrs = {}
if fh is None:
self.data = {}
return
if isinstance(fh, str):
fh = h... | aemerick/galaxy_analysis | physics_data/UVB/grackle_tables/h5_in_memory.py | Python | mit | 2,620 |
# -*- coding: utf-8 -*-
class APIClientException(Exception):
pass
class APIForbidden(APIClientException):
pass
class APINotAuthorized(APIClientException):
pass
class APIInvalidData(APIClientException):
pass
class APIDuplicateObject(APIClientException):
def __init__(self, msg, duplicate_id... | jsatt/rest-client | rest-client/exceptions.py | Python | mit | 428 |
# CamJam EduKit 3 - Robotics
# Worksheet 7 - Controlling the motors with PWM
import RPi.GPIO as GPIO # Import the GPIO Library
import time # Import the Time library
# Set the GPIO modes
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# Set variables for the GPIO motor pins
pinMotorAForwards = 10
pinMotorABackwards ... | CamJam-EduKit/EduKit3 | CamJam Edukit 3 - RPi.GPIO/Code/7-pwm.py | Python | mit | 2,662 |
from django.conf import settings
if 'django_select2' in settings.INSTALLED_APPS:
from django_select2.fields import AutoModelSelect2Field
class PageSearchField(AutoModelSelect2Field):
search_fields = [
'title_set__title__icontains',
'title_set__menu_title__icontains',
... | macs03/demo-cms | cms/lib/python2.7/site-packages/djangocms_link/fields.py | Python | mit | 1,238 |
#!/usr/bin/env python
import argparse
import os
import sqlite3
from Bio import SeqIO, SeqRecord, Seq
from Bio.Align.Applications import ClustalwCommandline
from Bio.Blast import NCBIXML
from Bio.Blast.Applications import NcbiblastnCommandline as bn
from Bio import AlignIO
AT_DB_FILE = 'AT.db'
BLAST_EXE = '~/opt/ncbi... | Serulab/Py4Bio | code/ch20/estimateintrons.py | Python | mit | 4,302 |
from setuptools import setup, find_packages
from os.path import join, dirname
setup(
name="fant_sizer",
version="0.7",
author="Rypiuk Oleksandr",
author_email="ripiuk96@gmail.com",
description="fant_sizer command-line file-information",
url="https://github.com/ripiuk/fan... | ripiuk/fant_sizer | setup.py | Python | mit | 1,096 |
from django.conf.urls.defaults import *
urlpatterns = patterns('mmda.tags.views',
url(r'^(?P<tag_id>.+?)/$', 'show_tag', name='show-tag')
)
| lidel/mmda | tags/urls.py | Python | cc0-1.0 | 145 |
import FWCore.ParameterSet.Config as cms
from HeavyIonsAnalysis.JetAnalysis.jets.akPu3CaloJetSequence_PbPb_mc_cff import *
#PU jets: type 15
akPu3Calomatch15 = akPu3Calomatch.clone(src = cms.InputTag("akPu3CaloJets15"))
akPu3Caloparton15 = akPu3Caloparton.clone(src = cms.InputTag("akPu3CaloJets15"))
akPu3Calocorr15 =... | mverwe/JetRecoValidation | PuThresholdTuning/python/akPu3CaloJetSequence15_cff.py | Python | cc0-1.0 | 1,328 |
import unittest
import io
import aliasdb
from aliasdb import Alias, AliasDB, JSONBackend
class FakeAliasDatabase():
def __init__(self):
self.aliases = []
def add_alias(self, alias):
self.aliases.append(alias)
def get_aliases(self):
return self.aliases
def make_fake_aliases():
... | dcbishop/py-shell-alias | test_aliasdb.py | Python | cc0-1.0 | 5,584 |
from setuptools import setup, find_packages
setup(name='MODEL1302010006',
version=20140916,
description='MODEL1302010006 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/MODEL1302010006',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages(... | biomodels/MODEL1302010006 | setup.py | Python | cc0-1.0 | 377 |
from collections import defaultdict, Counter
from pathlib import Path
import argparse
import sys, copy
import networkx as nx
import numpy as np
from lib.conll import CoNLLReader, DependencyTree
from pandas import pandas as pd
OPEN="ADJ ADV INTJ NOUN PROPN VERB".split()
CLOSED="ADP AUX CONJ DET NUM PART PRON SCONJ".sp... | hectormartinez/ud_unsup_parser | src/udup_ablation.py | Python | cc0-1.0 | 24,285 |
import Aplicacion
import Probabilidades as pr
from Menu import *
from Variable import *
from validador import *
#------------------------------------------------
#--------------- TODO ---------------------------
#------------------------------------------------
# 1) Lista de tareas pendientes a implementar.
# ... | pepitogithub/PythonScripts | crypto.py | Python | gpl-2.0 | 5,608 |
from django import forms
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
# Register your models here.
from accounts.models import (User,
ValidSMSCod... | ekivemark/bofhirdev | accounts/admin.py | Python | gpl-2.0 | 4,321 |
# encoding: utf-8
# (c) 2019 Open Risk (https://www.openriskmanagement.com)
#
# portfolioAnalytics is licensed under the Apache 2.0 license a copy of which is included
# in the source distribution of correlationMatrix. This is notwithstanding any licenses of
# third-party software included in this distribution. You ma... | open-risk/portfolio_analytics_library | portfolioAnalytics/utils/portfolio.py | Python | gpl-2.0 | 2,867 |
import webapp2
from google.appengine.api import taskqueue
from util import (datetime_now, parse_timestamp, domain_from_url,
datetuple_to_string)
from cleaner import get_feeditem_model
from models import (FeedModel, FeedItemModel,
FeedModelKey, FeedItemKey)
from storage import (get... | taimur97/Feeder | server/appengine/tasks.py | Python | gpl-2.0 | 4,156 |
import bcrypt
from hashlib import sha512
from helptux import db, login_manager
class Role(db.Model):
__tablename__ = 'roles'
id = db.Column(db.Integer, primary_key=True)
role = db.Column(db.String(255), index=True, unique=True)
def __repr__(self):
return '<Role {0}>'.format(self.role)
de... | pieterdp/helptux | helptux/models/user.py | Python | gpl-2.0 | 2,613 |
from Screen import Screen
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Pixmap import Pixmap
from Components.Sources.StaticText import StaticText
from Components.MenuList import MenuList
from enigma import eTimer
class MessageBox(Screen):
TYPE_YESNO = 0
TYPE_INFO = 1
... | pli3/enigma2-git | lib/python/Screens/MessageBox.py | Python | gpl-2.0 | 3,710 |
#!/usr/bin/env python
###############################################################################
# $Id: ogr_gpsbabel.py 33793 2016-03-26 13:02:07Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read functionality for OGR GPSBabel driver.
# Author: Even Rouault <even dot rouault at mines dash paris ... | nextgis-extra/tests | lib_gdal/ogr/ogr_gpsbabel.py | Python | gpl-2.0 | 4,660 |
# -*- coding: utf-8 -*-
import attr
from cached_property import cached_property
from navmazing import NavigateToSibling, NavigateToAttribute
from wrapanapi.containers.image import Image as ApiImage
from cfme.common import (WidgetasticTaggable, PolicyProfileAssignable,
TagPageView)
from cfme.c... | akarol/cfme_tests | cfme/containers/image.py | Python | gpl-2.0 | 11,425 |
# Copyright (C) 2012 Bastian Kleineidam
#
# 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 distribute... | linkcheck/linkchecker | tests/checker/telnetserver.py | Python | gpl-2.0 | 3,383 |
# coding=utf-8
"""
Profiler utility for python
Erik de Jonge
erik@a8.nl
license: gpl2
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import os... | erikdejonge/pyprofiler | pyprofiler/__init__.py | Python | gpl-2.0 | 2,901 |
import os.path
from askapdev.rbuild.builders import CMake as Builder
import askapdev.rbuild.utils as utils
# CMake doesn't know about ROOT_DIR for blas and lapack, so need to
# explicitly name them. Want to use the dynamic libraries in order
# to avoid link problems with missing FORTRAN symbols.
platform = utils.g... | ATNF/askapsdp | 3rdParty/casacore/casacore-1.6.0a/build.py | Python | gpl-2.0 | 1,801 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
u"""
Задание 1: классный Человек.
УСЛОВИЕ:
Реализовать класс Person, который отображает запись в книге контактов.
Класс имеет 4 атрибута:
- surname - строка - фамилия контакта (обязательный)
- first_name - строка - имя контакта (обязательный)
- nickname - строк... | pybursa/homeworks | s_shybkoy/hw5/hw5_task1.py | Python | gpl-2.0 | 2,975 |
# This stores all the dialogue related stuff
import screen
class Dialogue(object):
"""Stores the dialogue tree for an individual NPC"""
def __init__(self, npc):
super(Dialogue, self).__init__()
self.npc = npc
self.game = npc.game
self.root = None
self.currentNode = None
def setRootNode(self... | mjdarby/RogueDetective | dialogue.py | Python | gpl-2.0 | 2,401 |
# coding=utf-8
'''
Created on 6.6.2013
Updated on 29.8.2013
Potku is a graphical user interface for analyzation and
visualization of measurement data collected from a ToF-ERD
telescope. For physics calculations Potku uses external
analyzation components.
Copyright (C) Timo Konu
This program is free software; you... | jaakkojulin/potku | Widgets/MatplotlibImportTimingWidget.py | Python | gpl-2.0 | 6,288 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2009 Douglas S. Blank
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | arunkgupta/gramps | gramps/plugins/quickview/ageondate.py | Python | gpl-2.0 | 2,780 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ceph', '0004_rm_models_based_on_storageobj'),
]
operations = [
migrations.AddField(
model_name='cephpool',
... | openattic/openattic | backend/ceph/migrations/0005_cephpool_percent_used.py | Python | gpl-2.0 | 479 |
from datetime import datetime
import listenbrainz_spark.stats.utils as stats_utils
from listenbrainz_spark.path import LISTENBRAINZ_DATA_DIRECTORY
from listenbrainz_spark import utils
from listenbrainz_spark.tests import SparkTestCase
from listenbrainz_spark.stats import offset_months, offset_days
from pyspark.sql im... | Freso/listenbrainz-server | listenbrainz_spark/stats/tests/test_utils.py | Python | gpl-2.0 | 2,000 |
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = 'Copyright (c) 2013 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = (
'BaseDummyWidget', 'Dummy1x1Widget', 'Dummy1x2Widget', 'Dummy2x1Widget',
'Dummy2x2Widget', 'Dummy3x3Widget'
)
from django.template.loader import render... | georgistanev/django-dash | src/dash/contrib/plugins/dummy/dash_widgets.py | Python | gpl-2.0 | 1,869 |
# -*- coding: utf-8 -*-
#
# RBFOpt documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 11 00:01:21 2015.
#
# 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.
#
# Al... | dagothar/gripperz | ext/rbfopt/doc/conf.py | Python | gpl-2.0 | 11,493 |
#
#
# Copyright (C) 2006, 2007, 2008, 2012 Google Inc.
#
# 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 progr... | vladimir-ipatov/ganeti | lib/rapi/baserlib.py | Python | gpl-2.0 | 17,689 |
from gettext import gettext as _
from pulp.client.commands import options
from pulp.client.commands.criteria import DisplayUnitAssociationsCommand
from pulp.client.commands.unit import UnitCopyCommand, UnitRemoveCommand
from pulp_docker.common import constants
DESC_COPY_MANIFESTS = _('copies manifests from one repo... | rbarlow/pulp_docker | extensions_admin/pulp_docker/extensions/admin/content.py | Python | gpl-2.0 | 7,183 |
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'resources', 'lib'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'resources', 'lib', 'pyscraper'))
from matcher import Matcher
import util as util
import unittest
class TestM... | bruny/romcollectionbrowser | resources/tests/test_matcher.py | Python | gpl-2.0 | 2,187 |
from model.commonfactory import CommonFactory
from model.slaveunit import SlaveUnit
from model.squireunit import SquireUnit
from model.swordfighterunit import SwordfighterUnit
from model.archerunit import ArcherUnit
from model.cavalryunit import CavalryUnit
UNIT_TYPES = {
'slave': SlaveUnit,
'squire': SquireUn... | mogria/rtsh | srv/model/unitfactory.py | Python | gpl-2.0 | 546 |
import glob
import operational_instruments
from astropy.io import fits
from numpy.fft import fft2, ifft2
import sewpy
from astropy import wcs
from astropy.table import Table
from astropy.io import ascii
from astropy.time import Time
import pytz
import numpy as np
import os
import time
import log_utilities... | ytsapras/robonet_site | scripts/reception_data.py | Python | gpl-2.0 | 34,418 |
#! /usr/bin/python
# used to discuss ticket #302: "stop permuting peerlist?"
import time
import math
from hashlib import sha1, md5, sha256
myhash = md5
# md5: 1520 "uploads" per second
# sha1: 1350 ups
# sha256: 930 ups
from itertools import count
from twisted.python import usage
def abbreviate_space(s, SI=True):
... | drewp/tahoe-lafs | misc/simulators/ringsim.py | Python | gpl-2.0 | 8,203 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id: tdAppliance1.py $
"""
VirtualBox Validation Kit - IAppliance Test #1
"""
__copyright__ = \
"""
Copyright (C) 2010-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free soft... | miguelinux/vbox | src/VBox/ValidationKit/tests/api/tdAppliance1.py | Python | gpl-2.0 | 7,406 |
import logging
from datetime import datetime
from django import template
from django.utils import timezone
register = template.Library()
logger = logging.getLogger(__name__)
@register.filter(expects_localtime=True)
def fuzzy_time(time):
"""Formats a `datetime.time` object relative to the current time."""
dt... | tjcsl/ion | intranet/apps/templatetags/dates.py | Python | gpl-2.0 | 2,302 |
#
# Base object of all payload sources.
#
# Copyright (C) 2019 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 version.
# This program is ... | atodorov/anaconda | pyanaconda/modules/payloads/source/source_base_interface.py | Python | gpl-2.0 | 1,817 |
from datetime import datetime
from api.utils import api_response
def auth_required(fn):
def wrapped(self, request, *args, **kwargs):
if not request.user.is_authenticated():
return api_response({"error": "not authenticated"}, status=401)
request.user.last_action=datetime.now().replace(t... | 13pi/HipstaChat | api/decorators.py | Python | gpl-2.0 | 684 |
#!/usr/bin/python
import sys, re
from socket import *
serve_addr = ('localhost', 47701)
if __name__ == '__main__':
IRC_BOLD = '\x02'
IRC_ULINE = '\x1f'
IRC_NORMAL = '\x0f'
IRC_RED = '\x034'
IRC_LIME = '\x039'
IRC_BLUE = '\x0312'
repo, branch, author, rev, description = sys.argv[1:6]
match = re.sear... | adblockplus/abpbot | beanbot-client.py | Python | gpl-2.0 | 843 |
#!/usr/bin/env python -tt
# encoding: utf-8
#
"""Use a descriptive macro instead of assert(false);"""
error_msg = 'Use NEVER_HERE() from base/macros.h here.'
regexp = r"""assert *\( *(0|false) *\)"""
forbidden = [
'assert(0)',
'assert(false)',
]
allowed = [
'NEVER_HERE()',
]
| widelands/widelands | cmake/codecheck/rules/assert0.py | Python | gpl-2.0 | 293 |
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "AC433e7b0bec93dc5996e4fb80b1e56eec"
auth_token = "9cc9267fe09dab362d3be160f711a09d"
client = TwilioRestClient(account_sid, auth_token)
message = client.sms.messages.create(body="Jenny please?! I lo... | spicyramen/sipLocator | tools/testSmS.py | Python | gpl-2.0 | 471 |
# Build Code
import os
import subprocess
import re
class GCC:
def __init__(self):
self.enter_match = re.compile(r'Entering directory')
self.leave_match = re.compile(r'Leaving directory')
def can_build(self, dirname, ext):
if ext in (".c", ".h", ".cpp", ".hpp"):
files = [f.lower() for f in os.listdir(dirn... | peter1010/my_vim | vimfiles/py_scripts/build_types/gcc.py | Python | gpl-2.0 | 1,180 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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... | nharraud/invenio-jsonschemas | invenio_jsonschemas/errors.py | Python | gpl-2.0 | 2,330 |
__author__ = 'fer'
from xml.etree import ElementTree
from xml.etree.ElementTree import Element
from xml.etree.ElementTree import SubElement
from core.tableObjects import Table, Column
class Xml:
archivo = None
def __init__(self, ruta=None):
self.archivo = ruta
def get_doc(self) -> ElementTree:
... | arkadoel/directORM | python/core/procesoxml.py | Python | gpl-2.0 | 2,615 |
from thug.ThugAPI.ThugAPI import ThugAPI
class TestMIMEHandler(object):
def do_perform_test(self, caplog, url, expected, type_ = "remote"):
thug = ThugAPI()
thug.set_useragent('win7ie90')
thug.set_features_logging()
thug.set_ssl_verify()
thug.log_init(url)
m = get... | buffer/thug | tests/functional/test_mimehandler.py | Python | gpl-2.0 | 828 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append("..")
#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Pychart 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 Foundati... | pacoqueen/bbinn | PyChart-1.39/demos/bgtest.py | Python | gpl-2.0 | 1,171 |
#
# Copyright (c) 2013,2014, Oracle and/or its affiliates. All rights reserved.
#
# 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; version 2 of the License.
#
# This program is distributed in the... | ioggstream/mysql-utilities | mysql/fabric/protocols/xmlrpc.py | Python | gpl-2.0 | 28,648 |
from collections import deque
from lcdui import common
from lcdui.ui import widget
import array
import time
class Frame(object):
def __init__(self, ui):
self._ui = ui
self._widgets = {}
self._position = {}
self._span = {}
self._screen_buffer = ScreenBuffer(self.rows(), self.cols())
self.onI... | RockingRolli/pylcdui | lcdui/ui/frame.py | Python | gpl-2.0 | 7,655 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_fiscal_icnfefetuarpagamento.ui'
#
# Created: Mon Nov 24 22:25:57 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
from pydaruma.pydaruma i... | edineicolli/daruma-exemplo-python | scripts/fiscal/ui_fiscal_icnfefetuarpagamento.py | Python | gpl-2.0 | 5,558 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN.
#
# Invenio 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... | omelkonian/cds | cds/modules/records/api.py | Python | gpl-2.0 | 2,845 |
from mylibs.transform import *
from mylibs.online import *
from mylibs.index import *
import mylibs.myio
import mylibs.models
import paths
import pickle
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.ensemble import RandomForestClassifier
impo... | CharLLCH/jianchi_alimobileR | ftrldata/TCReBuild/codes/revision.py | Python | gpl-2.0 | 3,670 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.