code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
""" So we gonna need a way to check quest progress. This might be as simple as checking if Admiral has a Ship or we might have to check if he completed 1-1 4 times while jumping in one leg I have no idea. At first I intended to write a simple function for each Quest, but the Admiral can activate and deactivate stuff a...
KanColleTool/kcsrv
kancolle/__init__.py
Python
mit
564
import os import time from queue import Queue from threading import Thread, Event from fiforeader import FifoReader class StreamReader(FifoReader): def run(self): prev_out = None while not self.stopped(): out = self.read_fifo() if (out != prev_out) and (out is not None): ...
georgejdanforth/pistream
shairportstreamreader.py
Python
unlicense
424
ports_assignment = { "rs1_rs2" : 6004, "rs1_receive_bgp_messages" : 6000 , "rs1_send_mpc_output" : 6001 , "worker_port" : 7760, "rs2_receive_bgp_messages" : 6002, "rs2_send_mpc_output" : 6003, "rs1-preference-channel" : 6005, "rs2-preference-channel" : 6006} #process_assignement = {"rs1" : '192.168.102.2',"rs2" : '192...
huxh10/iSDX
pprs/port_config.py
Python
apache-2.0
397
import numpy as np from unittest import TestCase from qcodes.utils.validators import Numbers, MultiType from pycqed.instrument_drivers import pq_parameters class Test_Custom_Validators(TestCase): def test_NP_NANs(self): nan_val = pq_parameters.NP_NANs() with self.assertRaises(ValueError): ...
DiCarloLab-Delft/PycQED_py3
pycqed/tests/test_pq_parameters.py
Python
mit
906
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, path_list=[ [TestAction.create_vm, 'vm1', ], [TestAction.create_volume, 'volume1', 'flag=scsi'], [TestAction.attach_volume, 'vm1', 'volume1'], ...
zstackio/zstack-woodpecker
integrationtest/vm/multihosts/vm_snapshots/paths/xsky_path45.py
Python
apache-2.0
1,722
import mock from pulp.bindings.search import SearchAPI, Operator, IntOperator, CSVOperator from pulp.common.compat import unittest class TestSearchAPI(unittest.TestCase): def setUp(self): super(TestSearchAPI, self).setUp() self.api = SearchAPI(mock.MagicMock()) self.api.PATH = '/some/path...
ulif/pulp
bindings/test/unit/test_search.py
Python
gpl-2.0
3,255
#! /usr/bin/python # -*- coding: utf-8 -*- import re,time,datetime,sys from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ObjectDoesNotExist from django.conf import settings import django.core.files from django.contrib.auth.models import User from django.contrib.conte...
chiara-paci/baskerville
baskervilleweb/bibliography/management/commands/category_label.py
Python
gpl-3.0
909
def extractRubylikesfoodWordpressCom(item): ''' Parser for 'rubylikesfood.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('lucia', 'Lucia', ...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractRubylikesfoodWordpressCom.py
Python
bsd-3-clause
818
from __future__ import absolute_import, division, print_function, unicode_literals from pyshifu.shifu import Shifu shifu = Shifu() __docformat__ = 'restructuredtext' # Let users know if they're missing any of our hard dependencies hard_dependencies = ("six", ) missing_dependencies = [] for dependency in hard_depend...
ShifuML/pyshifu
pyshifu/__init__.py
Python
apache-2.0
626
# -*- coding: utf-8 -*- from website.util import rubeus from ..api import Figshare def figshare_hgrid_data(node_settings, auth, parent=None, **kwargs): node = node_settings.owner if node_settings.figshare_type == 'project': item = Figshare.from_settings(node_settings.user_settings).project(node_sett...
kushG/osf.io
website/addons/figshare/views/hgrid.py
Python
apache-2.0
979
# -*- coding: utf-8 -*- # Copyright 2021 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 o...
sasha-gitg/python-aiplatform
tests/unit/aiplatform/test_uploader.py
Python
apache-2.0
59,170
# Copyright 2012 Nebula, Inc. # # 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...
HybridF5/nova
nova/api/openstack/compute/flavor_rxtx.py
Python
apache-2.0
2,097
""" Dynamic host file management. """ import docker from subprocess import call import re from config import config def refresh(): """ Ensure that all running containers have a valid entry in /etc/hosts. """ if config.manage_dnsmasq == 'yes': containers = docker.containers() hosts = '\...
iamdork/dork
dork/dns.py
Python
mit
905
""" Grade book view for instructor and pagination work (for grade book) which is currently use by ccx and instructor apps. """ import math from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import transaction from django.views.decorators.cache import cache_control f...
pepeportela/edx-platform
lms/djangoapps/instructor/views/gradebook_api.py
Python
agpl-3.0
4,464
from itertools import product import numpy as np from sympy import And import pytest from conftest import skipif, opts_tiling from devito import (ConditionalDimension, Grid, Function, TimeFunction, SparseFunction, # noqa Eq, Operator, Constant, Dimension, SubDimension, switchconfig, ...
opesci/devito
tests/test_dimension.py
Python
mit
47,982
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Unit tests for the `corpora.Dictionary` class. """ from collections import Mapping import logging import tempfile import unittest import os import os.path import scipy import gensim from ge...
krishna11888/ai
third_party/gensim/gensim/test/test_corpora_dictionary.py
Python
gpl-2.0
9,161
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('usuario', '0001_initial'), ] operations = [ migrations.CreateModel( name='UsuarioPendente', fields=[...
ongame-entretenimento/cadastro
usuario/migrations/0002_usuariopendente.py
Python
mit
1,268
from django.db import models class Event(models.Model): timestamp = models.DateTimeField(auto_now_add=True) name = models.CharField(max_length=255, db_index=True) full_data = models.TextField(blank=True, default=u"") class EventField(models.Model): event = models.ForeignKey(Event, on_delete=models....
thraxil/countryx
countryx/events/models.py
Python
gpl-3.0
442
# Copyright (c) 2015-2017 Cisco Systems, Inc. # # 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...
kharkevich/molecule
test/unit/dependency/test_ansible_galaxy.py
Python
mit
6,896
import re import sqlite3 import csv import os import sys import xlrd import fnmatch import datetime import win32com.client PATH_DICT = { "pos_dir": "\\\\p7fs0003\\nd\\3033-Horizon-FA-Share\\PB_DeltaOne\\Daily_Data", "sbl_dir": "S:\\SBL\\Reports\\Daily SBL Report\\ReportData", "os_file": "OS_Trades_Extract_...
frederick623/HTI
sbl_daily_report/sbl_short_recon.py
Python
apache-2.0
7,865
import serial import sys import glob import time from typing import * from manager import Dispatcher, Writeable class SerialManager: """Manages recieving data from a serial port and passes it to a Dispatcher.""" ports: Dict[str, serial.Serial] = {} paused = False def __init__(self, ...
LPRD/TelemetryController
src/serialmanager.py
Python
gpl-3.0
3,207
from __future__ import annotations import shutil import typing import weakref from pathlib import Path from typing import IO, Any, Dict, Optional, Set, Union from uuid import UUID, uuid1 import sqlalchemy as sa import sqlalchemy.event from flask import _app_ctx_stack from flask.globals import _lookup_app_object from ...
abilian/abilian-core
src/abilian/services/repository/service.py
Python
lgpl-2.1
15,540
from collections import namedtuple from enum import Enum, unique from .database import Database, convert_datetime from .relation import Relation from .utils import from_card_list, make_card_list class PlayersRelation(Relation): NAME = 'players' FIELDS = ['table_id', 'position', 'name', 'balance', 'cards', '...
MartinAltmayer/pokerserver
pokerserver/database/players.py
Python
gpl-3.0
5,335
import unittest class MyTest(unittest.TestCase): def test(self): self.assertEqual(4, 4)
manjitkumar/drf-url-filters
filters/tests/tests.py
Python
mit
102
import unittest from nose2 import events, loader, session from nose2.plugins.loader import functions from nose2.tests._common import TestCase class TestFunctionLoader(TestCase): def setUp(self): self.session = session.Session() self.loader = loader.PluggableTestLoader(self.session) self.p...
ptthiem/nose2
nose2/tests/unit/test_functions_loader.py
Python
bsd-2-clause
1,464
# 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, software # d...
openstack/heat-translator
translator/hot/tests/test_translate_outputs.py
Python
apache-2.0
2,136
""" Analyze is a script to access the plugins which analyze a gcode file. An explanation of the gcodes is at: http://reprap.org/bin/view/Main/Arduino_GCode_Interpreter A gode example is at: http://forums.reprap.org/file.php?12,file=565 """ from __future__ import absolute_import #Init has to be imported first becaus...
natetrue/ReplicatorG
skein_engines/skeinforge-0006/skeinforge_tools/analyze.py
Python
gpl-2.0
3,304
# VMware vSphere Python SDK # Copyright (c) 2008-2015 VMware, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
alexkolar/pyvmomi
tests/test_iso8601.py
Python
apache-2.0
4,117
#!/usr/bin/python # Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
gkc1000/pyscf
pyscf/pbc/gto/basis/split_HFX_BASIS.py
Python
apache-2.0
1,647
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource f...
twilio/twilio-python
twilio/rest/pricing/v2/country.py
Python
mit
10,935
import datetime as dt import os import sys import time sys.path.insert(0, os.path.abspath(os.path.join("..", "src"))) import apispec # noqa: E402 extensions = [ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", "sphinx.ext.todo", "sphinx_issues", ] primary_domain = "py" defa...
marshmallow-code/apispec
docs/conf.py
Python
mit
1,296
# Copyright (C) 2008-2009 Open Society Institute # Thomas Moroz: tmoroz.org # 2010-2011 Large Blue # Fergus Doyle: fergus.doyle@largeblue.com # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License Version ...
amarandon/opencore
opencore/views/adapters.py
Python
gpl-2.0
8,979
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # 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 o...
ProfessionalIT/professionalit-webiste
sdk/google_appengine/google/appengine/tools/bulkloader.py
Python
lgpl-3.0
137,406
# 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 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
kenorb/BitTorrent
python_bt_codebase_library/test_sparse_set.py
Python
gpl-3.0
9,404
def extractBcnovelsCom(item): ''' Parser for 'bcnovels.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None if 'Manga' in item['tags']: return None tagmap = [ ('When the Protagonist of a Fanfiction', ...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractBcnovelsCom.py
Python
bsd-3-clause
1,335
# Copyright 2010 Steven Robertson # # 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 module will provide a unif...
quodlibet/quodlibet
quodlibet/qltk/notif.py
Python
gpl-2.0
10,466
input = """ 1 2 0 0 1 3 0 0 1 4 0 0 1 5 0 0 1 6 0 0 1 7 0 0 1 8 0 0 1 9 0 0 1 10 0 0 1 11 0 0 1 12 0 0 1 13 0 0 1 14 0 0 1 15 0 0 1 16 0 0 1 17 0 0 1 18 0 0 1 19 0 0 1 20 0 0 1 21 0 0 1 22 0 0 1 23 0 0 1 24 0 0 1 25 0 0 1 26 0 0 1 27 0 0 1 28 0 0 1 29 0 0 1 30 0 0 1 31 0 0 1 32 0 0 1 33 0 0 1 34 0 0 1 35 0 0 1 36 0 0 1...
Yarrick13/hwasp
tests/asp/AllAnswerSets/tight/graph.colouring.3.40.5_6.asp.test.py
Python
apache-2.0
24,011
import os from setuptools import setup, find_packages import warnings setup( name='cloud-compose-mongo', version='0.1.4', packages=find_packages(), include_package_data=True, install_requires=[ 'click>=6.6', 'boto3>=1.3.1', 'botocore>=1.4.14', 'docutils>=0.12', ...
cloud-compose/cloud-compose-mongo
setup.py
Python
mit
1,106
""" Unit tests for nyx. """ import collections import inspect import time import unittest import nyx.curses from nyx import expand_path, join, uses_settings from mock import patch, Mock __all__ = [ 'arguments', 'curses', 'installation', 'log', 'panel', 'popups', 'tracker', ] OUR_SCREEN_SIZE = None TE...
sammyshj/nyx
test/__init__.py
Python
gpl-3.0
3,850
import sqlite3 conn = sqlite3.connect('factbook.db') import pandas as pd import math df = pd.read_sql_query('select * from facts;', conn) conn.close() print(df.shape) df = df.dropna() print(df.shape) def growth(population,growth_rate): N = population * pow(math.e,(growth_rate /100)*35) return N pop = [] for ind...
vipmunot/Data-Analysis-using-Python
SQL and Databases Begineer/Working with a SQLite database/growth.py
Python
mit
562
import struct from datetime import datetime, timedelta from ipv8.database import database_blob from ipv8.keyvault.crypto import default_eccrypto from ipv8.messaging.payload import Payload from ipv8.messaging.serialization import default_serializer from tribler_core.exceptions import InvalidSignatureException from tri...
hbiyik/tribler
src/tribler-core/tribler_core/modules/metadata_store/serialization.py
Python
lgpl-3.0
16,048
info = { "name": "sw", "date_order": "DMY", "january": [ "jan", "januari" ], "february": [ "feb", "februari" ], "march": [ "mac", "machi" ], "april": [ "apr", "aprili" ], "may": [ "mei" ], "june":...
scrapinghub/dateparser
dateparser/data/date_translation_data/sw.py
Python
bsd-3-clause
4,155
# -*- coding: utf-8 -*- from ..base import * # noqa build_column('idmen', IntCol(is_permanent = True, label = u"Identifiant du ménage")) build_column('idfoy', IntCol(is_permanent = True, label = u"Identifiant du foyer")) build_column('idfam', IntCol(is_permanent = True, label = u"Identifiant de la famille")) build...
adrienpacifico/openfisca-france
openfisca_france/model/caracteristiques_socio_demographiques/demographie.py
Python
agpl-3.0
9,098
#!/usr/bin/env python """ MAVProxy message console, implemented in a child process """ import multiprocessing, threading import textconsole, sys, time from wxconsole_util import Value, Text class MessageConsole(textconsole.SimpleConsole): ''' a message console for MAVProxy ''' def __init__(self, ...
upliftaero/MAVProxy
MAVProxy/modules/lib/wxconsole.py
Python
gpl-3.0
3,150
"""Simple wrapper over libtorrent""" from urllib.parse import quote import tempfile import os import asyncio import logging import mimetypes from collections import namedtuple from functools import cached_property from random import randint import libtorrent as lt mimetypes.init() logging.basicConfig(level=logging.IN...
XayOn/torrentstream
torrentstream/torrent.py
Python
isc
10,010
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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 3 of the License, or # (at your option) any later version. # # PySCAP is ...
cjaymes/pyscap
src/scap/model/oval_5/sc/linux/SeLinuxBooleanItemElement.py
Python
gpl-3.0
1,241
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2021 PyMeasure Developers # # 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 limit...
ralph-group/pymeasure
pymeasure/instruments/deltaelektronika/sm7045d.py
Python
mit
4,897
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def config_eventdefaultperms(apps, schema_editor): db_alias = schema_editor.connection.alias Config = apps.get_model('ngw', 'Config') Config.objects.using(db_alias).bulk_create([ Config( i...
nirgal/ngw
core/migrations/0009_config_eventdefaultperms.py
Python
bsd-2-clause
613
"""Test on deps, data, requires and provides.""" import os import subprocess import unittest class DataDepTest(unittest.TestCase): def test_direct_dep(self): """Test that we can import the module directly.""" from test.python_rules import data_dep self.assertEqual(42, data_dep.the_answer...
thought-machine/please
test/python_rules/data_dep_test.py
Python
apache-2.0
577
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import super...
petrjasek/superdesk-core
apps/duplication/archive_copy.py
Python
agpl-3.0
3,272
import os import tempfile import unittest import shutil from mcpartools import generatemc class TestRunGenerate(unittest.TestCase): def setUp(self): self.main_dir = os.path.join("tests", "res") def test_help(self): try: generatemc.main(["--help"]) except SystemExit as e...
DataMedSci/mcpartools
tests/test_generatemc.py
Python
gpl-3.0
2,687
# 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 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
kenorb/BitTorrent
BitTorrent/DownloadRateLimiter.py
Python
gpl-3.0
4,752
# vim: tabstop=4 shiftwidth=4 softtabstop=4 import inspect import webob from nova.api.openstack import wsgi from nova import exception from nova.openstack.common import gettextutils from nova import test from nova.tests.api.openstack import fakes from nova.tests import utils class RequestTest(test.NoDBTestCase): ...
TieWei/nova
nova/tests/api/openstack/test_wsgi.py
Python
apache-2.0
42,364
from __future__ import absolute_import, division, unicode_literals import argparse import sys import time import config import packages import index def _stopwatch(start_time): return "Done. Time elapsed in seconds: " + unicode(time.time() - start_time) def _download(): start_time = time.time() print "S...
johannes-gehrs/centos_packages
manage.py
Python
mit
2,624
""" Here we will construct a cleaner version of openruniec.py. It will simply read a table of run cases and run them. """ # main python driver to run wind load cases in a variety of ways, uses openMDAO from openmdao.main.api import Assembly, Component from openmdao.main.datatypes.slot import Slot from openmdao.lib....
FUSED-Wind/fusedwind
src/fusedwind/runSuite/runBatch.py
Python
apache-2.0
23,194
""" Synchronizes the announcement list with all active students. """ import logging from django.contrib.auth.models import User from django.core.management.base import BaseCommand from .mailchimp_sync_course import connect_mailchimp, get_cleaned, get_subscribed, get_unsubscribed, subscribe_with_data log = logging....
cpennington/edx-platform
lms/djangoapps/mailing/management/commands/mailchimp_sync_announcements.py
Python
agpl-3.0
2,248
import os from snovault import DBSESSION from contextlib import contextmanager from multiprocessing import get_context from multiprocessing.pool import Pool from pyramid.decorator import reify from pyramid.request import apply_request_extensions from pyramid.threadlocal import ( get_current_request, manager, ) ...
ENCODE-DCC/snovault
src/snovault/elasticsearch/mpindexer.py
Python
mit
5,839
# -*- coding: utf8 -*- from __future__ import unicode_literals import random from calendar import monthrange from datetime import datetime, timedelta from hashlib import md5 from django.conf import settings from django.contrib.auth import get_user_model from django.core import mail from django.core.exceptions import ...
coffeestats/coffeestats-django
coffeestats/caffeine/tests/test_models.py
Python
mit
30,534
# This file is part of MyPaint. # Copyright (C) 2014 by Andrew Chadwick <a.t.chadwick@gmail.com> # # 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 ...
mypaint/mypaint
gui/drawutils.py
Python
gpl-2.0
18,531
from __future__ import division, absolute_import, print_function import os from drawBot.misc import executeExternalProcess, getExternalToolPath def generateMP4(imageTemplate, mp4path, frameRate, codec="libx264"): ffmpegPath = getExternalToolPath(os.path.dirname(__file__), "ffmpeg") assert ffmpegPath is not ...
schriftgestalt/drawbot
drawBot/context/tools/mp4Tools.py
Python
bsd-2-clause
867
#!/usr/bin/python # # Copyright (c) 2016 Sertac Ozercan, <seozerca@microsoft.com> # # 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 = {'metadata_version': '1.1', ...
alxgu/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualmachinescaleset.py
Python
gpl-3.0
46,590
"""Microsoft Internet Explorer cookie loading on Windows. Copyright 2002-2003 Johnny Lee <typo_pl@hotmail.com> (MSIE Perl code) Copyright 2002-2006 John J Lee <jjl@pobox.com> (The Python port) This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the ...
openhatch/oh-mainline
vendor/packages/mechanize/mechanize/_msiecookiejar.py
Python
agpl-3.0
14,694
""" models for exchange rates app. """ import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ class Exchange(models.Model): """ Exchange rate table for USD and EURO. Exchange is based on EURO, thus default value of euro is 1.0 """ usd = models.Decimal...
chhantyal/exchange
uhura/exchange/models.py
Python
bsd-3-clause
1,123
# -*- coding: utf-8 -*- """ rater.utils.ctxlocal ~~~~~~~~~~~~~~~~~~~~~ The context local that is used in the application and i18n system. The application makes this request-bound. :copyright: (c) 2009 by Rater Team (c) 2009 by Plurk Inc., see AUTHORS for more details. :license...
amadev/rater
rater/utils/ctxlocal.py
Python
bsd-3-clause
877
#!/usr/bin/env python #coding=utf8 # Copyright (C) 2010-2014 GRNET S.A. # # 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 3 of the License, or # (at your option) any later versio...
cstavr/synnefo
snf-pithos-app/pithos/api/test/objects.py
Python
gpl-3.0
86,372
#!/usr/bin/env python3 # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. # # 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...
matthewrmshin/cylc
lib/cylc/wallclock.py
Python
gpl-3.0
10,739
#!/usr/bin/env python3 import fluidity.diagnostics.annulus_mesh as annulus_mesh import fluidity.diagnostics.triangletools as triangletools coordsY = annulus_mesh.SliceCoordsLinear(0.0, 1.0, 0.01, 20) coordsX = annulus_mesh.SliceCoordsLinear(0.0, 1.0, 0.01, 20) mesh = annulus_mesh.GenerateRectangleMesh(coordsX, coords...
FluidityStokes/fluidity
tests/Stokes_square_convection_1e4_p2p1/src/generate_mesh.py
Python
lgpl-2.1
386
#!/usr/bin/env python # This is an example of how to control the Delcom USBLMP 904x device # # Copyright (c) 2021 Aaron Linville <aaron@linville.org> import argparse import delcom904x def setup_argparse(): parser = argparse.ArgumentParser( description="Control the Delcom USBLMP 904x visual signal indica...
linville/delcom904x
control_delcom904x.py
Python
isc
2,457
#!/usr/bin/env python # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import argparse import logging import mimetypes import os import re import subprocess import sys...
endlessm/chromium-browser
third_party/webxr_test_pages/update_bucket.py
Python
bsd-3-clause
12,777
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from xml.parsers.expat import ParserCreate class DefaultSaxHandler(object): def start_element(self, name, attrs): print('sax:start_element: %s, attrs: %s' % (name, str(attrs))) def end_element(self, name): print('sax:end_element: %s' % name) ...
whyDK37/py_bootstrap
samples/commonlib/use_sax.py
Python
apache-2.0
739
#!/usr/bin/python # Copyright 2010 Matt Rudary # # 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 t...
ruds/evelib
combat_logs/log_parser.py
Python
apache-2.0
13,402
# # Copyright (c) 2012 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 of...
vritant/subscription-manager
test/test_rhsm_debug_command.py
Python
gpl-2.0
11,036
from os.path import join, dirname, abspath # # IMPORTANT: must be albe to run under python 2.4 # #: path to Encyclopedia sources root ROOT_DIR = abspath(join(dirname(__file__), "..")) DEST = join(ROOT_DIR, "build") DEST_CHM = join(DEST, "chm") BUILD_CHM_LOG = join(DEST, "tool.make_chm.lo...
data-man/FarAS
enc/tools/config.inc.py
Python
bsd-3-clause
415
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import pyauto_functional import pyauto import webrtc_test_base class MediaStreamInfobarTest(webrtc_test_base.WebrtcTestBase): "...
plxaye/chromium
src/chrome/test/functional/media_stream_infobar.py
Python
apache-2.0
3,390
import collections from .dumpdata.messages import SongDumpSection, RegDumpSection from .util import YAMAHA from .mido_util import writeout_bytes def filter_yamaha_sysex(messages): return (m for m in messages if m.type == 'sysex' and m.data[0] == YAMAHA) class DgxDump(object): # Object-Orientation? # Mo...
hschh86/usersong-extractor
commons/dgxdump.py
Python
mit
1,338
# 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, software # distributed under t...
openstack/senlin
senlin/conf/notification.py
Python
apache-2.0
1,239
# -*- coding: utf-8 -*- ############################################################################## # # This module is copyright (C) 2013 Numérigraphe SARL. 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...
factorlibre/stock-logistics-warehouse
stock_inventory_location/wizard/stock_fill_location_inventory.py
Python
agpl-3.0
1,934
""" Sensor for retrieving latest GitLab CI job information. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.gitlab_ci/ """ from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM...
HydrelioxGitHub/home-assistant
homeassistant/components/sensor/gitlab_ci.py
Python
apache-2.0
6,065
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-07 15:44 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('thresher', '0001_initial'), ] operations = [ migrations.AlterField( ...
Goodly/TextThresher
thresher/migrations/0002_auto_20170607_1544.py
Python
apache-2.0
473
# -*- coding: utf-8 -*- import json import shutil from django.core.files.storage import default_storage as storage import mock import waffle from pyquery import PyQuery as pq from olympia import amo from olympia.addons.models import Addon, AddonUser from olympia.amo.tests import TestCase from olympia.amo.tests.test...
atiqueahmedziad/addons-server
src/olympia/devhub/tests/test_views_validation.py
Python
bsd-3-clause
22,651
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
batxes/4Cin
Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/mtx1_models/Six_mouse_models23222.py
Python
gpl-3.0
18,215
#!/usr/bin/env python # -*- coding: utf-8 -*- # Time-stamp: <2011-10-28 15:13:31 aw> import sys import os import logging import feedparser import calendar import time import re from lib.reader import CommonReader from lib.orgproperty import OrgProperties from lib.orgformat import OrgFormat from lib.memacs import Memac...
dwinters42/Memacs
memacs/rss.py
Python
gpl-3.0
4,408
######################################################################## # File name: xso.py # This file is part of: aioxmpp # # LICENSE # # This program 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, ...
horazont/aioxmpp
aioxmpp/version/xso.py
Python
lgpl-3.0
1,795
# coding: utf-8 """ Kubeflow Pipelines API This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. Contact: kubeflow-pipelines@google.com Generated by: https://openapi-generator.tech """ from setuptools import setup, find_packages # ...
kubeflow/pipelines
backend/api/python_http_client/setup.py
Python
apache-2.0
1,190
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the # RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of c...
pierrelb/RMG-Py
rmgpy/pdep/collisionTest.py
Python
mit
4,609
# -*- coding: utf-8 -*- from django.conf.urls import patterns, url, include from django.test import TestCase from django.views.generic import View from djangular.core.urlresolvers import get_url_patterns # This is now deprecated way of reversing django urls in angular code, but both old tests and code should be # kep...
dongguangming/django-angular
examples/server/tests/test_urlreversers.py
Python
mit
3,501
#!/usr/bin/python # arxiv2md.py: fetch the latest arXiv listings and transform them to markdown # Copyright (C) 2014 Micha Moskovic # 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 r...
michamos/vim-arxivist
arxiv2md.py
Python
mit
3,198
from setuptools import setup, find_packages setup( name = "pymug", version = "0.1-dev", url = 'http://www.fort-awesome.net/wiki/Pymug', license = 'MIT', description = "A simple SmugMug wrapper", author = 'Erik Karulf <erik@karulf.com>', # Below this line is tasty Kool-Aide provided by the C...
ekarulf/python-smugmug
setup.py
Python
mit
438
def pitagoras_quad(coordenada): return coordenada[0] ** 2 + coordenada[1] ** 2 def pitagoras(coordenada): return pitagoras_quad(coordenada)**0.5 def coords_delta(coord_a, coord_b): delta = [] delta.append(coord_a[0] - coord_b[0]) delta.append(coord_a[1] - coord_b[1]) return delta def coord...
jeffque/circle-quest-squareland
elements/geometry.py
Python
unlicense
969
from ..compat import str, sh, pbs_compat from ..utils import RingBuffer from threading import Lock import os import time import tempfile class StreamType: AHS=0 HLS=1 HTTP=2 RTMP=3 class StreamError(Exception): pass class Stream(object): """ This is a base class that should be inheri...
derekzhang79/livestreamer
src/livestreamer/stream/__init__.py
Python
bsd-2-clause
3,873
""" Copyright 2017 Pani Networks Inc. 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, soft...
romana/vpc-router
vpcrouter/tests/test_main.py
Python
apache-2.0
5,182
from django import forms from django.db.models import get_model from django.contrib.auth.forms import AuthenticationForm from django.utils.translation import ugettext_lazy as _ from oscar.apps.address.forms import AbstractAddressForm from oscar.apps.customer.utils import normalise_email from oscar.core.compat import g...
elliotthill/django-oscar
oscar/apps/checkout/forms.py
Python
bsd-3-clause
2,746
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public t...
antoine-de/navitia
source/jormungandr/jormungandr/interfaces/v1/StatedResource.py
Python
agpl-3.0
2,542
# # lasgrid.py # # (c) 2013, martin isenburg - http://rapidlasso.com # rapidlasso GmbH - fast tools to catch reality # # uses lasgrid.exe to grid a LiDAR file # # LiDAR input: LAS/LAZ/BIN/TXT/SHP/BIL/ASC/DTM # raster output: BIL/ASC/IMG/TIF/DTM/PNG/JPG # # for licensing see http://lastools.org/LICENSE.txt # impo...
DURAARK/duraark-pointcloud-viewer
lastools/ArcGIS_toolbox/scripts/lasgrid.py
Python
mit
5,382
# Copyright (C) 2014 Universidad Politecnica de Madrid # # 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 la...
ging/horizon
openstack_dashboard/dashboards/idm/users/tables.py
Python
apache-2.0
2,558
def cavity(l,n): for i in xrange(1,n-1): for j in xrange(1,n-1): if l[i-1][j]!='X' and l[i][j-1]!='X' and l[i+1][j]!='X' and l[i][j+1]!='X' and l[i][j]>l[i-1][j] and l[i][j]>l[i+1][j] and l[i][j]>l[i][j-1] and l[i][j]>l[i][j+1]: l[i][j]='X' if __name__ == '__main__': n = inp...
arriqaaq/hackerrank
Algo- Warmup/cavity-rank.py
Python
apache-2.0
508
import grequests import json class ApiClient(object): def songs(self, album=None, artist=None, instances=[]): if album is not None: songs = self.request('song', {'album': album}, instances) elif artist is not None: songs = self.request('song', {'artist': artist}, instances)...
Ganapati/DjangoZik
api/client.py
Python
gpl-2.0
3,692
from dataclasses import dataclass import pandas as pd import datetime from syscore.pdutils import listOfDataFrames @dataclass class fitDates(object): fit_start: datetime.datetime fit_end: datetime.datetime period_start: datetime.datetime period_end: datetime.datetime no_data: bool = False de...
robcarver17/pysystemtrade
sysquant/fitting_dates.py
Python
gpl-3.0
5,805
from __future__ import absolute_import from __future__ import print_function from django.core.management.base import BaseCommand import sys from zerver.lib.actions import do_deactivate_realm from zerver.models import get_realm class Command(BaseCommand): help = """Script to deactivate a realm.""" def add_a...
dwrpayne/zulip
zerver/management/commands/deactivate_realm.py
Python
apache-2.0
789
#!/usr/bin/python # -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Copyright (c) 2012 Michael Hull. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are m...
mikehulluk/morphforge
src/morphforge/simulation/base/result/simulationresult.py
Python
bsd-2-clause
3,355