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
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Linux network utilities. Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-10...
domob1812/bitcoin
test/functional/test_framework/netutil.py
Python
mit
5,046
# pylint: disable=E1101,E1103 # pylint: disable=W0703,W0622,W0613,W0201 from pandas.compat import range, text_type, zip, u, PY2 from pandas import compat from functools import partial import itertools import numpy as np from pandas.core.dtypes.common import ( ensure_platform_int, is_list_like, is_bool_dtype, ...
amolkahat/pandas
pandas/core/reshape/reshape.py
Python
bsd-3-clause
33,440
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 Zadara Storage Inc. # Copyright (c) 2011 OpenStack LLC. # Copyright 2011 University of Southern California # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance w...
nii-cloud/dodai-compute
nova/tests/api/openstack/test_volume_types_extra_specs.py
Python
apache-2.0
7,193
from MiniBotFramework.Actuation.Actuator import Actuator class GpioMotor(Actuator): PWM_FREQUENCY=100 def __init__(self, bot, name, pin_pwm, pin_hl, reversed, GPIO): Actuator.__init__(self, bot, name) self.reversed = reversed self.pin_pwm = pin_pwm self.pin_hl = pin_hl ...
cornell-cup/cs-minibot-platform
python-interface/src/MiniBotFramework/Actuation/GpioMotor.py
Python
apache-2.0
1,820
#!/usr/bin/env python ''' Configure waf for worch. It is expected that any external tools that add worch features have already been loaded. ''' import os from glob import glob import waflib.Logs as msg from waflib import Context from . import util from . import pkgconf from . import envmunge def locate_config_files...
hwaf/hwaf
py-hwaftools/orch/configure.py
Python
bsd-3-clause
2,523
'''@file dblstm.py contains de LAS class''' import tensorflow as tf from nabu.neuralnetworks.classifiers import classifier from nabu.neuralnetworks.classifiers.asr.encoders import encoder_factory from nabu.neuralnetworks.classifiers.asr.asr_decoders import asr_decoder_factory from nabu.neuralnetworks.classifiers.asr.r...
JeroenBosmans/nabu
nabu/neuralnetworks/classifiers/asr/encoder_decoder_reconstructor.py
Python
mit
4,738
#!/usr/bin/env python # coding: utf-8 "Table generated from xterm-256color.yaml" def _generate_dict(): """ This is what I typed in iPython to copy-paste the dict. You will need PyYaml though:: pip install --user PyYAML """ import yaml with open('xterm-256color.yaml') as f: o ...
eddieantonio/imgcat
libexec/color_db.py
Python
isc
6,476
#!/usr/bin/env python # encoding: utf-8 # Hans-Martin von Gaudecker, 2012 """ Run a Stata do-script in the directory specified by **ctx.bldnode**. The first and only argument will be the name of the do-script (no extension), which can be accessed inside the do-script by the local macro `1'. Useful for keeping a log fi...
blablack/deteriorate-lv2
waflib/extras/run_do_script.py
Python
gpl-3.0
4,988
#!/usr/bin/env python #-*- coding: utf-8 -*- f = open('data.txt', 'w') size = f.write('Hello\n') f.write('World\n') f.close() f = open('data.txt') text = f.read() print(text) f.close()
Furzoom/learnpython
usefull_scripts/write_to_file.py
Python
mit
187
#!/usr/bin/env python from src.transcript import Transcript from src.gene import Gene from src.mrna import Mrna def build_transcript_dictionary(seqs, genes): transcripts = {} for gene in genes: gene = Gene.from_gff_feature(gene) if gene == None: print("Could not convert GFFFeatur...
genomeannotation/transvestigator
src/transcript_builder.py
Python
mit
1,055
##################################################################### # Ryuretic: A Modular Framework for RYU # # !/home/ubuntu/mininet-wifi/Ryuretic/ICMP_Listener.py # # Author: # # Jacob Cox (jcox70@gatech.edu) ...
Ryuretic/RAP
mininet-wifi/Ryuretic/ICMP_Listener.py
Python
apache-2.0
2,904
# -------------------------------------------------------- # Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Xinlei Chen # -------------------------------------------------------- import numpy as np from model.config import cfg from model.bbox_transform import bbox_transform_inv, c...
tuan3w/visual_search
visual_search/lib/layer_utils/proposal_top_layer.py
Python
mit
1,829
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2007 Donald N. Allingham # Copyright (C) 2007-2008 Brian G. Matherly # Copyright (C) 2008 Jerome Rapinat # Copyright (C) 2008 Benny Malengier # # This program is free software; you can redistribute it and/or modify # it under the terms of the ...
beernarrd/gramps
gramps/gen/filters/rules/family/_hasnote.py
Python
gpl-2.0
1,759
from django.contrib import admin import common.ot_utils import models class ReportAdmin(admin.ModelAdmin): list_filter = ('device_id',) admin.site.register(models.Report,ReportAdmin) common.ot_utils.autoregister('analysis')
oferb/OpenTrains
webserver/opentrain/analysis/admin.py
Python
bsd-3-clause
235
from scipy.integrate import quad from scipy.integrate import dblquad import numpy as np import math import FEM import matplotlib.pyplot as plt #for animating the 3d plots import sys sys.path.append('/home/solter/Documents/Scripts') import animPlot as anim #define the l2 error as || f1 - f2 ||_L2 def l2d(f1,f2,dim): ...
solter/python-FEM
src/projScript.py
Python
mit
4,689
import os from distutils.core import setup def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() setup( name="worldmap", version="0.1", author="", author_email="", description="worldmap, based on GeoNode", long_description=(read('README.rst')), # Full ...
piensa/worldmap
setup.py
Python
gpl-3.0
730
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). """A Backend class defines the core low-level functions required by a Window class, such a...
psychopy/psychopy
psychopy/visual/backends/glfwbackend.py
Python
gpl-3.0
33,657
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_chart_gradient06.py
Python
bsd-2-clause
1,714
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals try: import unittest2 as unittest except ImportError: import unittest from six import with_metaclass from random import shuffle from pywiktionary.wiktionary import Wiktionary # list of languages TestLang = [ N...
abuccts/wiktionary-lookup
tests/test_wiktionary.py
Python
bsd-2-clause
6,582
import numpy as np from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid from bokeh.models.markers import Circle from bokeh.io import curdoc, show N = 9 x = np.linspace(-2, 2, N) y = x**2 sizes = np.linspace(10, 20, N) source = ColumnDataSource(dict(x=x, y=y, sizes=sizes)) plot = Plot( title=None, p...
stonebig/bokeh
examples/reference/models/Circle.py
Python
bsd-3-clause
780
""" Interfaces and helpers for the virtio_serial ports. @copyright: 2012 Red Hat Inc. """ from threading import Thread import aexpect import logging import os import random import select import socket import time from autotest.client.shared import error import utils_test SOCKET_SIZE = 2048 class VirtioPortExceptio...
ldoktor/virt-test
virttest/kvm_virtio_port.py
Python
gpl-2.0
23,770
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-08-01 07:50 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('web', '0002_auto_20170727_1741'), ] operations = [ migrations.AddField( ...
aancw/Belati
web/web/migrations/0003_docresults_doc_author.py
Python
gpl-2.0
460
"""Support to send and receive Telegram messages.""" import io from ipaddress import ip_network from functools import partial import importlib import logging import requests from requests.auth import HTTPBasicAuth, HTTPDigestAuth import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, AT...
molobrakos/home-assistant
homeassistant/components/telegram_bot/__init__.py
Python
apache-2.0
27,523
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ***** BEGIN LICENSE BLOCK ***** # Copyright (C) 2012-2014, Hayaki Saito # # 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 restric...
saitoha/termprop
__init__.py
Python
mit
1,329
# 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...
ctrlaltdel/neutrinator
vendor/openstack/tests/unit/clustering/v1/test_policy.py
Python
gpl-3.0
2,979
import aiohttp from abc import ABC, abstractmethod class BaseDashboardController(ABC): """Set of APIs to interact with a Dashboard class and routes. Make sure you run start_collecting_metrics function before using get_[stats]_info methods. """ @abstractmethod def get_ray_config(self): ...
robertnishihara/ray
python/ray/dashboard/interface.py
Python
apache-2.0
4,036
#!/usr/bin/env python ''' Copyright (C) 2007 John Beard john.j.beard@gmail.com ##This extension allows you to draw various triangle constructions ##It requires a path to be selected ##It will use the first three nodes of this path ## Dimensions of a triangle__ # # /`__ # / a_c``--__ # / `...
piksels-and-lines-orchestra/inkscape
share/extensions/draw_from_triangle.py
Python
gpl-2.0
22,561
# Kevin Nash (kjn33) # EECS 293 # Assignment 12 from entity import Entity class Actor(Entity): """ A game entity that can act and be acted upon """ def __init__(self): """ Actors follow Entity initialization, are given a null location """ super(Actor, self).__init__()...
Fullbiter/EECS-293
pa12-13/airville/src/actor.py
Python
gpl-3.0
489
#!/usr/bin/env python3 # # Copyright 2022 Red Hat, Inc. # # Authors: # Paolo Bonzini <pbonzini@redhat.com> # # This work is licensed under the MIT License. Please see the LICENSE file or # http://opensource.org/licenses/MIT. from api.models import Message, WatchedQuery, QueuedSeries from .patchewtest import Patc...
patchew-project/patchew
tests/test_maintainers.py
Python
mit
4,364
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'test.ui' # # Created: Fri Nov 11 18:21:08 2011 # by: PyQt4 UI code generator 4.8.5 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeE...
arpho/mmasgis5
mmasgis/ui_test.py
Python
mit
6,056
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from urbansim.datasets.dataset import Dataset as UrbansimDataset class BuildingTypeDataset(UrbansimDataset): id_name_default = "building_type_id" in_table_name_default = "building_type...
christianurich/VIBe2UrbanSim
3rdparty/opus/src/urbansim/datasets/building_type_dataset.py
Python
gpl-2.0
517
# encoding: utf8 from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('account', '0001_initial'), ] operations = [ migrations.AddField( model_name='profile', name='api_token', field=models.CharField(default=...
joepetrini/bike-counter
webapp/account/migrations/0002_profile_api_token.py
Python
mit
407
from django.conf.urls import patterns, url from . import views urlpatterns = patterns('', url(r'^tokens/$', views.token_list, name='tokens_list'), url(r'^tokens/(?P<token>[a-f0-9]{60})/$', views.token_detail, name='tokens_detail'), )
apiaas/gae-search
src/tokens/urls.py
Python
gpl-3.0
245
# -*- mode: python -*- # # Copyright: Ansible Team # 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', 'status': ['stablein...
rmfitzpatrick/ansible
lib/ansible/modules/inventory/add_host.py
Python
gpl-3.0
2,112
# # This file is part of pyasn1-modules software. # # Created by Russ Housley # Copyright (c) 2019, Vigil Security, LLC # License: http://snmplabs.com/pyasn1/license.html # import sys import unittest from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.codec.der.encoder import encode as der_encoder f...
etingof/pyasn1-modules
tests/test_rfc6402.py
Python
bsd-2-clause
6,395
# -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com # # 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...
stackforge/watcher
watcher/tests/decision_engine/datasources/test_monasca_helper.py
Python
apache-2.0
4,368
# -*- encoding: utf-8 -*- # Copyright 2013 IBM Corp. # # 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...
openstack/watcher
watcher/objects/action.py
Python
apache-2.0
6,945
#!/usr/bin/env python """ ================================================================================ pioneerExampleLocomotionCommand.py - Pioneer Locomotion Command Handler ================================================================================ """ import socket, sys, time class locomotionCommandHandle...
jadecastro/LTLMoP
src/lib/handlers/robots/iRobotCreate/iRobotCreateLocomotionCommand.py
Python
gpl-3.0
840
"""The sma integration.""" from __future__ import annotations from datetime import timedelta import logging from typing import TYPE_CHECKING import pysma from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_SSL, ...
rohitranjan1991/home-assistant
homeassistant/components/sma/__init__.py
Python
mit
3,942
x1, v1, x2, v2 = map(int, input().strip().split(' ')) if v1 == v2: print("NO") else: j = (x1 - x2) // (v2 - v1) print("YES" if j > 0 and (x1+v1*j == x2+v2*j) else "NO")
csixteen/HackerRank_Python
Algorithms/kangaroo.py
Python
mit
181
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * import networkx as nx import math MINIMUM_SERVER_VERSION = '6.1.0' LAYOUT = demisto.args().get('layout') layout_to_functions = { 'shell': lambda G: nx.shell_layout(G, scale=200), 'spring': lambda G: nx.spring_l...
VirusTotal/content
Packs/Base/Scripts/DrawRelatedIncidentsCanvas/DrawRelatedIncidentsCanvas.py
Python
mit
5,214
import sys reload(sys) sys.setdefaultencoding('utf-8') from django.contrib import admin from blog.models import Article from blog.models import Category from blog.models import Tag # Register your models here. admin.site.register(Article) admin.site.register(Category) admin.site.register(Tag)
gooosie/django-blog
blog/admin.py
Python
apache-2.0
296
''' Functions related to creating repodata index files. ''' from __future__ import absolute_import, division, print_function import os import bz2 import sys import json import tarfile from os.path import isfile, join, getmtime from conda_build.utils import file_info from conda.compat import PY3 from conda.utils impo...
shastings517/conda-build
conda_build/index.py
Python
bsd-3-clause
4,240
#!/usr/bin/env python # -*- coding: utf-8 -*- #HW3 for EECS 598 Motion Planning import time import openravepy import userdefined as us import numpy as np import kdtree import transformationFunction as tf from random import randrange #### YOUR IMPORTS GO HERE #### handles = []; #### END OF YOUR IMPORTS #### if no...
willsirius/DualTreeRRTStartMotionPlanning
paperVersion/TestUpdateFunction.py
Python
mit
5,213
#!/usr/bin/env python import rospy import math import tf import numpy as np from tf import TransformListener from std_msgs.msg import Empty, Float32 from geometry_msgs.msg import Twist, PoseStamped, Pose import std_srvs.srv from pid import PID class Controller: Idle = 0 Automatic = 1 TakingOff = 2 Lan...
marktsai0316/crazyflie_ros
crazyflie_controller/scripts/controller.py
Python
mit
5,431
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django.contrib.auth.models import AnonymousUser from django.contrib.sta...
hrayr-artunyan/shuup
shuup/xtheme/editing.py
Python
agpl-3.0
3,362
# CTF Gameserver documentation build configuration file, created by # sphinx-quickstart on Sat Dec 26 10:37:08 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration va...
fausecteam/ctf-gameserver
doc/source/conf.py
Python
isc
9,419
import os, sys, numpy # ensure pyeq2 can be imported if -1 != sys.path[0].find('pyeq2-master'):raise Exception('Please rename git checkout directory from "pyeq2-master" to "pyeq2"') exampleFileDirectory = sys.path[0][:sys.path[0].rfind(os.sep)] pyeq2ImportDirectory = os.path.join(os.path.join(exampleFileDirectory, '....
burkesquires/pyeq2
Examples/AnimatedGIF/AnimatedGIF.py
Python
bsd-2-clause
3,650
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """ Migrate contacts to custom_roles Create Date: 2017-04-27 13:59:44.799279 """ # disable Invalid constant name pylint warning for mandatory Alembic variables. # pylint: disable=invalid-name from ggrc.mig...
AleksNeStu/ggrc-core
src/ggrc_risks/migrations/versions/20170427135944_178f7d2fb85e_migrate_contacts_to_custom_roles.py
Python
apache-2.0
811
# Copyright 2015, 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 f...
maxwell-demon/grpc
src/python/grpcio/grpc/framework/core/_end.py
Python
bsd-3-clause
8,648
from sulley import * def run (): groups_and_num_test_cases() dependencies() repeaters() return_current_mutant() exhaustion() # clear out the requests. blocks.REQUESTS = {} blocks.CURRENT = None #########################################################################################...
cirosantilli/sulley
unit_tests/blocks.py
Python
gpl-2.0
7,552
__author__ = 'tonycastronova' import re from shapely.geometry import * from osgeo import ogr from utilities import geometry as geom_utilites def build_catchments(inp): geoms = {} lines = None with open(inp,'r') as f: lines = f.readlines() # first read all the node coordinates nodes = {} ...
Castronova/EMIT
models/swmm_timestep_1/src/geometry.py
Python
gpl-2.0
4,157
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # aiohttp documentation build configuration file, created by # sphinx-quickstart on Wed Mar 5 12:35:35 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # au...
juliatem/aiohttp
docs/conf.py
Python
apache-2.0
10,471
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/layout_tests/models/test_input.py
Python
gpl-2.0
2,612
""" Copyright (c) 2011 Anders Sundman <anders@4zm.org> This file is part of Dandelion Messaging System. Dandelion 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 opti...
4ZM/Dandelion-Message-Service
dandelionpy/dandelion/util.py
Python
gpl-3.0
1,829
""" WSGI config for tx_highered project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATIO...
texastribune/the-dp
exampleproject/wsgi.py
Python
apache-2.0
1,147
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # # Copyright © 2014 Zulip, 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 right...
ryansnowboarder/zulip
api/integrations/svn/zulip_svn_config.py
Python
apache-2.0
2,366
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals """ Created on Mar 18, 2012 """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "S...
migueldiascosta/pymatgen
pymatgen/apps/borg/tests/test_hive.py
Python
mit
4,783
# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import test_hr_contract_approval
VitalPet/addons-onestein
hr_contract_approval/tests/__init__.py
Python
agpl-3.0
134
# Copyright 2012 OpenStack Foundation # 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 requ...
Juniper/tempest
tempest/api/compute/floating_ips/test_list_floating_ips.py
Python
apache-2.0
3,214
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.moves.urllib.parse import urlparse, urlsplit, urlunsplit, quote from future.moves.urllib.error import URLError import itertools import logging import threading ...
drwyrm/Flexget
flexget/plugins/filter/torrent_alive.py
Python
mit
9,639
#coding: UTF-8 import sys import hashlib sys.path.append('./lib/dpkt-1.7/') import dpkt class TCP_STREAM: def __init__(self): '''stream init... streams= { 'id_1': { 'c_ip': 's_ip': ...
lewislone/mStocks
packets-analysis/stream.py
Python
mit
9,059
#-*- coding:utf-8 -*- creature_dict = { # описания существ "Tiny": "Крошечный", "Small ": "Маленький ", "Medium": "Средний", "Large ": "Большой ", "Huge": "Огромный", "Gargantuan": "Громадный", "giant": "гигант", "humanoid": "гуманоид", "Humanoid": "Гуманоид", "kobold": "кобольд...
kestel/dndmonstertrans
dicts/creatures.py
Python
bsd-2-clause
1,151
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change th...
waheedahmed/edx-platform
lms/envs/common.py
Python
agpl-3.0
100,711
#!/usr/bin/env python3 ## @file # collect profiles and perform actions on them # (c) 2014 ETHZ Pascal Steger, psteger@phys.ethz.ch import numpy as np import numpy.random as npr import pdb import matplotlib.pyplot as plt plt.ioff() from gl_class_profiles import Profiles import gl_output as go import gl_helper as gh...
PascalSteger/gravimage
programs/plotting/gl_collection.py
Python
gpl-2.0
34,247
__all__ = ['unwanted', 'get_priority', 'parse_args', 'get_headers', 'write_header', 'write_footer', 'write_includes', 'write_register_with_bases', 'write_classes', 'get_target'] import os import os.path import sys import re import itertools import getopt input_headers = { 'kernel': ["Sicono...
radarsat1/siconos
io/tools/builder_common.py
Python
apache-2.0
9,890
""" Copyright (C) 2017 Jakub Krajniak (jkrajniak at gmail.com) This file is part of AdResSLab. AdResSLab 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) a...
MrTheodor/AdResSLab
adresslab/app_args.py
Python
gpl-3.0
11,497
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Jerome Rapinat, B. Malengier # Copyright (C) 2008 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public ...
pmghalvorsen/gramps_branch
gramps/plugins/quickview/lineage.py
Python
gpl-2.0
8,542
import aiohttp import discord from config import MashapeKey async def ud(cmd, message, args): ud_input = ' '.join(args) url = "https://mashape-community-urban-dictionary.p.mashape.com/define?term=" + ud_input headers = {'X-Mashape-Key': MashapeKey, 'Accept': 'text/plain'} async with aiohttp.ClientSes...
aurora-pro/apex-sigma
sigma/plugins/searches/urbandictionary/ud.py
Python
gpl-3.0
1,053
# Copyright (c) 2014 Dell 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 a...
Nexenta/cinder
cinder/tests/unit/volume/drivers/dell/test_dellsc.py
Python
apache-2.0
196,374
import pytz from django.utils import timezone class TimeZoneActivationMiddleware(): def process_request(self, request): if request.user.is_authenticated(): tzname = request.user.profile.timezone timezone.activate(pytz.timezone(tzname)) else: timezone.deactivate...
peap/djarzeit
account/middleware.py
Python
mit
323
''' Types.py Defines Node DataTypes, mainly overrides of built-ins with guaranteed HTML aware string representations and safety markings. Copyright (C) 2015 Timothy Edmund Crosley This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Publi...
timothycrosley/thedom
thedom/types.py
Python
gpl-2.0
3,108
from ansible.plugins.action import ActionBase from ansible.utils.vars import merge_hash class ActionModule(ActionBase): def run(self, tmp=None, task_vars=None): results = super(ActionModule, self).run(tmp, task_vars) remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_use...
kylape/ansible-insights-client
action_plugins/insights.py
Python
lgpl-2.1
780
''' Created on 09-09-2012 @author: jurek ''' import argparse import sys from os.path import join from os.path import dirname from os.path import basename from hra_core.collections_utils import get_keys_for_value from hra_core.collections_utils import get_for_regexpr from hra_core.properties import Properties from hra_...
TEAM-HRA/hra_suite
HRACore/src/hra_core/globals.py
Python
lgpl-3.0
4,553
import json from os.path import join as path_join from shutil import rmtree from tempfile import mkdtemp from flask_webtest import SessionScope from portal.config.exclusion_persistence import ( ExclusionPersistence, client_users_filter, staging_exclusions, ) from portal.config.site_persistence import Site...
uwcirg/true_nth_usa_portal
tests/test_exclusion_persistence.py
Python
bsd-3-clause
10,797
from urllib.parse import urljoin import re import requests from bs4 import BeautifulSoup def main(): headers = {'user-agent': 'Baiduspider'} proxies = { 'http': 'http://122.114.31.177:808' } base_url = 'https://www.zhihu.com/' seed_url = urljoin(base_url, 'explore') resp = requests.g...
tzpBingo/github-trending
codespace/python/tmp/example04.py
Python
mit
837
from django.shortcuts import render def forbidden(request,message=''): response = render(request, '403.html', {'message': message}) response.status_code = 403 return response
numbas/editor
editor/views/errors.py
Python
apache-2.0
188
""" Dictionnary classes which store values order. """ from lib.hachoir_core.error import HachoirError from lib.hachoir_core.i18n import _ class UniqKeyError(HachoirError): """ Error raised when a value is set whereas the key already exist in a dictionnary. """ pass class Dict(object): """ ...
Branlala/docker-sickbeardfr
sickbeard/lib/hachoir_core/dict.py
Python
mit
5,384
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
nicklhy/mxnet
python/mxnet/io.py
Python
apache-2.0
32,248
class Solution(object): def toHex(self, num): """ :type num: int :rtype: str """ if num==0: return '0' if num<0: num+=0x100000000 res='' strmap='0123456789abcdef' while num>0: res+=strmap[num%16] ...
Tanych/CodeTracking
405-Convert-a-Number-to-Hexadecimal/solution.py
Python
mit
352
from mitmproxy import contentviews from mitmproxy.test import tflow from mitmproxy.test import tutils from mitmproxy.test import taddons from mitmproxy.net.http import Headers from ..mitmproxy import tservers class TestScripts(tservers.MasterTest): def test_add_header(self, tdata): with taddons.context()...
vhaupert/mitmproxy
test/examples/test_examples.py
Python
mit
2,534
# -*- encoding: utf-8 -*- import json import os from bs4 import BeautifulSoup from django.test import Client from django.test import TestCase from pdl.models import Proyecto class SimpleTest(TestCase): def test_feed(self): c = Client() response = c.get('/rss.xml') soup = BeautifulSoup(r...
proyectosdeley/proyectos_de_ley
proyectos_de_ley/pdl/tests/test_feeds.py
Python
mit
904
# (c) Copyright 2013, 2014, University of Manchester # # HydraPlatform 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 # (at your option) any later version. # # Hydra...
UMWRG/HydraPlatform
HydraLib/python/HydraLib/config.py
Python
gpl-3.0
5,352
# Copyright 2019 Capital One Services, LLC # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 # from c7n.exceptions import PolicyValidationError from common_kube import KubeTest class TestCustomResource(KubeTest): def test_custom_cluster_resource_query(self): factory = self.r...
capitalone/cloud-custodian
tools/c7n_kube/tests/test_custom_resource.py
Python
apache-2.0
2,411
""" These are tests for disabling and enabling student accounts, and for making sure that students with disabled accounts are unable to access the courseware. """ from student.tests.factories import UserFactory, UserStandingFactory from student.models import UserStanding from django.test import TestCase, Client from dj...
hkawasaki/kawasaki-aio8-1
common/djangoapps/student/tests/test_userstanding.py
Python
agpl-3.0
4,065
__author__ = 'ilaird' from flask import Flask, g as context, session, abort, request import config from exts.exceptions import ApiException app = Flask(__name__) app.config.from_object(config.Default) try: app.config.from_envvar('PIVOTALPOKER_CONFIG') except RuntimeError: app.config.from_object(config.Debug)...
en0/PivotalPoker
src/http/__init__.py
Python
gpl-2.0
567
from itertools import * def irange(seq): return izip(count(0), seq)
jamii/tuneful
src/util.py
Python
gpl-3.0
73
import _plotly_utils.basevalidators class MaxpointsValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="maxpoints", parent_name="scattersmith.stream", **kwargs ): super(MaxpointsValidator, self).__init__( plotly_name=plotly_name, par...
plotly/plotly.py
packages/python/plotly/plotly/validators/scattersmith/stream/_maxpoints.py
Python
mit
508
#!/usr/bin/python import copy from . import wgwidget as widget from . import wgtextbox as textbox import textwrap import curses from . import wgtitlefield as titlefield from . import fmPopup as Popup import weakref import collections import copy MORE_LABEL = "- more -" # string to tell user there a...
d33tah/npyscreen
npyscreen/wgmultiline.py
Python
bsd-2-clause
31,961
from mock import Mock import zeit.cms.content.interfaces import zeit.cms.testing import zeit.edit.browser.form import zeit.edit.browser.view import zeit.edit.testing import zope.formlib.form import zope.interface import zope.publisher.browser import zope.schema class IExample(zope.interface.Interface): foo = zop...
ZeitOnline/zeit.edit
src/zeit/edit/browser/tests/test_form.py
Python
bsd-3-clause
8,030
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from firefox_ui_harness.testcases import UpdateTestCase class TestFallbackUpdate(UpdateTestCase): def setUp(self)...
Yukarumya/Yukarum-Redfoxes
testing/firefox-ui/tests/update/fallback/test_fallback_update.py
Python
mpl-2.0
715
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # 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 re...
cisco-openstack/tempest
tempest/common/utils/__init__.py
Python
apache-2.0
4,477
"""Utilities for debugging Darglint. This file should not be imported into Darglint, and should ideally be excluded from the sources. """ from ast import ( AST, ) from collections import ( deque, ) from typing import ( Any, List, Optional, Set, ) from .node import CykNode from .config import (...
terrencepreilly/darglint
darglint/utils.py
Python
mit
7,441
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
tempbottle/Nuitka
nuitka/tree/ReformulationImportStatements.py
Python
apache-2.0
7,789
""" By default the HEAD of the current branch will be pushed to the remote server: fab stage deploy If you don't like all the output: fab stage deploy --hide=stdout """ from fabric.api import env, local from fabric.operations import put, run def stage(): env.hosts = ['54.228.188.132'] env.user = 'ec2-user' ...
pxg/pxg.github.io
slides/deployment/python/1_basic_deploy.py
Python
mit
992
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import ast import datetime import logging import os import re import socket import time # We can remove ExpatError when we drop support for Python 2.6: from xml.parsers.expat import ExpatError from tornado import gen, htt...
CANTUS-Project/pysolr-tornado
pysolrtornado.py
Python
bsd-3-clause
37,957
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # nutrientdb documentation build configuration file, created by # sphinx-quickstart on Mon Jun 22 20:23:16 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this #...
duphenix/nutrientdb
docs/conf.py
Python
gpl-3.0
9,270
#!/usr/bin/python __author__ = 'vickydasta' __app__ = 'grammar ripper' ''' --------------- Grammar Ripper --------------- a confuser machine to shuffle your sentence and will make your grammar looking bad ''' #starting engine # grammaripper/kernel/* --> grammar ripper module # grammaripper/kernel/tobe.py --> list of ...
vickydasta/grammarripper
test.py
Python
cc0-1.0
726
from collector.test.base import BaseTest class TestCommon(BaseTest): def test_unknown_resource(self): resp = self.client.get('/xxx') self.check_response_error(resp, 404)
sand8080/collector
collector/collector/test/resources/test_common.py
Python
gpl-2.0
193
# CMPT 200 Lab 5 Queue Management System # # Author: Winston Kouch # MacEwan ID: 1645889 # # Date: November 3, 2014 # # To start program: type in console: main() # WARNING: !!! to avoid graphics.py crashes, use the rectangular exit # buttons within the menu instead of clicking ...
KWinston/ShipyardSystem
main.py
Python
mit
28,843