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 |
|---|---|---|---|---|---|
import datetime
def json_datetime_decoder(data):
for key, value in data.items():
if not value:
data[key] = None
if 'datetime' in key:
data[key] = datetime.datetime.strptime(value, '%Y-%m-%dT%H:%M:%S.%fZ').replace(tzinfo=datetime.timezone.utc)
elif key == 'colors':... | AstroMatt/esa-time-perception | backend/common/utils.py | Python | mit | 378 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-21 08:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('invitations', '0002_auto_20161009_2158'),
]
operat... | mcallistersean/b2-issue-tracker | toucan/invitations/migrations/0003_auto_20161021_0859.py | Python | mit | 555 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/base/shared_base_backpack.iff"
result.attribute_template_... | anhstudios/swganh | data/scripts/templates/object/tangible/wearables/base/shared_base_backpack.py | Python | mit | 459 |
# coding: utf-8
class EmailConfirmationExpired(Exception):
pass
| ademuk/django-email-confirm-la | email_confirm_la/exceptions.py | Python | mit | 70 |
# encoding: utf-8
import argparse
import math
import os.path
import pickle
import re
import sys
import time
from nltk.translate import bleu_score
import numpy
import six
import chainer
from chainer import cuda
import chainer.functions as F
import chainer.links as L
from chainer import reporter
from chainer import tr... | keisuke-umezawa/chainer | examples/chainermn/seq2seq/seq2seq_mp1.py | Python | mit | 19,044 |
import yaml
from monitors import MonitorType
from actions import ActionType
from threading import Timer, Lock
import rospy
class Watchdog(object):
yaml_keys = ['name', 'description', 'restart_timeout', 'monitors', 'actions']
def __init__(self, config):
if not isinstance(config, dict):
rais... | bfalacerda/strands_apps | watchdog_node/src/watchdog_node/watchdog.py | Python | mit | 2,497 |
import numpy
import copy
class HomogeneousData():
def __init__(self, data, batch_size=128, maxlen=None):
self.batch_size = 128
self.data = data
self.batch_size = batch_size
self.maxlen = maxlen
self.prepare()
self.reset()
def prepare(self):
self.caps =... | btjhjeon/ConversationalQA | skipthoughts/training/homogeneous_data.py | Python | mit | 5,360 |
import unittest
import joerd.output.skadi as skadi
class TestTileName(unittest.TestCase):
def test_tile_name_parsing(self):
for x in range(0, 360):
for y in range(0, 180):
tile_name = skadi._tile_name(x, y)
self.assertEqual((x, y), skadi._parse_tile(tile_name))... | tilezen/joerd | tests/test_skadi.py | Python | mit | 321 |
import json
import sqlite3
class TermsAndConditionsDB(object):
db_file = 'terms_conditions.db'
def __init__(self):
self.con = sqlite3.connect(TermsAndConditionsDB.db_file)
with self.con:
cursor = self.con.cursor()
cursor.execute('''CREATE TABLE IF NOT EXISTS terms_condi... | open-multinet/docker-am | gcf_docker_plugin/terms_conditions/terms_conditions.py | Python | mit | 2,364 |
from collections import OrderedDict
import re
import os
from xml.etree import ElementTree as ET
import openmc
import openmc.checkvalue as cv
from openmc.data import NATURAL_ABUNDANCE, atomic_mass
class Element(str):
"""A natural element that auto-expands to add the isotopes of an element to
a material in the... | johnnyliu27/openmc | openmc/element.py | Python | mit | 8,571 |
import sys
import re
import numpy
from matplotlib import pyplot
# Choose correct html parser library
version = sys.version_info.major
if version == 2:
from HTMLParser import HTMLParser
else:
from html.parser import HTMLParser
### Initialize Data Structures ###
# Set Month Data Array and Name values.
month = [0] * ... | mzhr/fb_freq | fb_freq.py | Python | mit | 2,990 |
import settings
__author__ = 'Maruf Maniruzzaman'
import tornado
from tornado import gen
from cosmos.service.requesthandler import RequestHandler
class IndexHandler(RequestHandler):
@gen.coroutine
def get(self):
try:
with open(settings.INDEX_HTML_PATH) as f:
self.write(f... | mmrobbin/myproject | views.py | Python | mit | 422 |
import requests, csv, time
from bs4 import BeautifulSoup
def download_group_odds():
teams = []
sites = []
for group in (chr(ord('a') + x) for x in range(0,8)):
urltemplate = "http://www.oddschecker.com/football/world-cup/group-{}/to-qualify"
url = urltemplate.format(group)
print "ge... | llimllib/champsleagueviz | wcqualify/dl.py | Python | mit | 1,842 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_ith_pants_formal_11.iff"
result.a... | obi-two/Rebelion | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_ith_pants_formal_11.py | Python | mit | 466 |
from TimeFunctions import calculate_time_diff | hwroitzsch/BikersLifeSaver | src/nfz_module/__init__.py | Python | mit | 45 |
from flair.data import TaggedCorpus, Sentence
from flair.data_fetcher import NLPTaskDataFetcher, NLPTask
from flair.embeddings import TokenEmbeddings, WordEmbeddings, StackedEmbeddings, FlairEmbeddings
from typing import List
from flair.models import SequenceTagger
from torch.optim.adam import Adam
columns = {0: 'text... | Bilingual-Annotation-Task-Force/Scripts | train_flair_POS.py | Python | mit | 2,075 |
import re
def removeLinks(text):
"""This Regex taken from http://stackoverflow.com/questions/11331982/how-to-remove-any-url-within-a-string-in-python"""
return re.sub(r'^https?:\/\/.*[\r\n]*', '', text, flags=re.MULTILINE)
| JoelHoskin/CatHack | FilterHelper.py | Python | mit | 226 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_tatooine_fixer.iff"
result.attribute_template_id = 9
... | obi-two/Rebelion | data/scripts/templates/object/mobile/shared_dressed_tatooine_fixer.py | Python | mit | 437 |
#!/usr/bin/env python
import os, sys, datetime
sys.path.insert ( 0, os.path.dirname(os.path.abspath(__file__) ) + "/../" )
import gepard
import json
import threading
import time
import types
import time
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
# import ipaddress
# =========... | gessinger-hj/gepard-python | test/Event.test.py | Python | mit | 1,056 |
import logging
from twisted.python import log
#see http://stackoverflow.com/questions/13748222/twisted-log-level-switch
class LevelFileLogObserver(log.FileLogObserver):
def __init__(self, f, level=logging.INFO):
log.FileLogObserver.__init__(self, f)
self.logLevel = level
def emit(self, eventD... | rauburtin/sftpproxydocker | sftpproxydocker/levfilelogger.py | Python | mit | 603 |
"""
SoftLayer.tests.CLI.core_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import io
import logging
import click
from unittest import mock as mock
from requests.models import Response
import SoftLayer
from SoftLayer.CLI import core
from SoftLayer.CLI import environ... | softlayer/softlayer-python | tests/CLI/core_tests.py | Python | mit | 4,941 |
from pyhdf.HDF import *
from pyhdf.VS import *
f = HDF('inventory.hdf', # Open file 'inventory.hdf' in write mode
HC.WRITE|HC.CREATE) # creating it if it does not exist
vs = f.vstart() # init vdata interface
vd = vs.attach('INVENTORY', 1) # attach vdata 'INVENTORY' in write mode... | fhs/python-hdf4 | examples/inventory/inventory_1-3.py | Python | mit | 1,101 |
import aiohttp
from time import time
import json
from hashlib import sha256
import hmac
from .fetcher import Fetcher
class BinanceAPI(Fetcher):
_URL = 'https://api.binance.com/api/v3/'
_KEY = None
_SECRET = None
def __init__(self, key, secret):
if key is None or secret is None:
... | etherionlab/the_token_fund_asset_parser | models/binance.py | Python | mit | 1,694 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Flask-NewProject documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 5 14:38:01 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in ... | Gunak/flask-blueprintTemplate | docs/source/conf.py | Python | mit | 4,830 |
# -*- coding: utf-8 -*-
import os
try:
import zlib as binascii
except ImportError:
import binascii
from base64 import urlsafe_b64encode
import auth.up
import conf
_workers = 1
_task_queue_size = _workers * 4
_chunk_size = 256 * 1024
_try_times = 3
_block_size = 4 * 1024 * 1024
class Error(Exception):
value = None... | yobin/saepy-log | qiniu/resumable_io.py | Python | mit | 5,011 |
#!/usr/bin/env python
from agate.columns.base import Column
class BooleanColumn(Column):
"""
A column containing :class:`bool` data.
"""
pass
| TylerFisher/agate | agate/columns/boolean.py | Python | mit | 160 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/chemistry/shared_dye_hair.iff"
result.attribute_template_... | anhstudios/swganh | data/scripts/templates/object/tangible/component/chemistry/shared_dye_hair.py | Python | mit | 433 |
from model import *
# ------------------------------------------------------------------ helpers and mgmt
def get_feed_dic_obs(obs):
# needing to create all the nessisary feeds
obs_x = []
obs_y = []
obs_tf = []
for _ in range(OBS_SIZE):
obs_x.append(np.zeros([N_BATCH,L]))
obs_y.append(np.zeros([N_... | evanthebouncy/nnhmm | radar_lstm/active_learning.py | Python | mit | 2,142 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-08-11 11:31
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('transactions', '0005_auto_20170811_1048'),
]
operations = [
] | sebastienbarbier/723e_server | seven23/models/transactions/migrations/0006_auto_20170811_1131.py | Python | mit | 294 |
import sys
from restorm.examples.mock.api import TicketApiClient
def main(argv):
"""
Start with::
python -m restorm.examples.mock.library_serv [port or address:port]
"""
ip_address = '127.0.0.1'
port = 8000
# This is an example. Your should do argument checking.
if len(argv... | joeribekker/restorm | restorm/examples/mock/ticket_serv.py | Python | mit | 1,056 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#############################
# name:updateHosts
# author:https://github.com/ladder1984
# version:1.3.3
# license:MIT
############################
import urllib2
import platform
import datetime
import time
import re
import os
import shutil
import ConfigParser
import sys
i... | wuantony0701/updateHosts | updateHosts.py | Python | mit | 4,913 |
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule.py | Python | mit | 5,400 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-15 19:07
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stats', '0011_jsonb_step_2'),
]
operations = [
migrations.RenameField(
m... | Flyingfox646/flyingfox | src/stats/migrations/0012_jsonb_step_3.py | Python | mit | 3,011 |
""" This module contains a class for quickly creating bots. It is the highest
level of abstraction of the IRC protocol available in ``ircutils``.
"""
from . import client
from . import events
class SimpleBot(client.SimpleClient):
""" A simple IRC bot to subclass. When subclassing, make methods in the
form ... | Alakala/eggpy | ircutils/bot.py | Python | mit | 2,203 |
""" Add inventory in and inventory out link to calculate profit using FIFO method
Revision ID: a173601e2e8c
Revises: 5fa54f2ce13c
Create Date: 2017-03-29 07:06:57.758959
"""
# revision identifiers, used by Alembic.
revision = 'a173601e2e8c'
down_revision = '5fa54f2ce13c'
from alembic import op
import sqlalchemy as ... | betterlife/psi | psi/migrations/versions/35_a173601e2e8c_.py | Python | mit | 2,034 |
# Skip if long ints are not supported.
import skip_if
skip_if.no_bigint()
print((2**64).to_bytes(9, "little"))
print((-2**64).to_bytes(9, "little", signed=True))
print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0", "little"))
print(int.from_bytes(b"\x01\0\0\0\0\0\0\0", "little"))
print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0",... | adafruit/micropython | tests/basics/int_longint_bytes.py | Python | mit | 332 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
import django.core.validators
import open_humans.models
class Migration(migrations.Migration):
dependencies = [
('open_humans', '0014_rename_openhumansuser'),
]
operations = [
migrations.AlterModelManagers(
nam... | PersonalGenomesOrg/open-humans | open_humans/migrations/0015_auto_20150410_0042.py | Python | mit | 1,726 |
#!/usr/bin/env python
import sys
import os
import piny
# settings
P = 4
box = 3 * [24.832]
dir_out_eq = 'equilibration'
dir_out_prod = 'production'
fn_initial_xyz = 'W512-initial.xyz'
fn_FF = 'water-q-TIP4P-F.py'
min_dist = 0.1
max_dist = 10.0
res_dist = 5.0
# times in fs
t_tot_eq = 10000
t_tot_prod = 100000
t_... | yuhangwang/PINY | examples/q-TIP4P-F/build.py | Python | epl-1.0 | 3,923 |
#!/usr/bin/env python
# B a r a K u d a
#
# Prepare 2D maps (monthly) that will later become a GIF animation!
# NEMO output and observations needed
#
# L. Brodeau, november 2016
import sys
import os
import numpy as nmp
from netCDF4 import Dataset
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.... | brodeau/barakuda | python/exec/movie_square_zoom_IFS.py | Python | gpl-2.0 | 5,894 |
# Copyright © 2017 Red Hat, Inc. and others.
#
# This file is part of Bodhi.
#
# 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 ve... | Conan-Kudo/bodhi | bodhi/server/migrations/versions/__init__.py | Python | gpl-2.0 | 843 |
#==============================================================================
# facade.py
# Main gandalf library front-end when invoking gandalf from within python.
#
# This file is part of GANDALF :
# Graphical Astrophysics code for N-body Dynamics And Lagrangian Fluids
# https://github.com/gandalfcode/gandalf
... | gandalfcode/gandalf | analysis/facade.py | Python | gpl-2.0 | 49,171 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 7 10:22:32 2015
Finished on Fri Jul 1 22:59:40 2016
@author: Daniel Danis <daniel.danis@savba.sk>
Use this script to create gene panel (GP) in BED format. Take infro from Ensembl's GTF file.
The purpose of GP is to define genome-scaled regions of ... | humno/gene-panel-creator | gene_panel_creator.py | Python | gpl-2.0 | 10,269 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | nsnam/ns-3-dev-git | src/stats/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 278,809 |
import pytest
class TestArping:
@pytest.mark.complete("arping ")
def test_1(self, completion):
assert completion
@pytest.mark.complete("arping -", require_cmd=True)
def test_2(self, completion):
assert completion
| scop/bash-completion | test/t/test_arping.py | Python | gpl-2.0 | 248 |
from unittest import TestCase
from pylons import request
from datetime import date
from bluechips.lib import helpers as h
class TestHelpers(TestCase):
def test_grab_real_object(self):
class Foo(object):
pass
foo = Foo()
foo.bar = 'some string'
assert h.grab(foo, 'bar') =... | ebroder/bluechips | bluechips/tests/lib/test_helpers.py | Python | gpl-2.0 | 1,342 |
# -*- coding: UTF-8 -*-
# CCcam Info by AliAbdul
from base64 import encodestring
from os import listdir, remove, rename, system, popen, path
from enigma import eListboxPythonMultiContent, eTimer, gFont, loadPNG, RT_HALIGN_RIGHT, getDesktop
from Components.ActionMap import ActionMap, NumberActionMap
from Components.co... | hdeeco/stb-gui | lib/python/Screens/CCcamInfo.py | Python | gpl-2.0 | 51,907 |
# -*- coding: utf-8 -*-
"""
Python documentation LaTeX file tokenizer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For more documentation, look into the ``restwriter.py`` file.
:copyright: 2007-2008 by Georg Brandl.
:license: BSD.
"""
import re
from .scanner import Scanner
class Tokenizer(Scanner)... | creasyw/IMTAphy | documentation/doctools/converter/converter/tokenizer.py | Python | gpl-2.0 | 3,773 |
import plumperfect_test
if __name__ == '__main__':
app = plumperfect_test.create_app()
app.run(
host = app.config.get( 'SERVER_HOST' ),
port = app.config.get( 'SERVER_PORT' ),
debug = app.config.get( 'DEBUG' )
)
| cpcloud/plumperfect.test | run.py | Python | gpl-2.0 | 259 |
#!/usr/bin/python3
'''
Provides IPython console widget.
@author: Eitan Isaacson
@organization: IBM Corporation
@copyright: Copyright (c) 2007 IBM Corporation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms of the BSD which accompanies this distributio... | strahlc/exaile | plugins/ipconsole/ipython_view/ipython_view.py | Python | gpl-2.0 | 21,886 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from variable_functions import my_attribute_label
class percent_development_type_DDD_within_walking_distance(Variable):
"""There is exactl... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/randstad/gridcell/percent_development_type_DDD_within_walking_distance.py | Python | gpl-2.0 | 3,195 |
# #
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (ht... | valtandor/easybuild-easyblocks | easybuild/easyblocks/generic/intelbase.py | Python | gpl-2.0 | 20,761 |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | bmi-forum/bmi-pyre | pythia-0.8/packages/opal/tests/hello.py | Python | gpl-2.0 | 1,368 |
import numpy as np
import tensorflow as tf
from swl.machine_learning.tensorflow_model import SimpleAuxiliaryInputTensorFlowModel
#--------------------------------------------------------------------
class SimpleSeq2SeqEncoderDecoder(SimpleAuxiliaryInputTensorFlowModel):
def __init__(self, encoder_input_shape, decode... | sangwook236/sangwook-library | python/test/machine_learning/simple_seq2seq_encdec.py | Python | gpl-2.0 | 14,909 |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~... | bmi-forum/bmi-pyre | pythia-0.8/packages/pyre/tests/geometry/pickle.py | Python | gpl-2.0 | 1,303 |
# Copyright (c) 2008-2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy... | domcleal/tito | src/tito/config_object.py | Python | gpl-2.0 | 1,559 |
__author__ = '奇炜'
| iamxi/jzspyw.com | lib/tool/__init__.py | Python | gpl-2.0 | 22 |
# Copyright (c) 2010 Google Inc. All rights reserved.
# Copyright (C) 2017 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above... | Debian/openjfx | modules/web/src/main/native/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py | Python | gpl-2.0 | 15,182 |
"""
Virt management features
Copyright 2007, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foun... | pombredanne/func | func/minion/modules/virt.py | Python | gpl-2.0 | 9,204 |
# 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 distributed in the hope that it will be useful,
# bu... | tyll/bodhi | bodhi/tests/server/scripts/test_untag_branched.py | Python | gpl-2.0 | 1,514 |
# Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Servir-Mekong/SurfaceWaterTool | lib/google/api_core/gapic_v1/__init__.py | Python | gpl-3.0 | 1,079 |
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a sample controller
## - index is the default action of any application
## - user is required for authentication and authorization... | DaytonGarcia/quizmodule | controllers/evaluation.py | Python | gpl-3.0 | 37,242 |
#!/usr/bin/python
# (c) Nelen & Schuurmans. GPL licensed.
from __future__ import division, print_function
from django.conf import settings
import urlparse
from twitter import *
from django.contrib.gis.geos import Point
from lizard_sticky_twitterized.models import StickyTweet
import locale
from datetime import datetim... | lizardsystem/lizard-sticky-twitterized | lizard_sticky_twitterized/twitter_connector.py | Python | gpl-3.0 | 3,321 |
#!/usr/bin/env python
# --!-- coding: utf8 --!--
from PyQt5.QtWidgets import QListView
from manuskript import settings
from manuskript.functions import findBackground
from manuskript.ui.views.corkDelegate import corkDelegate
from manuskript.ui.views.dndView import dndView
from manuskript.ui.views.outlineBasics import ... | gedakc/manuskript | manuskript/ui/views/corkView.py | Python | gpl-3.0 | 2,083 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | EliteTK/qutebrowser | tests/unit/commands/test_runners.py | Python | gpl-3.0 | 2,651 |
# -*- coding: utf-8 -*-
#
# Copyright © 2013 The Spyder Development Team
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""
Rope introspection plugin
"""
import time
from spyderlib import dependencies
from spyderlib.baseconfig import get_conf_path, _, STDERR
from spyderlib.ut... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/utils/introspection/rope_plugin.py | Python | gpl-3.0 | 13,334 |
# -*- coding: utf-8 -*-
import io
import logging
import re
from babelfish import Language, language_converters
from guessit import guessit
try:
from lxml import etree
except ImportError:
try:
import xml.etree.cElementTree as etree
except ImportError:
import xml.etree.ElementTree as etree
fr... | FireBladeNooT/Medusa_1_6 | lib/subliminal/providers/podnapisi.py | Python | gpl-3.0 | 6,970 |
import unittest
from doctest import DocTestSuite
from test import support
import weakref
import gc
# Modules under test
_thread = support.import_module('_thread')
threading = support.import_module('threading')
import _threading_local
class Weak(object):
pass
def target(local, weaklist):
weak = Weak()
lo... | mancoast/CPythonPyc_test | fail/314_test_threading_local.py | Python | gpl-3.0 | 6,080 |
from __future__ import unicode_literals
import datetime
from django import VERSION
try:
from django.contrib.auth import get_user_model # Django 1.5
except ImportError:
from postman.future_1_5 import get_user_model
from django.http import QueryDict
from django.template import Node
from django.template import ... | hzlf/openbroadcast.org | website/tools/postman/templatetags/postman_tags.py | Python | gpl-3.0 | 5,258 |
# coding: utf-8
from __future__ import absolute_import
from .base_model_ import Model
from datetime import date, datetime
from typing import List, Dict
from ..util import deserialize_model
class Order(Model):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the cl... | christophelec/test-repo | app/swaggerservernew/models/order.py | Python | gpl-3.0 | 4,844 |
#!/usr/bin/env python3
#
# Misc: Uncategorized checks that might be moved to some better addon later
#
# Example usage of this addon (scan a sourcefile main.cpp)
# cppcheck --dump main.cpp
# python misc.py main.cpp.dump
import cppcheckdata
import sys
import re
DEBUG = ('-debug' in sys.argv)
VERIFY = ('-verify' in sys... | bartlomiejgrzeskowiak/cppcheck | addons/misc.py | Python | gpl-3.0 | 6,125 |
import bpy
from bpy.props import EnumProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode
from sverchok.utils.math import coordinate_modes
from sverchok.utils.field.scalar import SvVectorFieldDecomposed
class SvDecomposeVectorFieldNode(bpy.types.Node, SverchCus... | nortikin/sverchok | nodes/field/decompose_vector_field.py | Python | gpl-3.0 | 2,767 |
"""
Modules for plotting
"""
| adybbroe/atrain_match | atrain_match/reshaped_files_scr/__init__.py | Python | gpl-3.0 | 30 |
# -*- coding: utf-8 -*-
"""
General description
-------------------
Example that shows how to add an `shared_limit` constraint to a model.
The following energy system is modeled with four time steps:
s1 --> b1 --> | --> d1
| <-> storage1
s2a -->|--> b2 --> | --> d2
s2b -->| | <-> storage2
... | oemof/examples | oemof_examples/oemof.solph/v0.4.x/shared_limit/shared_limit.py | Python | gpl-3.0 | 3,877 |
#!/usr/bin/env python
'''
Master loader for CANON April (Spring) 2021 Campaign
'''
import os
import sys
from datetime import datetime
parentDir = os.path.join(os.path.dirname(__file__), "../")
sys.path.insert(0, parentDir)
from CANON import CANONLoader
import timing
cl = CANONLoader('stoqs_canon_april2021', 'CANON-... | stoqs/stoqs | stoqs/loaders/CANON/loadCANON_april2021.py | Python | gpl-3.0 | 8,768 |
#! /usr/bin/env python
# -*- coding:utf-8 -*-
""" Run radio characterizations on nodes """
import os
import sys
import time
import serial_aggregator
from serial_aggregator import NodeAggregator
FIRMWARE_PATH = "node_radio_characterization.elf"
class RadioCharac(object):
""" Radio Characterization """
def __... | kYc0o/openlab-contiki | appli/iotlab/node_radio_characterization/run_characterization/run_characterization.py | Python | gpl-3.0 | 5,885 |
# -*- coding: UTF-8 -*-
"""
Lastship Add-on (C) 2017
Credits to Exodus and Covenant; our thanks go to their creators
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 versio... | lastship/plugin.video.lastship | resources/lib/sources/de/__init__.py | Python | gpl-3.0 | 1,043 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from odoo import fields
from odoo.tests.common import TransactionCase
class TestCalendar(TransactionCase):
def setUp(self):
super(TestCalendar, self).setUp()
... | richard-willowit/odoo | addons/calendar/tests/test_calendar.py | Python | gpl-3.0 | 10,554 |
# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import time
from hscommon.util import form... | mahmutf/dupeguru | core/util.py | Python | gpl-3.0 | 2,111 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | t-wissmann/qutebrowser | tests/end2end/features/test_yankpaste_bdd.py | Python | gpl-3.0 | 1,283 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | shtrom/gtg | GTG/tools/keyring.py | Python | gpl-3.0 | 3,089 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('taggit', '0002_auto_20150616_2121'),
]
operations = [
migrations.CreateModel(
name=... | jwhitlock/kuma | kuma/core/migrations/0001_squashed_0004_remove_unused_tags.py | Python | mpl-2.0 | 728 |
import copy
import uuid
from rest_framework.serializers import ValidationError
from django.test import TestCase
from . import fixtures, get_mock_context
from api.serializers.data_objects import DataObjectSerializer, \
FileResourceSerializer
from api.models.data_objects import DataObject
class TestDataObjectSeria... | StanfordBioinformatics/loom | server/loomengine_server/api/test/serializers/test_data_objects.py | Python | agpl-3.0 | 8,202 |
#-*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, eith... | yvaucher/hr | __unported__/hr_policy_accrual/__openerp__.py | Python | agpl-3.0 | 1,961 |
# -*- coding: utf-8 -*-
# Copyright 2021 El Nogal - Pedro Gómez <pegomez@elnogal.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Delivery Routes",
"version": '8.0.1.0.1',
"category": 'Sale',
"description": """Delivery routes""",
"author": 'Pedro Gómez',
"website"... | Comunitea/CMNT_00040_2016_ELN_addons | delivery_route/__openerp__.py | Python | agpl-3.0 | 708 |
"""Chirp bindings."""
import concurrent.futures as fut
import sys
import threading
from _chirp_cffi import ffi, lib
from . import common, const
class ChirpPool(object):
"""TODO Documentation -> async to pool, ccchirp to chirp.
Chirp is message passing with fully automatic connection setup and
cleanup. ... | ganwell/c4irp | chirp/chirp.py | Python | agpl-3.0 | 5,427 |
# -*- coding: utf-8 -*-
"""Tests for LTI Xmodule LTIv2.0 functional logic."""
import datetime
import textwrap
from django.utils.timezone import UTC
from mock import Mock
from xmodule.lti_module import LTIDescriptor
from xmodule.lti_2_util import LTIError
from . import LogicTest
class LTI20RESTResultServiceTest(Logi... | jbassen/edx-platform | common/lib/xmodule/xmodule/tests/test_lti20_unit.py | Python | agpl-3.0 | 17,256 |
import models
from django.contrib import admin
admin.site.register(models.SocialFriendList)
| soplerproject/sopler | social_friends_finder/admin.py | Python | agpl-3.0 | 93 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | bealdav/OCB | addons/product/product.py | Python | agpl-3.0 | 61,896 |
import json
import os.path
import subprocess
import yaml
brokenlist = list()
class YAMLConfig(object):
_config_values = {}
def __init__(self, filename, default_keys={}, strict_mode=False):
self.filename = filename
self.default_keys = default_keys
self.strict_mode = strict_mode
... | alama/PSO2Proxy | proxy/config.py | Python | agpl-3.0 | 5,799 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('third_party_auth', '0007_auto_20170406_0912'),
]
operations = [
migrations.AddField(
model_name='ltiproviderconfig',
name='drop_existing_session',
field=... | eduNEXT/edunext-platform | common/djangoapps/third_party_auth/migrations/0008_auto_20170413_1455.py | Python | agpl-3.0 | 1,439 |
#! /usr/bin/python2.3
import re
import xml.sax
import sys
import string
import os
from resolvemembernames import memberList
######################################################################
# Read wrans count
class WransCount(xml.sax.handler.ContentHandler):
def __init__(self):
self.count={}
de... | openaustralia/publicwhip-matthew | custom/majority/majex.py | Python | agpl-3.0 | 1,918 |
"""
Provides partition support to the user service.
"""
import logging
import random
from eventtracking import tracker
import openedx.core.djangoapps.user_api.course_tag.api as course_tag_api
from xmodule.partitions.partitions import NoSuchUserPartitionGroupError, UserPartitionError
log = logging.getLogger(__name_... | stvstnfrd/edx-platform | openedx/core/djangoapps/user_api/partition_schemes.py | Python | agpl-3.0 | 4,698 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyNvidiaMlPy3(PythonPackage):
"""Python Bindings for the NVIDIA Management Library."""
homepage = "http://... | iulian787/spack | var/spack/repos/builtin/packages/py-nvidia-ml-py3/package.py | Python | lgpl-2.1 | 530 |
##! /usr/bin/env python
# _*_ coding: latin-1 _*_
import os
import jtutil
import jtdom
from jtelem import jtelem
class new(jtelem):
def __init__(self,top=None,left=None,bottom=None,right=None):
jtelem.__init__(self,top,left,bottom,right)
self.choicelist=[]
self.selectedindex=1
de... | mrev11/ccc3 | jt/jtpython/jtlib/jtcombo.py | Python | lgpl-2.1 | 4,135 |
# Requires the following packages
# math/py-matplotlib
# math/py-numpy
import matplotlib.pyplot as plt
import numpy as np
import sys
import re
# set default values
title = 'Input'
ylabel = 'y'
xlabel = 'x'
legend = 'upper left'
#linestyles = ['x', '--', ':', 'o', 'v', 's', '+', '1', '2', '3', '4' ]
linestyles = ['... | vmaffione/rlite | scripts/plot-input.py | Python | lgpl-2.1 | 1,222 |
# Copyright 2014-2015, Tresys Technology, LLC
#
# This file is part of SETools.
#
# SETools is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1 of
# the License, or (at your option) any l... | TresysTechnology/setools | setools/policyrep/context.py | Python | lgpl-2.1 | 2,137 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=E1101
# pylint: disable=W0403
# Copyright (c) 2014-2015, Human Brain Project
# Cyrille Favreau <cyrille.favreau@epfl.ch>
#
# This file is part of RenderingResourceManager
# <https://github.com/BlueBrain/RenderingResourceManager>
#... | favreau/RenderingResourceManager | rendering_resource_manager_service/config/management/rendering_resource_settings_manager.py | Python | lgpl-3.0 | 7,222 |
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.gepetto import Viewer
white=[1.0,1.0,1.0,1.0]
green=[0.23,0.75,0.2,0.5]
yellow=[0.85,0.75,0.15,1]
pink=[1,0.6,1,1]
orange=[1,0.42,0,1]
brown=[0.85,0.75,0.15,0.5]
blue = [0.0, 0.0, 0.8, 1.0]
grey = [0.7,0.7,0.7,1.0]
red = [0.8,0.0,0.0,1.0]
rootJointType = ... | mylene-campana/hpp-rbprm-corba | script/tests/robot_bigStep_STEVE_path.py | Python | lgpl-3.0 | 2,481 |
from os import path
from nose import tools
from tests.functional import single_machine_test
from nixops import backends
parent_dir = path.dirname(__file__)
has_hello_spec = '%s/single_machine_has_hello.nix' % (parent_dir)
rollback_spec = '%s/single_machine_rollback.nix' % (parent_dir)
class TestRollbackRollsback(... | garbas/nixops | tests/functional/test_rollback_rollsback.py | Python | lgpl-3.0 | 968 |
import logging
import libsbml
from odehandling.odewrapper import ODEWrapper
# 18.07.12 td: some idiotic type mismatches for AST identifiers in different libsbml versions
if not type(libsbml.AST_PLUS) == type(1):
libsbml.AST_PLUS = ord(libsbml.AST_PLUS)
if not type(libsbml.AST_MINUS) == type(1):
libsbml.AST_... | CSB-at-ZIB/BioPARKIN | src/odehandling/odegenerator.py | Python | lgpl-3.0 | 24,889 |