text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
"""SoundRTS resource manager"""
import os
from lib.resource import ResourceLoader
import config
import options
from paths import MAPS_PATHS
def get_all_packages_paths():
"""return the default "maps and mods" paths followed by the paths of the active packages"""
return MAPS_PATHS # + package_manager.get_pack... | thgcode/soundrts | soundrts/res.py | Python | bsd-3-clause | 4,481 | 0.001562 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.settings import WAF_ATTACK_VECTORS
__product__ = "KS-WAF (Knownsec)"
def detect(get_page):
retval = False
for vector in WAF_ATTACK_VECTORS:... | golismero/golismero | tools/sqlmap/waf/knownsec.py | Python | gpl-2.0 | 511 | 0.003914 |
import os
import sys
root_path = os.path.abspath("../")
if root_path not in sys.path:
sys.path.append(root_path)
import numpy as np
from Util.Metas import TimingMeta
class Optimizer:
def __init__(self, lr=0.01, cache=None):
self.lr = lr
self._cache = cache
def __str__(se... | carefree0910/MachineLearning | f_NN/Optimizers.py | Python | mit | 3,492 | 0.002864 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestEInvoiceRequestLog(unittest.TestCase):
pass
| frappe/erpnext | erpnext/regional/doctype/e_invoice_request_log/test_e_invoice_request_log.py | Python | gpl-3.0 | 241 | 0.004149 |
# 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 or agreed to in writing, ... | GoogleCloudPlatform/cloud-data-quality | clouddq/log.py | Python | apache-2.0 | 3,052 | 0 |
# Copyright 2018 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... | cxxgtxy/tensorflow | tensorflow/python/ops/linalg/linear_operator_kronecker.py | Python | apache-2.0 | 23,700 | 0.005148 |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 08 13:25:40 2015
@author: J. Alejandro Cardona
"""
from Board import *
import pygame
UP, LEFT, DOWN, RIGHT = 1, 2, 3, 4
juego = Board()
_2 = pygame.image.load("2.jpg"); _2re = _2.get_rect()
_4 = pygame.image.load("4.jpg"); _4re = _4.get_rect()
_8 = pygam... | Alecardv/College-projects | 2048/Control.py | Python | gpl-3.0 | 1,336 | 0.026946 |
import re
def readConversion():
string = ''
conversion = []
try:
# obtain conversion pattern
raw = raw_input()
while not raw:
raw = raw_input()
conversion = map(int, raw.split())
# obtain string
string = raw_input()
while not string:
string = raw_input()
finally:
return conversion, string
... | RussianPenguin/dailyprogrammer | easy/140.py | Python | gpl-2.0 | 1,049 | 0.042898 |
from __future__ import division
from .module import Module, interact
class Servo(Module):
def __init__(self, id, alias, device):
Module.__init__(self, 'Servo', id, alias, device)
self._max_angle = 180.0
self._min_pulse = 0.0005
self._max_pulse = 0.0015
self._angle = 0.0
... | pollen/pyrobus | pyluos/modules/servo.py | Python | mit | 1,559 | 0 |
# 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... | reeshupatel/demo | keystone/tests/test_revoke.py | Python | apache-2.0 | 17,990 | 0.000056 |
"""Constants for the Toon integration."""
from datetime import timedelta
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
DEVICE_CLASS_PROBLEM,
)
from homeassistant.components.sensor import DEVICE_CLASS_POWER
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_ICON,... | nkgilley/home-assistant | homeassistant/components/toon/const.py | Python | apache-2.0 | 11,757 | 0 |
"""
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Founda... | archesproject/arches | tests/models/mapped_csv_import_tests.py | Python | agpl-3.0 | 6,782 | 0.003096 |
#-----------------------------------------------------------
# Threaded, Gevent and Prefork Servers
#-----------------------------------------------------------
import datetime
import errno
import logging
import os
import os.path
import platform
import psutil
import random
if os.name == 'posix':
import resource
els... | mindnervestech/mnrp | openerp/service/server.py | Python | agpl-3.0 | 36,292 | 0.002618 |
import abc
from nalaf.features import FeatureGenerator
import re
from nalaf import print_debug, print_verbose
class EdgeFeatureGenerator(FeatureGenerator):
"""
Abstract class for generating features for each edge in the dataset.
Subclasses that inherit this class should:
* Be named [Name]FeatureGenera... | Rostlab/nalaf | nalaf/features/relations/__init__.py | Python | apache-2.0 | 10,867 | 0.005245 |
from urlparse import urljoin
import requests
from django.conf import settings
from edxmako.shortcuts import marketing_link
import logging
from django.core.cache import cache
import json
log = logging.getLogger(__name__)
def is_marketing_api_enabled():
"""
Checks if the feature is enabled, while making some sa... | Edraak/edraak-platform | lms/djangoapps/course_api/helpers.py | Python | agpl-3.0 | 2,431 | 0.002879 |
# user: smartmirror_elp
# pw: 12345678
# API-key: 68a61abe6601c18b8288c0e133ccaafb
import os
import pyowm
import datetime
from datetime import datetime
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from Widgets.ExpandedWidget import ExpandedWidget
API_key = "68a61abe6601c18b8288c0... | IotaMyriad/SmartMirror | Widgets/InstalledWidgets/WeatherWidget/ExpandedWeatherWidget.py | Python | gpl-3.0 | 3,751 | 0.005335 |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | kdart/pycopia | QA/pycopia/QA/jobrunner.py | Python | apache-2.0 | 5,084 | 0.00118 |
from itertools import izip, chain, repeat
from grid.models import Grid
def grouper(n, iterable, padvalue=None):
"grouper(3, 'abcdefg', 'x') --> ('a','b','c'), ('d','e','f'), ('g','x','x')"
return izip(*[chain(iterable, repeat(padvalue, n-1))]*n)
def grid_headers(request):
grid_headers = list(Grid.objec... | miketheman/opencomparison | grid/context_processors.py | Python | mit | 430 | 0.002326 |
import base64
import binascii
import json
import re
import uuid
import warnings
import zlib
from collections import deque
from types import TracebackType
from typing import ( # noqa
TYPE_CHECKING,
Any,
Dict,
Iterator,
List,
Mapping,
Optional,
Sequence,
Tuple,
Type,
Union,
... | arthurdarcet/aiohttp | aiohttp/multipart.py | Python | apache-2.0 | 32,819 | 0.000853 |
"""
Collection of query wrappers / abstractions to both facilitate data
retrieval and to reduce dependency on DB-specific API.
"""
from contextlib import contextmanager
from datetime import date, datetime, time
from functools import partial
import re
from typing import Iterator, Optional, Union, overload
import warnin... | TomAugspurger/pandas | pandas/io/sql.py | Python | bsd-3-clause | 62,333 | 0.000433 |
#!/usr/bin/python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t; python-indent: 4 -*-
"""
Role
====
The ``PluginManager`` loads plugins that enforce the `Plugin
Description Policy`_, and offers the most simple methods to activate
and deactivate the plugins once they are loaded.
.. note:: It may also classif... | meyt/mehrcal | mehrcal/yapsy/PluginManager.py | Python | gpl-3.0 | 22,880 | 0.025481 |
# -*- coding: utf-8 -*-
import os
import KBEngine
from KBEDebug import *
"""
loginapp进程主要处理KBEngine服务端登陆、创建账号等工作。
目前脚本支持几种功能:
1: 注册账号检查
2:登陆检查
3:自定义socket回调,参考interface中Poller实现
"""
def onLoginAppReady():
"""
KBEngine method.
loginapp已经准备好了
"""
INFO_MSG('onLoginAppReady: bootstrapGroupIndex=%... | Orav/kbengine | assets/scripts/login/kbemain.py | Python | lgpl-3.0 | 2,617 | 0.036195 |
"""
TestCmd.py: a testing framework for commands and scripts.
The TestCmd module provides a framework for portable automated testing of
executable commands and scripts (in any language, not just Python), especially
commands and scripts that require file system interaction.
In addition to running tests and evaluating... | mxrrow/zaicoin | src/deps/boost/tools/build/v2/test/TestCmd.py | Python | mit | 23,923 | 0.002424 |
# -*- coding: utf-8 -*-
from django.template import Library
register = Library()
@register.simple_tag(name='getattr')
def _getattr(*args):
return getattr(*args)
| apinsard/khango | khango/templatetags/khango.py | Python | mit | 169 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | eustislab/horton | scripts/horton-esp-test.py | Python | gpl-3.0 | 3,917 | 0.004595 |
import numpy as np
import matplotlib.pyplot as plt
npoint = 100
dec = 3
x = np.linspace(0,1,npoint)
a = dec * np.linspace(0,1,npoint/2)
b = dec * np.linspace(1,0,npoint/2)
delta = np.concatenate((a,b))
delta1 = dec * np.linspace(0,1,npoint)
delta2 = dec * np.ones(npoint)
plt.figure()
plt.plot(x, delta2)
plt.figu... | Aircollition/Aircollition | Python scripts/theta.py | Python | mit | 378 | 0.02381 |
"""Test suite for the profile module."""
import sys
import pstats
import unittest
from difflib import unified_diff
from io import StringIO
from test.support import run_unittest
import profile
from test.profilee import testfunc, timer
class ProfileTest(unittest.TestCase):
profilerclass = profile.... | harmy/kbengine | kbe/res/scripts/common/Lib/test/test_profile.py | Python | lgpl-3.0 | 7,166 | 0.001535 |
""" The Racing Kings Variation"""
from pychess.Utils.const import RACINGKINGSCHESS, VARIANTS_OTHER_NONSTANDARD, \
A8, B8, C8, D8, E8, F8, G8, H8
from pychess.Utils.Board import Board
RACINGKINGSSTART = "8/8/8/8/8/8/krbnNBRK/qrbnNBRQ w - - 0 1"
RANK8 = (A8, B8, C8, D8, E8, F8, G8, H8)
class RacingKingsBoard(Boa... | pychess/pychess | lib/pychess/Variants/racingkings.py | Python | gpl-3.0 | 1,813 | 0.004413 |
import sys, xbmcplugin, xbmcgui,xbmc
_id = "plugin.video.italian-news"
_resdir = "special://home/addons/" + _id + "/resources"
_thisPlugin = int(sys.argv[1])
_icons = _resdir + "/icons/"
sys.path.append( xbmc.translatePath(_resdir + "/lib/"))
import rai
_tg1Icon=xbmc.translatePath(_icons +"Tg1_logo.png")
_tg2Icon=xb... | mikpin/plugin.video.italian-news | default.py | Python | gpl-2.0 | 1,928 | 0.028527 |
# Copyright (c) 2021 PaddlePaddle 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 ap... | luotao1/Paddle | python/paddle/fluid/ir.py | Python | apache-2.0 | 22,516 | 0.000622 |
"""
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
from scipy.spatial import distance
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing im... | smartscheduling/scikit-learn-categorical-tree | sklearn/cluster/tests/test_dbscan.py | Python | bsd-3-clause | 10,974 | 0 |
#The DF of a tidal stream
import copy
import numpy
import multiprocessing
import scipy
from scipy import special, interpolate, integrate
if int(scipy.__version__.split('.')[1]) < 10: #pragma: no cover
from scipy.maxentropy import logsumexp
else:
from scipy.misc import logsumexp
from galpy.orbit import Orbit
fro... | followthesheep/galpy | galpy/df_src/streamdf.py | Python | bsd-3-clause | 117,381 | 0.021826 |
speed = [0.1, 17.5, 40, 48, 52, 69, 88]
lifespan = [2, 8, 70, 1.5, 25, 12, 28]
index = ['snail', 'pig', 'elephant',
'rabbit', 'giraffe', 'coyote', 'horse']
df = pd.DataFrame({'speed': speed,
'lifespan': lifespan}, index=index)
ax = df.plot.bar(rot=0)
| datapythonista/datapythonista.github.io | docs/new-pandas-doc/generated/pandas-DataFrame-plot-bar-2.py | Python | apache-2.0 | 279 | 0 |
# Copyright 2014 The Oppia 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 applicable ... | prasanna08/oppia | core/controllers/reader_test.py | Python | apache-2.0 | 102,089 | 0.000431 |
# coding=utf-8
# Copyright 2016 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 requ... | google-research/tf-slim | tf_slim/data/parallel_reader.py | Python | apache-2.0 | 11,775 | 0.002803 |
from django.contrib import admin
from .models import Produto, Foto
from rest_framework.authtoken.admin import TokenAdmin
TokenAdmin.raw_id_fields = ('user',)
# Register your models here.
# admin.site.register(Bucketlist)
admin.site.register(Produto)
admin.site.register(Foto)
| alexiwamoto/django-rest-api | rest_api/admin.py | Python | mit | 279 | 0 |
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wger W... | rolandgeider/wger | wger/nutrition/tests/test_calories_calculator.py | Python | agpl-3.0 | 6,686 | 0.00015 |
""" Documentation package """
import neuroptikon
import wx, wx.html
import os.path, sys, urllib
_sharedFrame = None
def baseURL():
if neuroptikon.runningFromSource:
basePath = os.path.join(neuroptikon.rootDir, 'documentation', 'build', 'Documentation')
else:
basePath = os.path.join(neuropti... | JaneliaSciComp/Neuroptikon | Source/documentation/__init__.py | Python | bsd-3-clause | 747 | 0.008032 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
import logging
import optparse
import os
import sys
import shutil
import te... | bitdeal/bitdeal | qa/rpc-tests/test_framework/test_framework.py | Python | mit | 7,473 | 0.002141 |
#! coding:utf-8
"""
compiler tests.
These tests are among the very first that were written when SQLAlchemy
began in 2005. As a result the testing style here is very dense;
it's an ongoing job to break these into much smaller tests with correct pep8
styling and coherent test organization.
"""
from sqlalchemy.testin... | sandan/sqlalchemy | test/sql/test_compiler.py | Python | mit | 148,745 | 0.00002 |
# Copyright (C) 2009-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | hcs/mailman | src/mailman/commands/cli_control.py | Python | gpl-3.0 | 7,366 | 0.000543 |
"""
This creates an HTTPClientRequest object. The constructor receives the JSON
file which contains the request. Then it creates the object with the data
specified from the JSON, builds the appropriate GET/POST URL. When Execute
method is called, the request is sent to server
"""
import urllib2
import sys
import os... | avinassh/simple-web-server | HTTPClientRequest.py | Python | mit | 1,686 | 0.004745 |
#write one example for simplify by projecting;
#write a different example for simplifying in DD (0.00001)
#working off of downloaded uauc table
#create working table of state
#simplify polygon (perhaps project to GM, then try multiple distances)
#check vertex count, visual polygon coarseness etc
#use ogr2ogr to export ... | awolfe76/rural-with-mapbox | src/geojson/mk_geojson.py | Python | cc0-1.0 | 2,410 | 0.039419 |
# -*- coding: UTF-8 -*-
'''
Authorized by vlon Jang
Created on Jul 3, 2016
Email:zhangzhiwei@ict.ac.cn
From Institute of Computing Technology
All Rights Reserved.
'''
import pandas as pd
import numpy as np
import pymysql
import matplotlib ... | wangqingbaidu/aliMusic | models/new_songs_incr.py | Python | gpl-3.0 | 38,314 | 0.012382 |
import logging
from ..openscap import OSCAPScanner
log = logging.getLogger(__package__)
def init(app):
app.hooks.connect("pre-arg-parse", add_argparse)
app.hooks.connect("post-arg-parse", post_argparse)
def add_argparse(app, parser, subparsers):
s = subparsers.add_parser("openscap", help="Security man... | oVirt/imgbased | src/imgbased/plugins/openscap.py | Python | gpl-2.0 | 1,850 | 0 |
# last modified 20151215 changed sequencing selection to use sampling with
# replacement for all populations sizes
import numpy as np
import random as rnd
from itertools import groupby
import os
import random
#mySeed=2015
#random.seed(mySeed)
def encode(input_nparray):
'''
converts a numpy boolean array to... | jsemple19/BSA_simulation | recombSim2.py | Python | gpl-2.0 | 10,746 | 0.020101 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v10/services/types/campaign_service.py | Python | apache-2.0 | 6,174 | 0.00081 |
"""
WSGI config for hoaxdetector project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_... | barliant/fnc-id | django_project/old/hoaxdetector/hoaxdetector/wsgi.py | Python | apache-2.0 | 401 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import re
import os
import sys
import codecs
name = 'python-slugify'
package = 'slugify'
description = 'A Python Slugify application that handles Unicode'
url = 'https://github.com/un33k/python-slugify'
author = 'Val Neekman'
author_email = '... | nMustaki/python-slugify | setup.py | Python | bsd-3-clause | 2,653 | 0.000754 |
# -*- coding: utf-8 -*-
#
# File : echotorch/nn/ESN.py
# Description : An Echo State Network module.
# Date : 26th of January, 2018
#
# This file is part of EchoTorch. EchoTorch 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 Sof... | nschaetti/EchoTorch | echotorch/nn/LiESN.py | Python | gpl-3.0 | 4,533 | 0.004853 |
#!/usr/bin/env python
CDF_TABLE = {
-4.0: 3.1671241833119863e-05,
-3.999: 3.1805340054201978e-05,
-3.998: 3.1939975607705564e-05,
-3.997: 3.2075150511550028e-05,
-3.996: 3.2210866790657701e-05,
-3.995: 3.2347126476975879e-05,
-3.994: 3.2483931609498828e-05,
-3.993: 3.2621284234289769e-0... | mtambos/online-anomaly-detection | src/mgng/cdf_table.py | Python | mit | 263,594 | 0 |
"""
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from datetime import date
from freezegun import freeze_time
from byceps.database import generate_uuid
from byceps.services.orga import birthday_service
from byceps.services.org... | homeworkprod/byceps | tests/unit/services/orga/test_birthday_service.py | Python | bsd-3-clause | 1,509 | 0 |
#!/usr/bin/env python
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master'))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master/wkpf'))
print os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master/wkpf')
from... | wukong-m2m/NanoKong | tools/python/scripts/installer.py | Python | gpl-2.0 | 2,839 | 0.002113 |
import subprocess
import errand_boy
from errand_boy.exceptions import SessionClosedError
from errand_boy.transports import base, mock as mock_transport
from .base import mock, BaseTestCase
from .data import get_command_data
class MockTransportSimTestCase(BaseTestCase):
def test_run_cmd(self):
transport ... | greyside/errand-boy | tests/test_mock_transport.py | Python | bsd-3-clause | 2,753 | 0.001816 |
# Copyright 2016, 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... | fluxer/spm | nuitka/nuitka/nodes/BuiltinTypeNodes.py | Python | gpl-2.0 | 10,942 | 0.009048 |
import pygame as pg
class Spritesheet:
def __init__(self, filename, tile_size):
self.sheet = pg.image.load(filename).convert_alpha()
self.tile_size = tile_size
def get_image(self, x, y, width, height):
image = pg.Surface((width, height))
image.blit(self.sheet, (0, 0), (x, y, w... | kuroneko1996/cyberlab | spritesheet.py | Python | mit | 869 | 0.002301 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-recommendations-ai | google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc.py | Python | apache-2.0 | 11,847 | 0.001857 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-27 16:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('reddit', '0009_auto_20170527_1814'),
]
operations ... | hcosta/escueladevideojuegos.net-backend-django | edv/reddit/migrations/0010_question_best_response.py | Python | gpl-3.0 | 628 | 0.001592 |
import sys
from pathlib import Path
from setuptools import find_packages, setup
long_description = Path('README.rst').read_text()
# Populates __version__ without importing the package
__version__ = None
with open('flexget/_version.py', encoding='utf-8') as ver_file:
exec(ver_file.read()) # pylint: disable=W0122... | ianstalk/Flexget | setup.py | Python | mit | 2,280 | 0.000877 |
# #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <HTTPretty - HTTP client mock for Python>
# Copyright (C) <2011-2013> Gabriel Falcão <gabriel@nacaolivre.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to d... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/httpretty/__init__.py | Python | agpl-3.0 | 1,914 | 0 |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
import pytest
from atomic_reactor.core import DockerTasker
from atomic_reactor.inner import DockerBu... | fatherlinux/atomic-reactor | tests/plugins/test_check_and_set_rebuild.py | Python | bsd-3-clause | 4,173 | 0.001198 |
from .action_types import GeneratorActionType, ActionStateType
from .data_types_tree import Ensemble, Struct, Float, DTT
import copy
from .code_formater import Formater
class VariableGenerator(GeneratorActionType):
name = "VariableGenerator"
"""Display name of action"""
description = "Generator for cr... | GeoMop/GeoMop | src/Analysis/pipeline/generator_actions.py | Python | gpl-3.0 | 11,140 | 0.006463 |
#!/usr/bin/env python
# Copyright 2010-2012 RethinkDB, all rights reserved.
# Usage: ./launch_nightly_test.py
# --test-host <hostname>[:<port>]
# (--email <name>@<address>)*
# [--title "<Title>"]
# [-- <flags for full_test_driver.py>]
import sys, subprocess, os, optparse
i... | jfriedly/rethinkdb | scripts/nightly-test/launch_nightly_test.py | Python | agpl-3.0 | 1,755 | 0.015954 |
import os
from io import open
from setuptools import setup
about = {}
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'stringsheet', '__init__.py'), encoding='utf-8') as f:
for line in f:
if line.startswith('__'):
(key, value) = line.split('=')
about[... | Tunous/StringSheet | setup.py | Python | mit | 977 | 0.001024 |
from Sensor import Sensor
import cv2
class Camera(Sensor):
def __init__(self):
self._cap = cv2.VideoCapture(0)
def read(self):
return self._cap.read()
| paulydboy/Quad-Vision | DroneControl/Camera.py | Python | apache-2.0 | 177 | 0.00565 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('videoclases', '0013_tarea_profesor'),
]
operations = [
migrations.AddField(
model_name='grupo',
name... | Videoclases/videoclases | videoclases/migrations/0014_auto_20150726_1441.py | Python | gpl-3.0 | 975 | 0 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import sys
from csvkit import sql
from csvkit import table
from csvkit import CSVKitWriter
from csvkit.cli import CSVKitUtility
class CSVSQL(CSVKitUtility):
description = 'Generate SQL statements for one or more CSV files, create execute those statements dir... | gepuro/csvkit | csvkit/utilities/csvsql.py | Python | mit | 7,388 | 0.006091 |
"""
Enable basic CAN over a PCAN USB device.
"""
import logging
import time
from datetime import datetime
import platform
from typing import Optional
from packaging import version
from ...message import Message
from ...bus import BusABC, BusState
from ...util import len2dlc, dlc2len
from ...exceptions import CanErr... | hardbyte/python-can | can/interfaces/pcan/pcan.py | Python | lgpl-3.0 | 21,138 | 0.001277 |
"""LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class printf_request_t(object):
__slots__ = ["sheriff_id"]
def __init__(self):
self.sheriff_id = 0... | Morbotic/pronto-distro | externals/libbot-drc/bot2-procman/python/src/bot_procman/printf_request_t.py | Python | lgpl-2.1 | 1,785 | 0.006162 |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2018-present MagicStack Inc. and the EdgeDB authors.
#
# 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... | edgedb/edgedb | edb/server/compiler/__init__.py | Python | apache-2.0 | 1,345 | 0 |
import os
import time
import json
import cPickle
import tempfile
from testtools import TestCase, ExpectedException
import psutil
from cloudify.workflows import local
class TestSingleNode(TestCase):
def setUp(self):
super(TestSingleNode, self).setUp()
os.environ['MANAGEMENT_IP'] = '127.0.0.1'
... | codilime/cloudify-diamond-plugin | diamond_agent/tests/test_single_node.py | Python | apache-2.0 | 8,798 | 0.000114 |
def progress(current, total, percent=10, iteration=None):
"""
Used in a loop to indicate progress
"""
current += 1
if current:
previous = current - 1
else:
previous = current
# print out every percent
frac = percent/100.
value = max(1, frac*total)
retur... | CDNoyes/EDL-Py | Utils/progress.py | Python | gpl-3.0 | 521 | 0.011516 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | polyaxon/polyaxon | core/polyaxon/polypod/compiler/lineage/artifacts_collector.py | Python | apache-2.0 | 1,081 | 0.000925 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import unittest
import shutil
import gransk.core.helper as helper
import gransk.core.tests.test_helper as test_helper
import gransk.core.document as document
import gransk.plugins.storage.store_text as store_... | pcbje/gransk | gransk/plugins/storage/tests/store_text_test.py | Python | apache-2.0 | 1,005 | 0.002985 |
#!/usr/bin/env python3
"""
This Project is a Python based HP ALM Purge Wizard.
This is the main file which do all stuff
For detailed informatin please visit
https://github.com/aytuncbeken/Hp-Alm-Purge-Tool
Author:Aytunc BEKEN
Python Version:3.6
License:GPL
"""
import threading
from concurre... | aytuncbeken/Hp-Alm-Purge-Tool | PurgeWizard.py | Python | gpl-3.0 | 8,814 | 0.003744 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('presentation', '0015_auto_20160515_1658'),
]
operations = [
migrations.RenameField(
model_name='membership',
... | lesglaneurs/lesglaneurs | presentation/migrations/0016_auto_20160516_0806.py | Python | gpl-3.0 | 398 | 0 |
# 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... | mistercrunch/panoramix | superset/views/base_api.py | Python | apache-2.0 | 21,953 | 0.000957 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Midokura Japan K.K.
# Copyright (C) 2013 Midokura PTE LTD
# 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 th... | midonet/python-neutron-plugin-midonet | midonet/neutron/tests/unit/test_midonet_plugin.py | Python | apache-2.0 | 4,032 | 0 |
from __future__ import unicode_literals
import copy
import sys
from django.test import TestCase
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.settings import api_settings
from rest_framework.test import APIRequestFact... | callorico/django-rest-framework | tests/test_views.py | Python | bsd-2-clause | 3,650 | 0 |
"""
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | kamal-gade/rockstor-core | src/rockstor/storageadmin/views/plugin.py | Python | gpl-3.0 | 1,928 | 0.004668 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Nate Coraor <nate@coraor.org>
#
# This file is part of Ansible
#
# 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... | martenson/ansible-common-roles | paths/library/zfs_permissions.py | Python | mit | 9,934 | 0.004832 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-17 10:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('shop', '0002_shops_longitude'),
]
operations = [
... | Visrozar/DjangoRecommender | shop/migrations/0003_auto_20170217_1533.py | Python | mit | 1,327 | 0.003014 |
# 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... | Juniper/nova | nova/virt/libvirt/volume/iscsi.py | Python | apache-2.0 | 3,538 | 0 |
"""Configuration for ACLs."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file e... | REANNZ/faucet | faucet/acl.py | Python | apache-2.0 | 33,575 | 0.001519 |
"""
This module contains a helper to extract various kinds of primitive data types
from a dictionary of strings.
"""
class StringDictHelper:
"""
Helper class to extract primitive types from a dictionary of strings. This is a port
of Java robotutils class StringmapHelper. The special values 'true' an... | josephmjoy/robotics | python_robotutils/robotutils/strmap_helper.py | Python | mit | 3,444 | 0.003194 |
#!/usr/bin/python
#
# Copyright 2014 Google 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
#
# Unless required b... | wubr2000/googleads-python-lib | examples/dfp/v201411/audience_segment_service/get_all_audience_segments.py | Python | apache-2.0 | 1,845 | 0.009214 |
import os.path
import zipfile
import tempfile
import logging
import json
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import Pango
from operator import itemgetter
from gtweak.utils import extract_zip_file, execute_subprocess
from gtweak.gshellwrapper import GnomeShell, GnomeShellFac... | bendavis78/gnome-tweak-tool | gtweak/tweaks/tweak_group_shell_extensions.py | Python | gpl-3.0 | 13,162 | 0.004862 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | lib/spack/spack/cmd/gpg.py | Python | lgpl-2.1 | 6,389 | 0 |
"""Health Check API
Use to check system status, will report "green" or "red" for each component
plus overall for "status"::
{
"status": "green",
"celery": "green",
"elastic": "green",
"mongo": "green",
"redis": "green"
}
"""
import logging
import superdesk
from typin... | petrjasek/superdesk-core | superdesk/system/health.py | Python | agpl-3.0 | 1,753 | 0 |
# -*- coding: utf-8 -*-
import sys
def print_progress (iteration, total, prefix = '', suffix = '', decimals = 1, barLength = 100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
... | DawudH/scrapy_real-estate | plot/print_progressbar.py | Python | mit | 1,262 | 0.014286 |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('studio', 'mdbl@live.com'),
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/Users/studio... | mdblv2/joatu-django | application/joatu/local_settings.py | Python | apache-2.0 | 2,019 | 0.004458 |
#!python3
"""Logging module.
**This module must not introduce dependency on any other Black Mamba
modules and must be importable on any other platform**.
Why custom module instead of the bundled one? Several reasons:
* not to interfere with Pythonista logging settings,
* unable to convince Pythonista to use my colo... | zrzka/blackmamba | blackmamba/log.py | Python | mit | 2,546 | 0.000393 |
#!/usr/bin/env python
'''
Parse a C source file.
To use, subclass CParser and override its handle_* methods. Then instantiate
the class with a string to parse.
'''
__docformat__ = 'restructuredtext'
import operator
import os.path
import re
import sys
import time
import warnings
import preprocessor
import yacc
imp... | novas0x2a/ctypesgen | ctypesgencore/parser/cparser.py | Python | bsd-3-clause | 6,868 | 0.00364 |
from pyDes import *
#############################################################################
# Examples #
#############################################################################
def _example_triple_des_():
from time import time
# Utility module
from binascii import unhexlify as unhex
# exam... | fredmorcos/attic | snippets/python/py-des/test_pydes.py | Python | isc | 9,694 | 0.030638 |
###############################################################################
# volumina: volume slicing and editing library
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# modify it und... | burgerdev/volumina | volumina/colorama/ansitowin32.py | Python | lgpl-3.0 | 7,363 | 0.001901 |
"""HTML form handling for web clients.
ClientForm is a Python module for handling HTML forms on the client
side, useful for parsing HTML forms, filling them in and returning the
completed forms to the server. It has developed from a port of Gisle
Aas' Perl module HTML::Form, from the libwww-perl library, but the
inte... | glaudsonml/kurgan-ai | tools/sqlmap/thirdparty/clientform/clientform.py | Python | apache-2.0 | 126,378 | 0.001369 |
#!/usr/bin/env python
from __future__ import print_function
import os
import cgi
from subprocess import Popen, PIPE, STDOUT
# Java
SCRIPTDIR = 'javaprolog'
# SCRIPT = ['/usr/bin/java', '-cp', 'json-simple-1.1.1.jar:gnuprologjava-0.2.6.jar:.', 'Shrdlite']
import platform
if platform.system()=='Windows':
SCRIPT =... | cthGoman/shrdlite | cgi-bin/ajaxwrapper.py | Python | gpl-3.0 | 1,269 | 0.007092 |
# (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.dev.utils import get_metadata_metrics
from . import common
@pytest.mark.e2e
def test_check_ok(dd_agent_check):
aggregator = dd_agent_check(rate=True)
metrics ... | DataDog/integrations-extras | calico/tests/test_e2e.py | Python | bsd-3-clause | 492 | 0 |
from twisted.internet import defer
from twisted.trial import unittest
from twisted.trial import runner, reporter, util
from twisted.trial.test import detests
class TestSetUp(unittest.TestCase):
def _loadSuite(self, klass):
loader = runner.TestLoader()
r = reporter.TestResult()
s = loader.l... | nlloyd/SubliminalCollaborator | libs/twisted/trial/test/test_deferred.py | Python | apache-2.0 | 8,003 | 0.00025 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015-2016 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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... | unioslo/cerebrum | Cerebrum/modules/pwcheck/__init__.py | Python | gpl-2.0 | 1,022 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.