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 |
|---|---|---|---|---|---|
import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from tarl import *
import time
import fractions
import subprocess
#ffmpeg_loc="/Users/atyndall/Dropbox/ash-honours/macffmpeg/ffmpeg"
ffmpeg_loc="d:\\Users\\atyndall\\Documents\\ffmpeg-20140703-git-1265247-win64-static\\bin\... | atyndall/tarl | processing/utils/cap_conv_synced.py | Python | gpl-3.0 | 863 |
#/usr/bin/env python3
__author__ = 'Taio'
import os
import sys
fname = sys.argv[0]
def list_cwd():
return os.listdir(os.getcwd())
def files_cwd():
return [p for p in list_cwd() if os.path.isfile(p)]
def folders_cwc():
return [p for p in list_cwd() if os.path.isdir(p)]
def list_py(path = None):
... | jiasir/sys-management-scripts | python-scripts/list.py | Python | gpl-3.0 | 742 |
#!/usr/bin/env python
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU ... | hurlebouc/GDuplicity | Duplicity/duplicity-0.6.22/setup.py | Python | gpl-3.0 | 3,233 |
from mbuild.box import Box
from mbuild.coarse_graining import coarse_grain
from mbuild.coordinate_transform import *
from mbuild.compound import *
from mbuild.pattern import *
from mbuild.packing import *
from mbuild.port import Port
from mbuild.recipes import *
from mbuild.lattice import Lattice
from mbuild.version i... | ctk3b/mbuild | mbuild/__init__.py | Python | mit | 334 |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
import os
import random
import numpy as np
import ray
from ray.tune import Trainable, run, Experiment, sample_from
from ray.tune.schedulers import HyperBandS... | atumanov/ray | python/ray/tune/examples/hyperband_example.py | Python | apache-2.0 | 2,233 |
# Copyright 2014 Deutsche Telekom AG
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | vmahuli/tempest | tempest/tests/negative/test_negative_generators.py | Python | apache-2.0 | 5,461 |
#!/usr/bin/env python3
# Copyright 2021 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.
# This is generated, do not edit. Update BuildConfigGenerator.groovy and
# 3ppFetch.template instead.
import argparse
import json
imp... | chromium/chromium | third_party/android_deps/libs/com_android_support_documentfile/3pp/fetch.py | Python | bsd-3-clause | 2,497 |
# -*- coding: utf-8 -*-
"""Date data and manipulation module."""
#
# (C) Rob W.W. Hooft, 2003
# (C) Daniel Herding, 2004
# (C) Ævar Arnfjörð Bjarmason, 2004
# (C) Andre Engels, 2004-2005
# (C) Yuri Astrakhan, 2005-2006 (<Firstname><Lastname>@gmail.com)
# (years/decades/centuries/millenniums str <=> int conver... | xZise/pywikibot-core | pywikibot/date.py | Python | mit | 124,134 |
import sys
from twisted.internet import reactor
from twisted.python import log
from twisted.web import resource, server, static
from txsockjs.factory import SockJSResource
log.startLogging(sys.stdout)
from webmux.handlers import Signup, Login, Logout, Home
from webmux.protocols import TerminalFactory
from webmux.use... | kradalby/webmux | webmux/main.py | Python | mit | 1,464 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', ... | westurner/web.sh | setup.py | Python | bsd-3-clause | 1,757 |
class MessageHandle(object):
"""
根据气象信息提供建议信息。
"""
def __init__(self):
pass
def draw_data(self):
pass
@classmethod
def remind_extreme_temperature(cls, temperature_today):
"""
极端天气提醒
:param temperature_today:List[摄氏度]
:return:极端天气提醒
"... | auroraeffect/forecast_bot | bot/message_handle.py | Python | mit | 3,075 |
from django.core import serializers
from django.template import Library
from django.utils.safestring import mark_safe
register = Library()
@register.filter(is_safe=True)
def as_json(object, *args, **kargs):
return mark_safe(serializers.serialize('json', [object], *args, **kargs)[1:-1])
| IntersectAustralia/asvo-tao | web/tao/templatetags/json_filter.py | Python | gpl-3.0 | 294 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | xuleiboy1234/autoTitle | tensorflow/tensorflow/compiler/tests/unary_ops_test.py | Python | mit | 15,387 |
class AsyncIterator(AsyncIterable):
@abstractmethod
async def __anext__(self):
raise StopAsyncIteration
| siosio/intellij-community | python/testData/psi/unified/AsyncDefWithDecorator.py | Python | apache-2.0 | 120 |
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | salv-orlando/MyRepo | nova/tests/api/openstack/test_urlmap.py | Python | apache-2.0 | 3,517 |
#!/usr/bin/env python
#
# Copyright 2008, Google 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 copyright
# notice, this list... | apkbox/nano-rpc | third_party/googlemock/src/scripts/gmock_doctor.py | Python | bsd-3-clause | 22,935 |
# coding: utf-8
'''
Django模板引擎的自定义过滤器,需要在模板中引用
{% load forum_extras %}
'''
import json, re, random
from datetime import date, datetime
from django import template
from django.utils import timezone
from markdown import markdown
register = template.Library()
@register.filter(name='dump_errors')
def dump_errors(err... | michaelyou/One-piece-forum | forum/templatetags/forum_extras.py | Python | mit | 5,795 |
# -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | goose3/goose | tests/test_metas.py | Python | apache-2.0 | 1,545 |
#!/usr/bin/env python
__author__ = 'waroquiers'
import unittest
import os
import shutil
from pymatgen.analysis.chemenv.utils.chemenv_config import ChemEnvConfig
from pymatgen import SETTINGS
config_file_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", "..",
'test_... | czhengsci/pymatgen | pymatgen/analysis/chemenv/utils/tests/test_chemenv_config.py | Python | mit | 2,269 |
"""Example of using hangups to get conversation events."""
import hangups
from common import run_example
MAX_REQUESTS = 3
MAX_EVENTS = 5
async def get_events(client, args):
_, conversation_list = await hangups.build_user_conversation_list(client)
try:
conversation = conversation_list.get(args.con... | ddboline/hangups | examples/get_events.py | Python | mit | 1,445 |
from datetime import date
import random
import re
import time
import traceback
from couchpotato import get_db
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import simplifyString
from couchpotato.core.helpers.variable... | koomik/CouchPotatoServer | couchpotato/core/media/movie/searcher.py | Python | gpl-3.0 | 16,792 |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
import functools
from datetime import date, time
from devtools_testutils import recorded_by_proxy, set_bodiless_matcher
from azure.core.exc... | Azure/azure-sdk-for-python | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dac_analyze_prebuilts_from_url.py | Python | mit | 19,225 |
# -*- coding: utf-8 -*-
import time
from ..internal.MultiAccount import MultiAccount
class ZeveraCom(MultiAccount):
__name__ = "ZeveraCom"
__type__ = "account"
__version__ = "0.36"
__status__ = "testing"
__config__ = [("mh_mode", "all;listed;unlisted", "Filter hosters to use", "all"),
... | Arno-Nymous/pyload | module/plugins/accounts/ZeveraCom.py | Python | gpl-3.0 | 2,379 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('complementos', '0001_initial'),
('personas', '0001_initial'),
]
operations = [
migrations.CreateModel(
n... | montenegroariel/sigos | apps/afiliados/migrations/0001_initial.py | Python | gpl-3.0 | 1,514 |
import numpy as np
from theano.tensor.shared_randomstreams import RandomStreams
from matplotlib import pyplot
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers.embeddings import Embedding
from keras.datasets impor... | asazo/ANN | tarea3/Pregunta2/model_8000.py | Python | mit | 1,315 |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.town.DDTownLoader
from toontown.town import DDStreet, TownLoader
class DDTownLoader(TownLoader.TownLoader):
def __init__(self, hood, parentFSM, doneEvent):
TownLoader.TownLoader.__init__(self, hood, parentFSM, doneEvent)
se... | DedMemez/ODS-August-2017 | town/DDTownLoader.py | Python | apache-2.0 | 678 |
#!/usr/bin/env python
'''
test.test_wind_flags
Tests for Flag Setting and Checking for In-situ temperature and salinity
'''
from ioos_qartod.flags import QARTODEval
from ioos_qartod.flags.temp_salinity import *
import numpy as np
import unittest
class TestWindFlags(unittest.TestCase):
def setUp(self):
... | brian-smith723/QARTOD | test/test_temp_salinity.py | Python | apache-2.0 | 12,973 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, _
import threading
class Picking(models.Model):
_inherit = 'stock.picking'
def _pre_action_done_hook(self):
res = super()._pre_action_done_hook()
if res is True and no... | ygol/odoo | addons/stock_sms/models/stock_picking.py | Python | agpl-3.0 | 2,845 |
# coding:utf-8
# Python Requriement:3(For Chinese Characters read purpose only)
# Made by EnderSodium ender@enderself.co
# 第 0011 题: 敏感词文本文件 filtered_words.txt,里面的内容为以下内容,当用户输入敏感词语时,则打印出 Freedom,否则打印出 Human Rights。
class filtered(object):
# Read from txt file.
def _init_(self):
global filtered_words
filtered_tem... | snailwalker/python | endersodium/0011/censor.py | Python | mit | 918 |
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | simsa-st/contest24 | templates/stepan-m24/.ycm_extra_conf.py | Python | mit | 6,500 |
STATUS_CHOICES = (
("New", "New"),
("In Progress", "In Progress"),
("Completed", "Completed"),
)
PRIORITY_CHOICES = (("Low", "Low"), ("Medium", "Medium"), ("High", "High"))
| MicroPyramid/Django-CRM | tasks/utils.py | Python | mit | 186 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pppcemr', '0031_auto_20151110_1404'),
]
operations = [
migrations.AddField(
model_name='task',
name=... | sstebbins/pppcpro | pppcemr/migrations/0032_task_treatment.py | Python | agpl-3.0 | 434 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import Flask, render_template, request, session
import pkg_resources
import sys
import os
import logging
import matplotlib
matplotlib.use('TkAgg') # Changes the matplotlib framework
import utils.dave_endpoint as DaveEndpoint
import utils.dataset_cache as DsCache
... | StingraySoftware/dave | src/main/python/server.py | Python | apache-2.0 | 14,987 |
# -*- coding: utf-8 -*-
"""Routes for the owncloud addon.
"""
from framework.routing import Rule, json_renderer
from website.routes import OsfWebRenderer
from . import views
# Routes that use the web renderer
web_routes = {
'rules': [
##### View file #####
# Rule(
# [
# ... | kwierman/osf.io | website/addons/owncloud/routes.py | Python | apache-2.0 | 2,025 |
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('datasets', parent_package, top_path)
config.add_subpackage('volumes')
config.add_subpackage('transforms')
return config
if __name__ == '__main__':
from numpy.distuti... | yarikoptic/NiPy-OLD | nipy/neurospin/datasets/setup.py | Python | bsd-3-clause | 390 |
# Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | 0xdyu/RouteFlow-Exodus | pox/pox/lib/graph/nom.py | Python | apache-2.0 | 4,353 |
import time
import numpy as np
from Little import solve_tsp
from utils import read_graph_matrix, draw_graph_with_path
if __name__ == '__main__':
m = read_graph_matrix('lab5.in')
out = file('report.md', 'w')
out.write('# lab5\nPazhitnykh Ivan\n\n* Solve **Travelling Salesman Problem**, with matrix:\n')
... | Drapegnik/bsu | decision-science/lab5/main.py | Python | mit | 1,126 |
from plotly.graph_objs import Isosurface
| plotly/python-api | packages/python/plotly/plotly/graph_objs/layout/template/data/_isosurface.py | Python | mit | 41 |
from flask import Blueprint
user = Blueprint(
'user',
__name__,
template_folder='templates',
static_folder='static',
)
import views
| LiGhT1EsS/PISS | piss/user/__init__.py | Python | gpl-3.0 | 152 |
#Задача 13. Вариант 1.
#Разработайте собственную стратегию ходов компьютера для игры "Крестики-нолики" (Задача 12). Перепишите функцию computer_move() в соответствии с этой стратегией.
def display_instruct():
print("""
Добро пожаловать
на ринг грандиознейших интеллектуальных состязаний всех времён... | Mariaanisimova/pythonintask | BITs/2014/Abdrahmanova_G_I/task_13_1.py | Python | apache-2.0 | 4,954 |
"""Consume the august activity stream."""
import asyncio
import logging
from aiohttp import ClientError
from homeassistant.core import callback
from homeassistant.helpers.debounce import Debouncer
from homeassistant.helpers.event import async_call_later
from homeassistant.util.dt import utcnow
from .const import ACT... | rohitranjan1991/home-assistant | homeassistant/components/august/activity.py | Python | mit | 6,634 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
import argparse
import os
import numpy as np
import pandas as pd
#pd.set_option('max_rows', 10)
pd.set_option('expand_frame_repr', False)
pd.set_option('max_columns', 6)
from pandas_anonymizer import Anonymizer
def... | scls19fr/pandas-anonymizer | pandas_anonymizer/cli/anonymizer.py | Python | isc | 2,026 |
#!/usr/bin/env python
# This file is part of Openplotter.
# Copyright (C) 2015 by sailoog <https://github.com/sailoog/openplotter>
#
# Openplotter 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... | sailoog/openplotter | emulator/w1thermsensor.py | Python | gpl-2.0 | 904 |
"""
Converting between nefis and netcdf
In a separate module to separate dependencies
Relies on the qnc wrapper of netcdf4
"""
from collections import defaultdict
from ...io import qnc
def nefis_to_nc(nef,squeeze_unl=True,squeeze_element=True,
short_if_unique=True,to_lower=True,unl_name='time',
... | rustychris/stompy | stompy/model/delft/nefis_nc.py | Python | mit | 3,795 |
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ProductTemplateLinkType(models.Model):
_name = "product.template.link.type"
_description = "Product Template Link Type"
name = fields.Char(required=True, translate=Tr... | OCA/e-commerce | product_template_multi_link/models/product_template_link_type.py | Python | agpl-3.0 | 3,627 |
import numpy as np
import gym
from pytorchrl.algos.ddpg import DDPG
from pytorchrl.envs.gym_env import GymEnv
from pytorchrl.envs.normalized_env import normalize
from pytorchrl.exploration_strategies.ou_strategy import OUStrategy
from pytorchrl.policies.deterministic_mlp_policy import DeterministicMLPPolicy
from pytor... | nosyndicate/pytorchrl | examples/ddpg_pendulum2.py | Python | mit | 1,609 |
'''A module which implements a unix-like "tail" of a file.
A callback is made for every new line found in the file. Options
specify whether the existing contents of the file should be read
or ignored.
If a file is emptied or removed, the tail will continue reading lines
which are written in the new place.
for li... | SectorAlpha/AlphaGSM | screen/tail.py | Python | gpl-3.0 | 3,753 |
from cloudvolume import CloudVolume
import numpy as np
cv_path = "gs://neuroglancer/basil_v0/son_of_alignment/v3.04_cracks_only_normalized_rechunked"
def scale_slice(sl, dst_mip=1, src_mip=0):
scale = 2**(dst_mip - src_mip)
dst_sl = ()
for s in sl[0:2]:
dst_sl += (slice(int(s.start/scale), int(s.stop/scale)), )
... | seung-lab/Julimaps | src/params/basil/180615_tm_basil_black_out_son_v3.04_cracks_only_normalized_rechunked.py | Python | mit | 2,326 |
# -*- coding: utf-8 -*-
'''
This file is part of O4erednik.
O4erednik 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.
... | xomachine/O4erednik | gui_http.py | Python | gpl-3.0 | 5,491 |
import os
from ducky.mm import MalformedBinaryError
from ducky.mm.binary import File, SectionFlags
from .. import get_tempfile, LOGGER
def test_bad_magic_save():
tmp = get_tempfile()
tmp.close()
with File.open(LOGGER, tmp.name, 'w') as f_out:
f_out.header.magic = File.MAGIC - 1
try:
f_out.save(... | happz/ducky | tests/mm/binary.py | Python | mit | 1,081 |
#!/usr/bin/env python
# Screen scrape list of who's standing down in the 2010 general election
# Copyright (C) 2009 Matthew Somerville
# This is free software, and you are welcome to redistribute it under
# certain conditions. However, it comes with ABSOLUTELY NO WARRANTY.
# For details see the file LICENSE.html in ... | henare/parlparse | members/wikipedia-standingdown.py | Python | agpl-3.0 | 1,078 |
from .parser import loads, load, load_dir
from .locator import Locator
from .address import CoordAddress
assert load is not None and loads is not None and load_dir is not None # Avoid pyflakes
assert Locator is not None # Avoid pyflakes
assert CoordAddress is not None # Avoid pyflakes
| zstars/weblabdeusto | server/src/voodoo/gen/__init__.py | Python | bsd-2-clause | 287 |
from autotest.client.shared import error
from virttest import utils_test
class GuestSuspendBaseTest(utils_test.qemu.GuestSuspend):
def do_guest_suspend(self, **args):
suspend_type = args.get("suspend_type", self.SUSPEND_TYPE_MEM)
self.verify_guest_support_suspend(**args)
self.setup_bg_pr... | spiceqa/virt-test | tests/guest_suspend.py | Python | gpl-2.0 | 4,813 |
"""Collects statistics using Github API."""
from urllib.parse import urljoin
import datetime
from f8a_worker.base import BaseTask
from f8a_worker.errors import (NotABugTaskError,
NotABugFatalTaskError)
from f8a_worker.utils import (parse_gh_repo,
get_respo... | fabric8-analytics/fabric8-analytics-worker | f8a_worker/workers/new_githuber.py | Python | gpl-3.0 | 4,815 |
# -*- encoding: utf-8 -*-
# Pilas engine - A video game framework.
#
# Copyright 2010 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
import random
import pilas
def ordenar_actores_por_valor_z():
"Ordena todos los actores para que se impr... | apehua/pilas | pilas/actores/utils.py | Python | lgpl-3.0 | 2,544 |
# -*- coding: utf-8 -*-
# Copyright 2019 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Extractors for https://www.adultempire.com/"""
from .common import Galler... | mikf/gallery-dl | gallery_dl/extractor/adultempire.py | Python | gpl-2.0 | 2,188 |
# #
# Copyright 2009-2013 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... | hajgato/easybuild-easyblocks | easybuild/easyblocks/i/imkl.py | Python | gpl-2.0 | 18,523 |
#!/usr/bin/python
import socket
import time
import sys
import urllib2
import base64
import uuid
import json
import time
hostname = "localhost"
port = 33333
data_dict = {
'id': str(uuid.uuid4()),
'method': 'hello_world',
'params': {
'args': ['Jude'],
'kw': {'question': "What's up?"},
},
... | jcnelson/syndicatemail | test/hello_world.py | Python | apache-2.0 | 893 |
# -*- coding: utf-8 -*-
# pylint: skip-file
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrati... | Lektorium-LLC/edx-ora2 | openassessment/workflow/migrations/0001_initial.py | Python | agpl-3.0 | 3,203 |
# coding: utf-8
# python imports
import re
# django imports
from django import template
from django.contrib.contenttypes.models import ContentType
from django.utils.formats import get_format
from django.utils.safestring import mark_safe
from django.db import models
from django.contrib import admin
from django.conf im... | nathangeffen/tbonline-old | tbonlineproject/external/grappelli/templatetags/grp_tags.py | Python | mit | 5,762 |
from maps import NamedFixedKeyMapMeta
import unittest
class NamedFixedKeyMapMetaTest(unittest.TestCase):
def test_create(self):
RGB = NamedFixedKeyMapMeta('RGB', ['red', 'green', 'blue'])
rgb = RGB(red='rouge', green='forest', blue='azul')
self.assertIsInstance(rgb, RGB)
self.assert... | pcattori/maps | tests/test_namedfixedkeymap.py | Python | mit | 6,539 |
#!/usr/bin/env python
#
# Copyright 2014 Cosmos.io
#
# 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 ... | pkilambi/python-kubernetes | kubernetes/pod.py | Python | apache-2.0 | 27,703 |
import json
import re
import requests
from_cmdline = False
try:
__file__
from_cmdline = True
except NameError:
pass
if not from_cmdline:
import vim
METHOD_REGEX = re.compile('^(GET|POST|DELETE|PUT|HEAD|OPTIONS|PATCH) (.*)$')
HEADER_REGEX = re.compile('^([^()<>@,;:\<>/\[\]?={}]+):\\s*(.*)$')
VAR_REGEX... | aquach/vim-http-client | plugin/http_client.py | Python | mit | 8,172 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | AbletonAG/domain-events | domain_event_broker/_version.py | Python | mit | 18,466 |
#!/usr/bin/env python
import rospy
import cv2
import numpy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class image_converter:
def __init__(self):
cv2.namedWindow("Image window", 1)
cv2.startWindowThread()
self.bridge = CvBridge()
self.image_su... | cdondrup/teaching | cmp3641m-code-fragments/scripts/color_contours.py | Python | mit | 2,006 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Person.education'
db.add_column('person_person', 'education',
self.gf(... | elin-moco/ffclub | ffclub/person/migrations/0005_auto__add_field_person_education__add_field_person_birthday.py | Python | bsd-3-clause | 5,302 |
# -*- coding: utf-8 -*-
from .rule import Rule
from .event import *
from .occurrence import *
from .generator import *
from .exclusion import *
from .xseason import *
| ixc/glamkit-eventtools | eventtools/models/__init__.py | Python | bsd-3-clause | 170 |
import os
import json
import re
from BeautifulSoup import BeautifulSoup
from psrd.rules import write_rules
from psrd.files import char_replace
from psrd.universal import parse_universal, print_struct
from psrd.sections import ability_pass, is_anonymous_section, has_subsections, entity_pass, quote_pass
def core_structu... | devonjones/PSRD-Parser | src/psrd/spell_lists.py | Python | gpl-3.0 | 5,140 |
# -*- coding: utf-8 -*-
from cleo import InputOption
from eloquent.migrations import Migrator, DatabaseMigrationRepository
from .base_command import BaseCommand
class StatusCommand(BaseCommand):
def configure(self):
super(StatusCommand, self).configure()
self.set_name('migrations:status')
... | sdispater/eloquent | eloquent/commands/migrations/status_command.py | Python | mit | 2,126 |
# coding:utf-8
from common.HttpHelper import httpGet
import json
import random
import time
from StockIndexInfo import StockIndexInfo
from StockInfo import getShAvgPe, getSzAvgPe
from common.LoggerHelper import writeErrorLog, writeWarningLog, writeInfoLog, writeDebugLog, writeLog
def getTotalStockNumber():
url = ... | zwffff2015/stock | stock/StockIndex.py | Python | mit | 5,394 |
#!/usr/bin/python -tt
# 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 i... | saschpe/creatrepo | createrepo/yumbased.py | Python | gpl-2.0 | 9,026 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Group',
fields=[
('id', models.AutoField(primar... | jamesturk/django-mergeobject | tests/migrations/0001_initial.py | Python | bsd-2-clause | 1,834 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('blobs', '0010_rename_counter_to_position'),
]
operations = [
migration... | GISAElkartea/amv2 | antxetamedia/blobs/migrations/0011_auto_20150822_1948.py | Python | agpl-3.0 | 787 |
#!/bin/env python3
#################################
# UBJSON Database Editor #
# dbedit.py #
# Copyright 2017 Michael Reiley #
#################################
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated docu... | seisatsu/Driftwood | tools/dbedit.py | Python | mit | 8,139 |
# Copyright (C) 2008-2009 Open Society Institute
# Thomas Moroz: tmoroz@sorosny.org
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License Version 2 as published
# by the Free Software Foundation. You may not use, modify or distribu... | boothead/karl | karl/utilities/converters/html.py | Python | gpl-2.0 | 1,873 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Trémouilles David
#This file is part of Thunderstorm.
#
#ThunderStrom 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 3 of the License, or
#(a... | davidtrem/ThunderStorm | thunderstorm/istormlib/istorm_view.py | Python | gpl-3.0 | 2,595 |
# Copyright (C) 2013 Google 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 copyright
# notice, this list of conditions and the ... | lordmos/blink | Tools/Scripts/webkitpy/layout_tests/print_layout_test_times_unittest.py | Python | mit | 4,644 |
from webob import Request
from webob.acceptparse import Accept, MIMEAccept, NilAccept, NoAccept, accept_property, AcceptLanguage, AcceptCharset
from nose.tools import eq_, assert_raises
def test_parse_accept_badq():
assert list(Accept.parse("value1; q=0.1.2")) == [('value1', 1)]
def test_init_accept_content_type(... | GdZ/scriptfile | software/googleAppEngine/lib/webob_1_1_1/tests/test_acceptparse.py | Python | mit | 11,541 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
class Project(models.Model):
_inherit = 'project.project'
vendor_bill_count = fields.Integer(related='analytic_account_id.vendor_bill_count', groups='account.group_account_rea... | jeremiahyan/odoo | addons/sale_project_account/models/project.py | Python | gpl-3.0 | 1,852 |
from core import Files
from library.stigma.application import Button
from library.stigma.helper import kivyBuilder
kivyBuilder(Files.apppath, 'model', 'builder', 'end', 'endbuttonexit.kv')
class EndButtonexit(Button):
def __init__(self):
super(EndButtonexit, self).__init__()
self.text = 'Back to H... | Kzulfazriawan/stigma-game-demo | application/model/widget/end/EndButtonexit.py | Python | mit | 355 |
def _show_histogram_1d(h, yscale, xscale, curves):
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
fig = plt.figure()
ax = fig.add_subplot(111)
data = []
countsgrid = h.get_counts()
bins = [countsgrid.get_bounding_box(i).get_corner(0)[0]
for ... | shanot/imp | modules/statistics/pyext/src/_histogram.py | Python | gpl-3.0 | 3,288 |
from otp.ai.AIBase import *
from direct.interval.IntervalGlobal import *
from direct.directnotify import DirectNotifyGlobal
import DistributedCrusherEntityAI
import StomperGlobals
from direct.distributed import ClockDelta
class DistributedStomperAI(DistributedCrusherEntityAI.DistributedCrusherEntityAI):
notify = D... | ksmit799/Toontown-Source | toontown/coghq/DistributedStomperAI.py | Python | mit | 1,730 |
#!/usr/bin/python3
#
# wx.py
#
# WxWidgets frontend interface
#
# Here's your stinkin' licence: http://unlicense.org/
#
# - l0k1
#
# Contact details for l0k1
# steemit.com - https://steemit.com/@l0k1
# bitmessage - BM-2cXWxTVaXJbNyMxv5tAjNg87xS98hrAg8P
# torchat - xq6xcvqc2vy34qtx
# email - l0k1@null.net
def printmod... | l0k1-smirenski/steemportal | src/wx.py | Python | unlicense | 1,978 |
# -*- coding: utf-8 -*-
"""
Echo State Networks
http://minds.jacobs-university.de/mantas
http://organic.elis.ugent.be/
http://www.scholarpedia.org/article/Echo_state_network
Mantas Lukoševičius "A Practical Guide to Applying Echo State Networks"
Konrad Stanek "Reservoir computing in financial forecasting with committee... | alexander-rakhlin/ESN | ESN.py | Python | mit | 10,653 |
# Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | Zarokka/exaile | xlgui/widgets/dialogs.py | Python | gpl-2.0 | 53,249 |
#
# ___PROJECTNAMEASIDENTIFIER___AppDelegate.py
# ___PROJECTNAME___
#
# Created by ___FULLUSERNAME___ on ___DATE___.
# Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
#
from Foundation import *
from AppKit import *
from objc import IBAction, IBOutlet
class ___PROJECTNAMEASIDENTIFIER___AppDelegat... | uchuugaka/python-xcode-templates | XCode/Templates/Project Templates/Python-Cocoa Application.xctemplate/AppDelegate.py | Python | bsd-2-clause | 490 |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | pinterb/st2 | st2common/st2common/signal_handlers.py | Python | apache-2.0 | 1,316 |
# Copyright 2014-2015 ARM Limited
#
# 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 w... | ep1cman/workload-automation | wlauto/core/version.py | Python | apache-2.0 | 862 |
import pgmapcss.types
import pgmapcss.eval
import copy
class _stat(dict):
property_values_cache = {}
def clear_property_values_cache(self):
self.property_values_cache = {}
def all_scale_denominators(self):
return sorted(list(set([
v['selector']['min_scale']
... | plepe/pgmapcss | pgmapcss/compiler/stat.py | Python | agpl-3.0 | 11,473 |
#coding: utf-8
import json
from django.shortcuts import render
from django.http import HttpResponse
from models import Feed
COMMON_SOURCE = [
('kukinews', 'kukinews.gif'),
('donga', 'donga.gif'),
('mk', 'mk.gif'),
('sportsseoul', 'sportsseoul.gif'),
('chosun', 'chosun.gif'),
('yonhapnews', ... | haandol/assemblyapi | feed_manager/views.py | Python | apache-2.0 | 987 |
#!/usr/bin/env python
from objex import Objex
import os.path
import sys
import traceback
from bottle import debug, error, redirect, request, response, route, run, static_file
from jinja2 import Environment, PackageLoader, Template
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.fo... | johnthedebs/objex | objex/browser_test.py | Python | mit | 3,118 |
tests = """
>>> profile = Profile.objects.create(country3='US')
>>> assert(profile.country1 == '')
>>> assert(profile.country2 == 'SE')
>>> assert(profile.country3 == 'US')
>>> data = { 'country1': 'GB', 'country2': 'SE', 'country3': 'US' }
>>> form = ProfileForm(data=data)
>>> form.is_valid()
True
>>> data = { 'cou... | strange/django-country-utils | example/tests.py | Python | bsd-3-clause | 875 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-14 08:37
from __future__ import unicode_literals
import autoslug.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
class Migration(migrations.Migration):
initial... | ppnchb/django-board | django_board/api_v1/migrations/0001_initial.py | Python | mit | 5,713 |
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | phw/weblate | weblate/addons/cleanup.py | Python | gpl-3.0 | 2,799 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_pitchtools_Accidental_abbreviation_01():
accidental = pitchtools.Accidental('s')
assert accidental.abbreviation == 's'
def test_pitchtools_Accidental_abbreviation_02():
accidental = pitchtools.Accidental('')
assert accidental.abbreviation == ''
... | mscuthbert/abjad | abjad/tools/pitchtools/test/test_pitchtools_Accidental_abbreviation.py | Python | gpl-3.0 | 1,234 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import httpretty
import json
import sure
from mock import Mock
from pyeqs import QuerySet, Filter
from pyeqs.dsl import Term, Sort, ScriptScore
from tests.helpers import heterogeneous, homogeneous
def test_copy_queryset():
"""
Copy Queryset obj... | Yipit/pyeqs | tests/unit/test_copy.py | Python | mit | 1,348 |
#!/usr/bin/env python
#
# ModernaSequence.py
#
# Enables work with RNA sequences.
#
# http://iimcb.genesilico.pl/moderna/
#
__author__ = "Magdalena Rother, Tomasz Puton, Kristian Rother"
__copyright__ = "Copyright 2008, The Moderna Project"
__credits__ = ["Janusz Bujnicki"]
__license__ = "GPL"
__maintainer__ = "Magdal... | lenarother/moderna | moderna/sequence/ModernaSequence.py | Python | gpl-3.0 | 6,512 |
# -*- coding: utf-8 -*-
from atom.views import DeleteMessageMixin
from django.urls import reverse_lazy
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from django.views.generic import DetailView, UpdateView, DeleteView, CreateView
from django_tables2 import SingleTableView... | watchdogpolska/watchdog-id | watchdog_id/auth_factories/watchdog_u2f/views.py | Python | mit | 2,500 |
# Ansible module to manage CheckPoint Firewall (c) 2019
#
# Ansible 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.
#
# Ansible is dist... | thaim/ansible | test/units/modules/network/check_point/test_cp_mgmt_multicast_address_range.py | Python | mit | 4,118 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.encoding import python_2_unicode_compatible
# Create your models here.
@python_2_unicode_compatible
class PAQUETE(models.Mod... | lobomacz/touroperadora | tininiska/models.py | Python | gpl-3.0 | 2,449 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.