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
''' XBMCVFS override for Dharma. Version: 1.0 ''' import os, sys, time, errno def exists(target): return os.path.exists(target) def rename(origin, target): return os.rename(origin, target) def delete(target): if os.path.isfile(target) and not os.path.isdir(target): return os.unlink(t...
SMALLplayer/smallplayer-image-creator
storage/.xbmc/addons/script.module.simple.downloader/lib/xbmcvfsdummy.py
Python
gpl-2.0
353
""" stubo ~~~~~ Stub-O-Matic - Enable automated testing by mastering system dependencies. Use when reality is simply not good enough. :copyright: (c) 2015 by OpenCredo. :license: GPLv3, see LICENSE for more details. """ import os import sys version = "0.8.18" version_info = tuple(ve...
Stub-O-Matic-BA/stubo-app
stubo/__init__.py
Python
gpl-3.0
586
from .QuoteAdapter import QuoteAdapter from .GoogleFinanceQuoteAdapter import GoogleFinanceQuoteAdapter
philipodonnell/paperbroker
paperbroker/adapters/quotes/__init__.py
Python
mit
104
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright (C) 2014-2016 goavki contributors <https://github.com/goavki/streamparser> # # 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 vers...
eddieantonio/big-practice-repo
hug-api/apertium_streamparser.py
Python
agpl-3.0
6,231
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt import frappe import json from frappe.desk.doctype.bulk_update.bulk_update import show_progress from frappe.model.document import Document from frappe import _ class DeletedDocument(Do...
mhbu50/frappe
frappe/core/doctype/deleted_document/deleted_document.py
Python
mit
1,584
''' Draw a star ''' from turtle import * color('red', 'yellow') begin_fill() while True: forward(200) left(170) if abs(pos()) < 1: break end_fill() done()
samuelzq/Learn-Python-with-kids
part2/draw_star.py
Python
apache-2.0
176
"""Test the TcEx Threat Intel Module.""" # standard library import os from datetime import datetime, timedelta from .ti_helpers import TestThreatIntelligence, TIHelper class TestCampaignGroups(TestThreatIntelligence): """Test TcEx Campaign Groups.""" group_type = 'Campaign' owner = os.getenv('TC_OWNER')...
ThreatConnect-Inc/tcex
tests/api/tc/v2/threat_intelligence/test_campaign_interface.py
Python
apache-2.0
3,930
# 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 required by applica...
tombstone/models
official/benchmark/models/cifar_preprocessing.py
Python
apache-2.0
5,637
import unittest import unittest.mock import tornado.gen import tornado.testing import robot.tests import robot.lib.shell class BaseShellTest(robot.tests.TestCase): @unittest.mock.patch("tornado.process.Subprocess") @tornado.testing.gen_test def test_run(self, Subprocess): shell = robot.lib.shell....
robot-ci/robot-ci
robot/tests/lib/test_shell.py
Python
gpl-3.0
4,095
from .base import * DEBUG = True # Email # https://docs.djangoproject.com/en/1.8/topics/email/ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' SERVER_EMAIL = 'contact@fc-bolzplatz.eu' DEFAULT_FROM_EMAIL = 'no-reply@fc-bolzplatz.eu' EMAIL_SUBJECT_PREFIX = '[Bolzplatz] ' MANAGERS = ( ('Us', 'oursel...
evonaut/bolzplatz
bolzplatz/config/settings/local.py
Python
gpl-2.0
704
"basic 2D vector geometry" from math import acos, sqrt, sin, cos, pi class Vec2D(object): " Simple 2D vector class for euclidean geometry " EPSILON = 0.0001 def __init__(self, x=0.0, y=0.0): self.pos_x = x self.pos_y = y def dot(self, other): "dot product" return sel...
31415us/linda-lidar-rangefinder-playground
linda/Vec2D.py
Python
mit
2,599
#!/bin/python #coding:utf-8 import roomai.games.common class TexasHoldemStatePublic(roomai.games.common.AbstractStatePublic): ''' The public state of TexasHoldem ''' def __init__(self): super(TexasHoldemStatePublic, self).__init__() self.__stage__ = None self.__pub...
roomai/RoomAI
roomai/games/texasholdem/TexasHoldemStatePublic.py
Python
mit
8,028
# -------------------------------------------------------------------------------------- # Copyright 2016, Benedikt J. Daurer, Filipe R.N.C. Maia, Max F. Hantke, Carl Nettelblad # Hummingbird is distributed under the terms of the Simplified BSD License. # ----------------------------------------------------------------...
SPIhub/hummingbird
src/interface/ui/line_plot_settings.py
Python
bsd-2-clause
7,721
from IPython import get_ipython from prompt_toolkit.enums import DEFAULT_BUFFER from prompt_toolkit.filters import HasFocus, ViInsertMode from prompt_toolkit.key_binding.vi_state import InputMode ip = get_ipython() def switch_to_navigation_mode(event): vi_state = event.cli.vi_state vi_state.input_mode = Inp...
mphe/dotfiles
ipython/startup/keybindings.py
Python
mit
583
import json import discord def pp_json(json_thing, sort=True, indents=4): with open('keys.json', 'w') as outfile: if type(json_thing) is str: json.dump(json.loads(json_thing), outfile, sort_keys=sort, indent=indents) else: json.dump(json_thing, outfile, sort_keys=sort, indent...
curiouspiano/BotSep
commands/keys.py
Python
mit
2,355
# the python stuff import sys import math import signal from threading import Lock # numerics import numpy as np # the interface stuff from PyQt4 import QtCore, QtGui import pyqtgraph as pg # the messaging stuff import lcm from mithl import vectorXf_t from lcm_utils import * class DataPlotWidget(QtGui.QWidget): ...
MITHyperloopTeam/software_core
software/UI/data_plot_widget.py
Python
lgpl-3.0
4,783
# Copyright (C) 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 it w...
strahlc/exaile
xlgui/widgets/playlist.py
Python
gpl-2.0
59,205
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Uploads files to Google Storage content addressed.""" import hashlib import optparse import os import Queue import re import st...
HackFisher/depot_tools
upload_to_google_storage.py
Python
bsd-3-clause
9,187
""" edge Detection GPU implementation : SOBEL ALGORITHM @philipchicco """ # cpu host imports from tools.Picture import Picture from tools.edgeDetector_Impl import EdgeDetector import numpy as np import math import string # gpu device imports : NVIDIA CUDA import pycuda.autoinit # memory management import pyc...
PhilipChicco/PyCudaImageProcessing
PyCUDAImageProcessing/gpu/edgeDetector_gpu.py
Python
mit
5,327
from mtools.util.logevent import LogEvent from mtools.util.pattern import json2pattern from base_filter import BaseFilter class LogLineFilter(BaseFilter): """ """ filterArgs = [ ('--namespace', {'action':'store', 'metavar':'NS', 'help':'only output log lines matching operations on NS.'}), ...
corymintz/mtools
mtools/mlogfilter/filters/logline_filter.py
Python
apache-2.0
2,092
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2015 Dirk Beyer 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 ...
bjowac/impara-benchexec
benchexec/tools/aprove.py
Python
apache-2.0
1,440
from django.contrib import admin # Register your models here. from .models import Posts @admin.register(Posts) class PostAdmin(admin.ModelAdmin): list_display = ('id', 'title', 'date', 'str_edu_category', 'str_tags', 'post_category')
ran777/edu_intell
posts/admin.py
Python
gpl-3.0
241
# -*- coding: utf-8 -*- """ *************************************************************************** BarPlot.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com ******************************...
nirvn/QGIS
python/plugins/processing/algs/qgis/PolarPlot.py
Python
gpl-2.0
3,399
# Copyright 2017 Tecnativa - Vicent Cubells <vicent.cubells@tecnativa.com> # Copyright 2018 Camptocamp SA - Julien Coux # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.exceptions import UserError from odoo.tests.common import SavepointCase class TestStockSplitPicking(SavepointCase): @cl...
OCA/stock-logistics-workflow
stock_split_picking/tests/test_stock_split_picking.py
Python
agpl-3.0
4,933
# # 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...
airbnb/airflow
airflow/contrib/hooks/gcp_container_hook.py
Python
apache-2.0
1,567
# (c) 2015, Jonathan Davila <jdavila(at)ansible.com> # # 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, or # (at your option) any late...
goozbach/ansible
lib/ansible/plugins/lookup/hashi_vault.py
Python
gpl-3.0
2,701
import chardet from vint.ast.node_type import NodeType from vint.ast.traversing import traverse, SKIP_CHILDREN from vint.linting.level import Level from vint.linting.policy.abstract_policy import AbstractPolicy from vint.linting.policy_registry import register_policy @register_policy class ProhibitMissingScriptEncod...
RianFuro/vint
vint/linting/policy/prohibit_missing_scriptencoding.py
Python
mit
1,702
from orm import model from orm import fields from .contact import Contact from .user import User class Invoice(model.Model): title = fields.CharField(max_length=200) owner = fields.ForeignKeyField(User) description = fields.CharField(max_length=400, blank=True) contact = fields.ForeignKeyField(Contact, blank=True)...
theikkila/lopputili
app/models/invoice.py
Python
mit
1,277
import sys from pathlib import Path JAR_PATH = Path(__file__).parent if 'win32' == sys.platform: JAVA = Path('/Program Files/Java/jdk1.8.0_40/bin/java.exe') else: JAVA = Path('/usr/bin/java') def available(): return JAVA.is_file()
koceg/gouda
gouda/java/java.py
Python
gpl-2.0
247
# ext/declarative/__init__.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .api import AbstractConcreteBase from .api import as_declarative fr...
graingert/sqlalchemy
lib/sqlalchemy/ext/declarative/__init__.py
Python
mit
844
#### #### Setup gross testing environment. #### #### This currently includes the UI instance target and browser type #### (FF vs PhantomJS). #### import os import time from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities ### ### Simple (but somewhat excessive f...
jmcmurry/monarch-app
tests/behave/environment.py
Python
bsd-3-clause
7,314
# Copyright (c) 2015 RIPE NCC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the h...
danielquinn/ripe-atlas-tools
ripe/atlas/tools/commands/render.py
Python
gpl-3.0
5,730
import json, sys from lxml import etree from models import geo_coords, landmarks from database import get_or_create def insert_data(db): d = etree.parse(open("monumentaltrees.xml", "r+")).getroot() for x in list(d): if x.tag == "m": lat = float(x.attrib['lat']) lng = float(x.attrib['lng']) ...
sellerlink/sellerlink
fixtures/create_monumentaltrees.py
Python
gpl-3.0
725
from mongoengine import * import datetime class ModReq(Document): uid = SequenceField(unique=True) server = StringField(required=True) username = StringField(required=True) request = StringField(required=True) location = StringField(required=True) status = StringField(required=True, choices=[...
JunctionAt/JunctionWWW
models/modreq_model.py
Python
agpl-3.0
686
import math import time t1 = time.time() # read the base & exp into a list f = open('pb099_base_exp.txt','r') bae= f.read().split('\n') f.close() def tonumber(p): number = 0 for i in range(0,len(p)): temp = ord(p[i])-48 number = number*10 + temp return number count = 0 def tobe(bae): ...
Adamssss/projectEuler
Problem 001-150 Python/pb099.py
Python
mit
1,103
# Generated by Django 2.0.2 on 2018-04-11 13:32 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0040_page_draft_title'), ('wagtailforms', '0003_capitalizeverbose'), ('wagtailredirects', '0005_capitalizeverbose'), ('content...
sussexstudent/falmer
falmer/content/migrations/0026_auto_20180411_1432.py
Python
mit
1,068
#!/usr/bin/env python # $Id: FileUtils.py,v 1.12 2005/11/02 22:26:07 tavis_rudd Exp $ """File utitilies for Python: Meta-Data ================================================================================ Author: Tavis Rudd <tavis@damnsimple.com> License: This software is released for unlimited distribution under th...
CymaticLabs/Unity3D.Amqp
lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/Cheetah/FileUtils.py
Python
mit
11,266
# basictimerapp - a really simple timer application. # This should be run using the command line: # pythonwin /app demos\basictimerapp.py import win32ui import win32api import win32con import sys from pywin.framework import app, cmdline, dlgappcore, cmdline import timer import time import string class Time...
zhanqxun/cv_fish
pythonwin/pywin/Demos/app/basictimerapp.py
Python
apache-2.0
6,596
#!/usr/bin/python from math import ceil class OverlapException: pass class OutOfRackException: pass class RackFullException: pass unitsize = 43.5 class Rack(object): def __init__(self, name, attr, units): self._name = name self.units = units self.affinity = "bottom" self._elements = {} self.__att...
jaqx0r/fengshui
rack.py
Python
gpl-2.0
10,254
""" Set up: Works with python 2 or python 3 version miniconda(out of box) Usage: take an input dictionary/json ( all valid inputs) return an dictionary/json ( with one value replaced by string from the xss/sql string file) Note: 'yield' is heavily used, helps to separate test data creation logic from use o...
dmohankudo/APIFuzzing
UtilsLibFuzzing.py
Python
apache-2.0
10,185
import numpy as np def makeRankingForClass(data): index=0 tmp = [] ret = [] for elem in data: tmp.append((elem,index)) index+=1 tmp.sort(key=lambda tup: tup[0], reverse=True) for elem in tmp: ret.append(elem[1]) return ret def makeRankingsForModel(probabilitiesVector): nClasses = probabilitiesVector.sha...
rsboos/DistributedClassifier
src/rankings.py
Python
gpl-3.0
769
# -*- coding: utf-8 -*- import sys import types from .env import ISIS_VERSION from .isiscommand import Isis class ModuleWrapper(Isis, types.ModuleType): def __init__(self, self_module, **kwargs): # this is super ugly to have to copy attributes like this, # but it seems to be the only way to make ...
wtolson/pysis
pysis/isis.py
Python
bsd-3-clause
1,339
# Python Art - Twitter Text Art # # This code generates Python Turtle text from a Twitter feed # # The project has been inspired and helped through lots of examples and questions on forums or websites including: # http://stackoverflow.com/questions/743806/split-string-into-a-list-in-python # http://stackoverflow.co...
familysimpson/PythonArt
TwitterTextArt-github.py
Python
cc0-1.0
2,497
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function, unicode_literals from oucfeed.crawler import util from oucfeed.crawler.newsspider import NewsSpider class Spider(NewsSpider): """医药学院 这个网站的内容页链接尾部有一些奇怪的东西 党团相关的内容在另一个网站 http://222.195.158.131/yiyaodtgz/ """ ...
D6C92FE5/oucfeed.crawler
oucfeed/crawler/spiders/yuanxi_yi_yao.py
Python
mit
1,670
from urllib import request import re from bs4 import BeautifulSoup # Search google, match links by regex, return the links, integration functions get names from links """ Function to return links from google search https://github.com/aviaryan/pythons/blob/master/Others/GoogleSearchLinks.py """ def googleSearchLinks(se...
iiitv/hackathon-fullstack-server
fullstackserver/api/integrations/googlesearch.py
Python
apache-2.0
1,060
# -*- coding: utf-8 -*- """ productporter.utils.helper ~~~~~~~~~~~~~~~~~~~~ A module that makes creating data more easily :copyright: (c) 2014 by the ProductPorter Team. :license: BSD, see LICENSE for more details. """ import datetime, time from markdown2 import markdown as render_markdown from f...
kamidox/weixin_producthunt
productporter/utils/helper.py
Python
bsd-2-clause
7,440
"""Tests for http-proxy UI component. :Requirement: HttpProxy :CaseLevel: Acceptance :CaseComponent: Repositories :Assignee: jpathan :TestType: Functional :CaseImportance: High :CaseAutomation: Automated :Upstream: No """ import pytest from fauxfactory import gen_integer from fauxfactory import gen_string from ...
lpramuk/robottelo
tests/foreman/ui/test_http_proxy.py
Python
gpl-3.0
7,372
__author__ = 'Madison' from flask import Flask app = Flask(__name__) from app import views # # print 'i am doing something' # from flask import Flask # # import app.config # # import os.path # # import app.db_controller # # print 'dir of flask: ', dir(Flask) # # # # # if not os.path.isfile(config.DATABASE_LOC): ...
jakemadison/v2
app/__init__.py
Python
mit
591
# # 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 us...
rangadi/beam
sdks/python/apache_beam/examples/complete/game/leader_board.py
Python
apache-2.0
13,517
import numpy as np from numpy import linalg as la from numpy import testing as np_testing from pymanopt.manifolds import FixedRankEmbedded from .._test import TestCase class TestFixedRankEmbeddedManifold(TestCase): def setUp(self): self.m = m = 10 self.n = n = 5 self.k = k = 3 se...
pymanopt/pymanopt
tests/test_manifolds/test_fixed_rank.py
Python
bsd-3-clause
7,028
# -*- coding: utf-8 -*- """ celery.local ~~~~~~~~~~~~ This module contains critical utilities that needs to be loaded as soon as possible, and that shall not load any third party modules. Parts of this module is Copyright by Werkzeug Team. """ from __future__ import absolute_import import im...
hubert667/AIR
build/celery/celery/local.py
Python
gpl-3.0
8,770
from mock import patch from bravado_core.param import cast_request_param @patch('bravado_core.param.log') def test_logs_cast_failure(mock_logger): cast_request_param('integer', 'gimme_int', 'not_int') assert mock_logger.warn.call_count == 1 @patch('bravado_core.param.log') def test_cast_failures_return_unt...
analogue/bravado-core
tests/param/cast_request_param_test.py
Python
bsd-3-clause
1,372
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that a dependency on two gyp files with the same name do not create a uid collision in the resulting generated xcode file. """ ...
ibc/MediaSoup
worker/deps/gyp/test/same-gyp-name/gyptest-library.py
Python
isc
435
# stdlib from collections import defaultdict from Queue import Empty, Queue import threading import time # project from checks import AgentCheck from checks.libs.thread_pool import Pool from config import _is_affirmative TIMEOUT = 180 DEFAULT_SIZE_POOL = 6 MAX_LOOP_ITERATIONS = 1000 FAILURE = "FAILURE" class Status...
amalakar/dd-agent
checks/network_checks.py
Python
bsd-3-clause
8,122
"""Matrix equation solver routines""" # Author: Jeffrey Armstrong <jeff@approximatrix.com> # February 24, 2012 import numpy as np from numpy.linalg import inv, LinAlgError from basic import solve from lapack import get_lapack_funcs from decomp_schur import schur from special_matrices import kron __all__ = ['solve_s...
teoliphant/scipy
scipy/linalg/_solvers.py
Python
bsd-3-clause
7,110
#!/usr/bin/python2 from info import __version__, __desc__
leosartaj/tvstats
tvstats/__init__.py
Python
mit
59
# # 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 us...
mahak/spark
examples/src/main/python/ml/pipeline_example.py
Python
apache-2.0
2,607
# -*- coding: utf-8 -*- DEFAULT_CONFIG_PARAMS = { "development_mode": True, "database": { "user": "postgres", "pass": "matusjeuzasny", "name": "gold-digger", "host": "127.0.0.1", "port": "5432", "dialect": "postgres" }, "graylog": { "address": "lo...
dorotapalicova/GoldDigger
gold_digger/config/params.py
Python
apache-2.0
1,943
from django.apps import AppConfig class FluentAppConfig(AppConfig): name = "fluent" def ready(self): from django.core.signals import request_finished, request_started from fluent.trans import ensure_threads_join, invalidate_caches_if_necessary request_finished.connect(ensure_threads_...
potatolondon/fluent-2.0
fluent/apps.py
Python
mit
487
#!/usr/bin/python import pygame as pg from pygame.locals import * from constantes_PunchinBall import * # from constantesDataStream import * import os import sys import signal from subprocess import Popen, PIPE from subprocess import call from threading import Thread from sys import platform from tempfile import Tempor...
zeta-technologies/tests-raspberry
gamePunchinBall.py
Python
apache-2.0
33,427
# Copyright 2020-2021 The MediaPipe 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
google/mediapipe
mediapipe/python/solutions/pose.py
Python
apache-2.0
7,781
#!/usr/bin/env python # -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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...
virantha/airframe
docs/conf.py
Python
apache-2.0
8,385
# # Copyright 2016 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
bartosh/zipline
tests/test_bar_data.py
Python
apache-2.0
45,350
from setuptools import setup version = '1.0.0' setup( name='chanGenerator', version=version, description='generate changelog for your github repository based on closed issues', long_description=open('README.md').read(), author='Pratyush Verma', keywords="github changelog git command-line cli",...
p-v/chanGenerator
setup.py
Python
mit
404
import unittest import json import flask import friendsNet.resources as resources import friendsNet.database as database DB_PATH = 'db/friendsNet_test.db' ENGINE = database.Engine(DB_PATH) COLLECTION_JSON = "application/vnd.collection+json" COMMENT_PROFILE = "/profiles/comment-profile" #Tell Flask that I am running...
Diiaablo95/friendsNet
test/services_api_test_user_comments.py
Python
gpl-3.0
6,705
from django.conf import settings from django.db import models class DeploymentManager(models.Manager): def get_last_id(self): return super(DeploymentManager, self).get_queryset().count() # def get_sensor_config_not_assigned(self): # return Deployment.objects.filter(platform_id='').first() ...
cloudcomputinghust/IoT
co-ordinator/api/models.py
Python
mit
1,691
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
tensorflow/agents
tf_agents/replay_buffers/reverb_replay_buffer_test.py
Python
apache-2.0
20,280
"""Utility for testing certificate display. This command will create a fake certificate for a user in a course. The certificate will display on the student's dashboard, but no PDF will be generated. Example usage: $ ./manage.py lms create_fake_cert test_user edX/DemoX/Demo_Course --mode honor --grade 0.89 """ ...
jolyonb/edx-platform
lms/djangoapps/certificates/management/commands/create_fake_cert.py
Python
agpl-3.0
3,745
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.apps import AppConfig class PympaAffariGeneraliConfig(AppConfig): name = 'pympa_affarigenerali' verbose_name = 'Affari Generali'
simodalla/pympa-affarigenerali
pympa_affarigenerali/apps.py
Python
bsd-3-clause
233
from __future__ import unicode_literals from django.apps import AppConfig class TwitterhutConfig(AppConfig): name = 'twitterhut'
kingsdigitallab/kdl-django
twitterhut/apps.py
Python
mit
136
#!/usr/bin/env python """ @package mi.dataset.parser.issmcnsm_dostad @file marine-integrations/mi/dataset/parser/issmcnsm_dostad.py @author Emily Hahn @brief Parser for the issmcnsm_dosta dataset driver Release notes: Initial release """ __author__ = 'Emily Hahn' __license__ = 'Apache 2.0' import copy import re imp...
ooici/marine-integrations
mi/dataset/parser/issmcnsm_dostad.py
Python
bsd-2-clause
12,802
''' Created by auto_sdk on 2015.04.24 ''' from top.api.base import RestApi class TradeAmountGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.fields = None self.tid = None def getapiname(self): return 'taobao.trade.amount.get'
colaftc/webtool
top/api/rest/TradeAmountGetRequest.py
Python
mit
317
# Create Windows executable for cmongo2sql using # Py2Exe module - http://www.py2exe.org # Usage: python create_exe.py py2exe from distutils.core import setup import py2exe setup( options = {'py2exe': {'bundle_files': 1}}, console = ['cmongo2sql.py'], zipfile = None, )
stpettersens/cmongo2sql
create_exe.py
Python
mit
283
from __future__ import division, absolute_import, print_function import warnings import numpy as np from numpy.core import (array, arange, atleast_1d, atleast_2d, atleast_3d, block, vstack, hstack, newaxis, concatenate, stack) from numpy.testing import (TestCase, assert_, assert_raises, ...
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/numpy/core/tests/test_shape_base.py
Python
mit
18,544
from setuptools import setup import sys revision = None # must match PEP 440 _MAJOR_VERSION = 0 _MINOR_VERSION = 5 _MICRO_VERSION = None _PRE_RELEASE_TYPE = 'a' # a | b | rc _PRE_RELEASE_VERSION = 5 _DEV_RELEASE_VERSION = None version = '{}.{}'.format(_MAJOR_VERSION, _MINOR_VERSION...
datamachine/twx
setup.py
Python
mit
1,804
#!/usr/bin/env python2 # coding: utf8 from __future__ import print_function import json import itertools import optparse import os import random import re import sys from .utilities import unicode_dammit, persistently_apply default_config = os.path.join(os.path.dirname(__file__), 'config_data.json') def load_conf...
johntyree/rio
rio/config.py
Python
gpl-3.0
7,576
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # Frederic Mohier, frederic.mohier@gmail.com # # This file is part of Shink...
rednach/mod-webui
module/plugins/contacts/contacts.py
Python
agpl-3.0
1,687
# -*- encoding: utf-8 -*- from fabric.api import ( local, run, ) from fabric.context_managers import shell_env from lib.error import TaskError def _db_host(site_info): result = '' if site_info.db_host: result = ' --host={} '.format(site_info.db_host) return result def _pg_data_database(...
pkimber/fabric
lib/postgres.py
Python
apache-2.0
5,864
######## # Copyright (c) 2014 GigaSpaces Technologies 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 the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
cdntn/cloudify-ansible-plugin
ansible_plugin/utils.py
Python
apache-2.0
4,759
# Copyright 2015-2021 D.G. MacCarthy <https://dmaccarthy.github.io/sc8pr> # # This file is part of "sc8pr". # # "sc8pr" 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...
dmaccarthy/sc8pr
sc8pr/robot/gui.py
Python
gpl-3.0
2,064
#!/usr/bin/python import os, sys import gzip import json import gsutil from path import Path as path from collections import defaultdict from check_schema_tracking_log import schema2dict, check_schema from load_course_sql import find_course_sql_dir def mongo_dump_user_info_files(course_id, basedir=None, datedir=Non...
mitodl/edx2bigquery
edx2bigquery/fix_missing_user_info.py
Python
gpl-2.0
3,875
# -*- coding: utf-8 -*- from importlib import reload import sys sys.path.append("src/models") import os import shutil import glob import fileinput import keras as ke import Model reload(Model) import Model as ModModule import matplotlib.pyplot as plt import pandas as pd import os #%% class Run(ModModule.Model):...
hstorm/nn_spatial
src/models/ModRun.py
Python
mit
3,255
import numpy as np #Evaluate the linear regression def compute_cost(X, y, theta): ''' Comput cost for linear regression ''' #Number of training samples m = y.size predictions = X.dot(theta).flatten() sqErrors = (predictions - y) ** 2 J = (1.0 / (2 * m)) * sqErrors.sum() return J ...
matrixorz/ut_ali
ut_engine/LR/linregr.py
Python
mit
967
import threading import time from unittest import mock from multiple_database.routers import TestRouter from django.core.exceptions import FieldError from django.db import ( DatabaseError, NotSupportedError, connection, connections, router, transaction, ) from django.test import ( TransactionTestCase, ove...
georgemarshall/django
tests/select_for_update/tests.py
Python
bsd-3-clause
18,931
""" hybrid.py: IRCD-Hybrid protocol module for PyLink. """ import time from pylinkirc import conf from pylinkirc.classes import * from pylinkirc.log import log from pylinkirc.protocols.ts6 import TS6Protocol __all__ = ['HybridProtocol'] # This protocol module inherits from the TS6 protocol. class HybridProtocol(TS...
GLolol/PyLink
protocols/hybrid.py
Python
mpl-2.0
12,742
""" This algorithm receives an array and returns most_frequent_value Also, sometimes it is possible to have multiple 'most_frequent_value's, so this function returns a list. This result can be used to find a representative value in an array. This algorithm gets an array, makes a dictionary of it, finds the most freq...
keon/algorithms
algorithms/arrays/top_1.py
Python
mit
959
# -*- coding: utf-8 -*- import pytest import sys import time from .test_base_class import TestBaseClass from aerospike import exception as e aerospike = pytest.importorskip("aerospike") try: import aerospike except: print("Please install aerospike python client.") sys.exit(1) @pytest.mark.usefixtures("c...
aerospike/aerospike-client-python
test/new_tests/test_admin_drop_user.py
Python
apache-2.0
7,293
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
Azure/azure-sdk-for-python
sdk/edgegateway/azure-mgmt-edgegateway/azure/mgmt/edgegateway/models/share_access_right_py3.py
Python
mit
1,500
import unittest from assertutil import get_assert_tuple_args from binder import * from bindertest.testdbconfig import connect from bindertest.tabledefs import Foo, Bar foo1 = Foo.new(foo_id=1, i1=101, s1="alpha") foo2 = Foo.new(foo_id=2, i1=101, s1="beta") class ConnSelectByIdTest(unittest.TestCase): def se...
divtxt/binder
bindertest/test_select_by_id.py
Python
mit
2,327
from __future__ import absolute_import, unicode_literals import sys from django.utils.importlib import import_module from appconf import AppConf class EventsAppConf(AppConf): MODEL = None class Meta: required = ['MODEL'] def configure_model(self, value): module_name, dot, class_name =...
aptivate/djangocms_events
djangocms_events/conf.py
Python
gpl-3.0
589
from ert.test import TestRun from ert.test import path_exists from ert.test import SourceEnumerator from ert.test import TestArea , TestAreaContext from ert.test import ErtTestRunner from ert.test import PathContext from ert.test import LintTestCase from ert.test import ImportTestCase from tests import EclTest class...
Statoil/libecl
python/tests/legacy_tests/test_test.py
Python
gpl-3.0
358
# -*- encoding: utf-8 -*- ############################################################################## # # Avanzosc - Avanced Open Source Consulting # Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com> # # This program is free software: you can redistribute it and/or modify # it under the terms ...
avanzosc/avanzosc6.1
avanzosc_sale_mrp_wk/sale_mrp.py
Python
agpl-3.0
5,948
import logging from decimal import Decimal from typing import Any, Dict, Optional from urllib.parse import urlencode, urljoin, urlunsplit from django import forms from django.conf import settings from django.core import signing from django.db import transaction from django.http import HttpRequest, HttpResponse, HttpRe...
hackerkid/zulip
corporate/views/upgrade.py
Python
apache-2.0
9,828
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2018: # Matthieu Estrada, ttamalfor@gmail.com # # This file is part of (AlignakApp). # # (AlignakApp) 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 Sof...
Alignak-monitoring-contrib/alignak-app
test/test_all_items.py
Python
agpl-3.0
12,482
""" Fun facts about the St. Jude Memphis Marathons. Data retrieved from: https://www.stjude.org/get-involved/at-play/fitness-for-st-jude/memphis-marathon/participants/results.html """ import locale import sys from statistics import mean, median, mode, StatisticsError from collections import Counter import tablib im...
bradmontgomery/st-jude-marathon
marathon_details.py
Python
mit
6,815
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
SUSE/azure-sdk-for-python
azure-keyvault/azure/keyvault/models/key_item.py
Python
mit
1,644
import tempfile from config import * from caffe.proto import caffe_pb2 as PB def create_solver(solver_param, file_name=""): if file_name: f = open(file_name, 'w') else: f = tempfile.NamedTemporaryFile(mode='w+', delete=False) f.write(str(solver_param)) f.close() solver = caffe.get_s...
MPI-IS/bilateralNN
bilateralnn_code/examples/tile_segmentation/create_solver.py
Python
bsd-3-clause
1,529
""" Core Linear Algebra Tools ========================= =============== ========================================================== Linear algebra basics ========================================================================== norm Vector or matrix norm inv Inverse of a square matrix solve ...
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/numpy/linalg/__init__.py
Python
agpl-3.0
2,178
# -*- coding: utf-8 -*- ''' Video Uav Tracker v 2.0 Replay a video in sync with a gps track displayed on the map. ------------------- copyright : (C) 2017 by Salvatore Agosta email : sagost@katamail.com This program is free software; you can redistribute it and/or mod...
sagost/VideoUavTracker
vut_qgismap.py
Python
gpl-2.0
13,143
# Copyright 2016 Sean Dague # # 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, so...
sdague/arwn
arwn/temperature.py
Python
apache-2.0
2,776