code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
import gdbremote_testcase from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestGdbRemoteSegFault(gdbremote_testcase.GdbRemoteTestCaseBase): mydir = TestBase.compute_mydir(__file__) GDB_REMOTE_STOP_CODE_BAD_ACCESS = 0x91 @skipIfDarw...
endlessm/chromium-browser
third_party/llvm/lldb/test/API/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py
Python
bsd-3-clause
1,724
class DuplicateEntryError(Exception): def __init__(self, value): self.parameter = value def __str__(self): return repr(self.parameter) class ResourceError(Exception): def __init__(self, value): self.parameter = value def __str__(self): return repr(self.parameter) class...
seantauber/Psycloud
custom_exceptions.py
Python
gpl-2.0
469
# Neural network layers (or function nodes) # Includes an in-memory data layer, label layer, convolution, pooling, dropout, and other popular operations. Also includes cross-entropy, softmax, hinge, and squared loss layers. # Author: Sameh Khamis (sameh@umiacs.umd.edu) # License: GPLv2 for non-commercial research pu...
samehkhamis/pydeeplearn
pydeeplearn/core/layers.py
Python
gpl-2.0
25,826
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010 by Joel Andersson, Moritz Diehl, K.U.Leuven. All rights reserved. # # CasADi is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Pub...
jgillis/casadi
experimental/joel/rocket_example.py
Python
lgpl-3.0
3,956
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import itertools import logging from functools import partial from itertools import repeat from lxml import etree from lxml.builder import E import openerp from openerp import api from openerp import SUPERUSER_ID, model...
syci/OCB
openerp/addons/base/res/res_users.py
Python
agpl-3.0
46,553
""" Context dictionary for templates that use the ace_common base template. """ from __future__ import absolute_import from django.conf import settings from django.core.urlresolvers import NoReverseMatch from django.urls import reverse from edxmako.shortcuts import marketing_link from openedx.core.djangoapps.theming....
ESOedX/edx-platform
openedx/core/djangoapps/ace_common/template_context.py
Python
agpl-3.0
1,658
from flask import ( Flask, escape, flash, request, jsonify, redirect, url_for, render_template, send_file, ) import numpy as np import os from sklearn.externals import joblib knn = joblib.load("knn.pkl") app = Flask(__name__) @app.route("/") def hello(): print("Started hello")...
Diyago/Machine-Learning-scripts
deployment/docker flask fit predict/hello.py
Python
apache-2.0
4,068
# Copyright (c) 2015 Cloudbase Solutions SRL # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
NetApp/manila
manila/tests/share/drivers/windows/test_windows_smb_helper.py
Python
apache-2.0
16,797
from xml.dom.minidom import parseString from xml.dom import minidom from MocNode import MocNode import os import sys radioTypes = ['GSM', 'UMTS', 'TD', 'AG', 'MCE'] def getMocOrder(path): files = os.listdir(path) for afile in files: if afile.lower().endswith("-mocinfo-sdrm.xml"): mocinfoX...
liyueshining/moon
mocorderconverter/MocOrder.py
Python
mit
4,028
from django.core.management.base import BaseCommand, CommandError from mangaki.models import Work, Rating from django.db import connection from django.db.models import Count from collections import Counter import sys class Command(BaseCommand): args = '' help = 'Lookup some work' def handle(self, *args, ...
RaitoBezarius/mangaki
mangaki/mangaki/management/commands/lookup.py
Python
agpl-3.0
616
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [] operations = [ migrations.CreateModel( name="DailyCount", fields=[ ("id", models.AutoField(verbos...
praekelt/casepro
casepro/statistics/migrations/0001_initial.py
Python
bsd-3-clause
884
from django.db import models from django.contrib.auth.models import User from django.utils.encoding import python_2_unicode_compatible class ActiveProfileManager(models.Manager): def get_queryset(self): return super(ActiveProfileManager, self).get_queryset().filter(user__is_active=Tru...
kaka0525/Copy-n-Haste
CopyHaste/cnh_profile/models.py
Python
mit
906
# # Copyright ยฉ 2012 - 2021 Michal ฤŒihaล™ <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
phw/weblate
weblate/fonts/tests/test_views.py
Python
gpl-3.0
3,012
# Copyright 2007 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
mozilla/popcorn_maker
vendor-local/lib/python/whoosh/query/qcore.py
Python
bsd-3-clause
23,233
from django.conf import settings from django.contrib import admin from wagtail.documents.models import Document if hasattr(settings, 'WAGTAILDOCS_DOCUMENT_MODEL') and settings.WAGTAILDOCS_DOCUMENT_MODEL != 'wagtaildocs.Document': # This installation provides its own custom document class; # to avoid confusio...
zerolab/wagtail
wagtail/documents/admin.py
Python
bsd-3-clause
446
# -*- coding: utf-8 -*- #Stage 2 Update (Python 3) from __future__ import unicode_literals from builtins import str from builtins import map from builtins import range import ast, datetime, importlib, json, logging, scrapy from jsonpath_rw import jsonpath, parse from jsonpath_rw.lexer import JsonPathLexerError from s...
holgerd77/django-dynamic-scraper
dynamic_scraper/spiders/django_spider.py
Python
bsd-3-clause
40,962
#------------------------------------------------------------------------------ # Name: pychrono example # Purpose: # # Author: Lijing Yang # # Created: 6/12/2020 # Copyright: (c) ProjectChrono 2019 #------------------------------------------------------------------------------ import pychrono.core ...
rserban/chrono
src/demos/python/irrlicht/demo_IRR_custom_contact.py
Python
bsd-3-clause
8,891
# This file is part of puppet-panel. # # puppet-panel 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. # # puppet-panel is distributed i...
ybulach/puppet-panel
puppet/serializers.py
Python
lgpl-3.0
9,664
#coding=utf-8 """ Algorithms about probability Author: ๆฎตๅ‡ฏๅผบ """ import math def entropyOfList(ls): """ Given a list of some items, compute entropy of the list The entropy is sum of -p[i]*log(p[i]) for every unique element i in the list, and p[i] is its frequency """ elements = {} for e in ls: ...
dnlp/ChineseWordSegmentation
probability.py
Python
mit
481
# -*- coding: utf-8 -*- """ Created on Mon Mar 9 10:06:20 2015 @author: jpk ToDo: automate the subsystems check. A query that checks all the subsystems in case things change in the future should prevent issues with the pis chart colours """ import sys import os import pandas as pd import pandas.io.sql as psql impor...
dr-jpk/saltefficiency
weekly/weekly_summary_plots.py
Python
bsd-3-clause
8,536
"""Added index for itemrevision created_date Revision ID: 6b9d673d8e30 Revises: 2ea41f4610fd Create Date: 2016-04-01 09:39:35.148502 """ # revision identifiers, used by Alembic. revision = '6b9d673d8e30' down_revision = '2ea41f4610fd' from alembic import op import sqlalchemy as sa def upgrade(): op.create_ind...
stackArmor/security_monkey
migrations/versions/6b9d673d8e30_added_index_for_itemrevision_created.py
Python
apache-2.0
499
# -*- coding: utf-8 -*- """Class to trap stdout and stderr and log them separately. $Id: OutputTrap.py 958 2005-12-27 23:17:51Z fperez $""" #***************************************************************************** # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu> # # Distributed under the ter...
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/ipython-0.8.2-py2.5.egg/IPython/OutputTrap.py
Python
bsd-3-clause
8,014
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015 Rasmus Sorensen, rasmusscholer@gmail.com <scholer.github.io> ## 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, eit...
scholer/ezfetcher
ezfetcher/utils.py
Python
gpl-3.0
4,644
"""The tests for the MQTT binary sensor platform.""" import unittest from homeassistant.bootstrap import setup_component import homeassistant.components.binary_sensor as binary_sensor from tests.common import mock_mqtt_component, fire_mqtt_message from homeassistant.const import (STATE_OFF, STATE_ON) from tests.comm...
xifle/home-assistant
tests/components/binary_sensor/test_mqtt.py
Python
mit
2,858
# PROPKA 3.1 # # # setuptools installation of PROPKA 3.1 import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages VERSION = "3.1" setup(name="PROPKA", version=VERSION, description="Heuristic pKa calculations with ligands", long_description=""" PROPKA predicts the pKa v...
vanarbulax/propka-3.1
setup.py
Python
lgpl-2.1
1,771
from dstack import type_manager class ResponseHolder: def __init__(self): self._responses = [] self.priority = type_manager.PRIORITY_PRE def clear(self): self._responses = [] def publish(self, resp): self._responses = resp def list(self): return self._respons...
ibuildthecloud/dstack
code/agent/src/agents/pyagent/tests/response_holder.py
Python
apache-2.0
465
__source__ = 'https://leetcode.com/problems/asteroid-collision/' # Time: O(N) # Space: O(N) # # Description: Leetcode # 735. Asteroid Collision # # We are given an array asteroids of integers representing asteroids in a row. # # For each asteroid, the absolute value represents its size, # and the sign represents its d...
JulyKikuAkita/PythonPrac
cs15211/AsteroidCollision.py
Python
apache-2.0
3,884
#=============================================================================== # Copyright (c) 2015, Max Zwiessele # 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...
avehtari/GPy
GPy/plotting/plotly_dep/plot_definitions.py
Python
bsd-3-clause
15,302
import fluiddb import unittest class FluiddbTest(unittest.TestCase): def test_fluiddb_call(self): """this test will test fluiddb call""" status, result = fluiddb.call('GET', '/objects', query='fluiddb/users/username = "igorgue"') assert status == 200 assert result == {u'ids': [u'71d...
igorgue/fluiddb
fluiddb/test/test_fluiddb.py
Python
apache-2.0
405
#!/usr/bin/env python3 from math import ceil from collections import Counter def minTime(machines, goal): c = Counter(machines) fastest = min(c) min_days = 1 max_days = ceil((fastest*goal)/c[fastest]) while max_days - min_days > 1: mid = (min_days + max_days) // 2 output = sum((mid...
CajetanP/coding-exercises
HackerRank/Interview/Searching/min_time.py
Python
mit
582
# -*- coding: UTF-8 -*- # Copyright 2009-2015 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) """Generates 20 fictive sales invoices, distributed over more than one month. """ from __future__ import unicode_literals from django.conf import settings from lino.utils impor...
lino-framework/xl
lino_xl/lib/sales/fixtures/unused_demo.py
Python
bsd-2-clause
1,912
# -*- coding: utf-8 -*- # Copyright (c) 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
ipanova/pulp_puppet
pulp_puppet_extensions_admin/test/unit/extensions/admin/repo/test_remove.py
Python
gpl-2.0
1,803
# referenciacatastral.py - functions for handling Spanish real state ids # coding: utf-8 # # Copyright (C) 2016 David Garcรญa Garzรณn # Copyright (C) 2016-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as publish...
holvi/python-stdnum
stdnum/es/referenciacatastral.py
Python
lgpl-2.1
4,360
"""Jabber related classes""" __revision__ = "" import jcl.model.account as account from jcl.model.account import Account class Handler(object): """handling class""" def __init__(self, component): """Default Handler constructor""" self.component = component def filter(self, stanza, lang_c...
dax/jcl
src/jcl/jabber/__init__.py
Python
lgpl-2.1
2,413
from handlers.auth_handler import LoginHandler, LogoutHandler, SignupHandler from handlers.index_handler import IndexHandler from handlers.user_handler import UsersHandler, UserHandler from handlers.group_handler import GroupsHandler, GroupHandler, GroupUserHandler, GroupEditHandler, GroupMemberAdditionHandler, GroupDe...
Hironsan/Brain_Hacker
urls.py
Python
mit
1,719
#!/usr/bin/env python # -*- coding:utf-8 -*- """ This module provides the support of CSV file for araisan. """ import sys import csv class CSVWriter: """ CSV Writer """ def __init__(self, datatarget, config): """ Init CSVWriter with datatarget and config """ self.__cs...
moeoverflow/Araisan
araisan/Writer/CSVWriter.py
Python
mit
616
import sys def main(): import argparse import redis import time import pickle import traceback import tldextract from scutils.redis_queue import RedisPriorityQueue from scutils.redis_throttled_queue import RedisThrottledQueue parser = argparse.ArgumentParser(description="Scrapy ...
quixey/scrapy-cluster
migrate.py
Python
mit
3,812
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields import django.contrib.gis.db.models.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Address'...
garnertb/firecares
firecares/firecares_core/migrations/0001_initial.py
Python
mit
2,028
import sublime import sublime_plugin import subprocess import threading class PicoRunCartCommand(sublime_plugin.TextCommand): def run(self, edit): def target(): subprocess.Popen(self.cmd, bufsize=-1, stdin=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) pico8 = "\"" + self.view.settings().get("pico-8_pat...
Neko250/sublime-PICO-8
pico_run_cart.py
Python
mit
630
import os from setuptools import setup version = '0.2' description = "A command-line tool for identification and Extraction of Variant Attributes." cur_dir = os.path.dirname(__file__) requirements = open(os.path.join(cur_dir, 'REQUIREMENTS')).read() try: long_description = open(os.path.join(cur_dir, 'README.rst'...
Matteodigg/iEVA
setup.py
Python
mit
835
# -*- coding: utf-8 -*- from django.db import models # Create your models here. class Category(models.Model): class Meta: verbose_name = 'category' verbose_name_plural = 'categories' ordering = ['created_at'] name = models.CharField(max_length=50) description = models.TextField...
Brunux/shityjobs
categories/models.py
Python
mit
435
########################################################################### # # Copyright (c) 2015 Adobe Systems Incorporated. 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 Licens...
adobe-research/spark-gpu
src/rdd.py
Python
apache-2.0
97,723
# linker.py 12/05/2015 D.J.Whale # # A placeholder for an object linker # # Planned features # process import tables # process export tables # list import tables # list export tables # fixup external addresses # create an absolute object file for loading # link from object files # link from library fi...
whaleygeek/MyLittleComputer
src/python/linker.py
Python
mit
567
from gi.repository import Gtk from gmusic.windows import WithMenu, LoginWindow from gmusic.user import User class MainWindow(Gtk.Window, WithMenu): def __init__(self): Gtk.Window.__init__(self, title="GMusic") self.set_default_size(800, 400) self.box = Gtk.Box(orientation=Gtk.Orientation.VE...
nirix-old/gmusic
gmusic/windows/main.py
Python
gpl-3.0
771
# Copyright (C) 2015 JWCrypto Project Contributors - see LICENSE file from jwcrypto.common import JWException from jwcrypto.common import JWSEHeaderParameter, JWSEHeaderRegistry from jwcrypto.common import base64url_decode, base64url_encode from jwcrypto.common import json_decode, json_encode from jwcrypto.jwa import ...
simo5/jwcrypto
jwcrypto/jws.py
Python
lgpl-3.0
23,635
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import SimpleTestCase from localflavor.it.forms import ( ITZipCodeField, ITRegionSelect, ITRegionProvinceSelect, ITSocialSecurityNumberField, ITVatNumberField, ITPhoneNumberField) # import calculated data structures from localf...
zarelit/django-localflavor
tests/test_it.py
Python
bsd-3-clause
9,354
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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...
harwee/electrum-xvg-tor
lib/transaction.py
Python
gpl-3.0
29,682
# Copyright (c) 2019 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # based on http://protips.readthedocs.io/link-roles.html from __future__ import print_function from __future__ import unicode_literals import re from docutils import nodes from local_util import run_cmd_get_output def get_github_rev(): ...
ldts/zephyr
doc/extensions/zephyr/link-roles.py
Python
apache-2.0
1,423
""" When squirrels get together for a party, they like to have cigars. A squirrel party is successful when the number of cigars is between 40 and 60, inclusive. Unless it is the weekend, in which case there is no upper bound on the number of cigars. Return True if the party with the given values is successful, or Fal...
UWPCE-PythonCert/IntroPython2016
students/baumel/session_06/cigar_party.py
Python
unlicense
579
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import unittest import api_schema_graph from availability_finder import AvailabilityFinder, AvailabilityInfo from ...
boundarydevices/android_external_chromium_org
chrome/common/extensions/docs/server2/availability_finder_test.py
Python
bsd-3-clause
15,139
from sqlalchemy import * from sqlalchemy.ext.declarative import * from sqlalchemy.orm import sessionmaker class DataAccess(): def __init__(self): self.engine = create_engine('mysql+pymysql://root:root@localhost:3306/votaapp?charset=utf8', encoding='utf-8') base = declarative_base() base....
villegabriel/votaapp
clases/data/DataAccess.py
Python
gpl-3.0
642
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
imsut/commons
src/python/twitter/common/http/__init__.py
Python
apache-2.0
993
import os from string import Template from PyQt4.QtCore import QUrl def get_template(name): """ Return a string Template for the given html file :param name: The name of the template to return :return: a string Template """ html = os.path.join(os.path.dirname(__file__), "{}.html".format(name))...
lmotta/Roam
src/roam/templates/__init__.py
Python
gpl-2.0
474
#!/usr/bin/env python # coding:utf-8 # by Samuel Chen import sys import os import time import subprocess from cStringIO import StringIO import pycurl import urllib import json from collections import namedtuple from sqlalchemy import create_engine from email import Email import setting_watch_dog as setting os.chdir...
samuelchen/server-monitor
watch-dog.py
Python
gpl-2.0
15,308
""" Taken from https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open import pathlib SETUP_PY_DIRECTORY = pathlib.Path(__file__).resolve().parent # Get the long description from the README...
kiwicom/iwant-bot
setup.py
Python
mit
3,191
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-03-17 02:21 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migration...
tsadm/webapp
src/tsadmuser/migrations/0001_initial.py
Python
bsd-3-clause
896
#!/usr/bin/env python # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from __future__ import print_function from twisted.spread import pb from twisted.internet import reactor from twisted.cred import credentials class Client(pb.Referenceable): def remote_print(self, message): pri...
EricMuller/mywebmarks-backend
requirements/twisted/Twisted-17.1.0/docs/core/howto/listings/pb/chatclient.py
Python
mit
1,425
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2007 Oliver Charles # Copyright (C) 2007-2011 Philipp Wolfer # Copyright (C) 2007, 2010, 2011 Lukรกลก Lalinskรฝ # Copyright (C) 2011 Michael Wiencek # Copyright (C) 2011-2012 Wieland Hoffmann # Copyright (C) 2013-2014 Laurent Monin ...
jvoegele/picard
picard/coverart/__init__.py
Python
gpl-2.0
8,616
# -*- test-case-name: twisted.test.test_log -*- # Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Fo...
fxia22/ASM_xf
PythonD/site_python/twisted/python/log.py
Python
gpl-2.0
10,155
# Copyright (C) 2011-2014 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...
adam-iris/mailman
src/mailman/rest/addresses.py
Python
gpl-3.0
7,993
from setuptools import find_packages, setup setup( name="test", version="0.1", packages=find_packages(), entry_points={ "console_scripts": ["python2_test = python2_test_package.__main__:main"] }, )
chipaca/snapcraft
tests/spread/plugins/v1/python/snaps/python-entry-point/python2/setup.py
Python
gpl-3.0
227
# -*- coding: utf-8 -*- # Unittests for fixtures. from __future__ import absolute_import import os import re try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.core import management from django.core.management.base import CommandError from django.core.management...
mixman/djangodev
tests/regressiontests/fixtures_regress/tests.py
Python
bsd-3-clause
21,754
# Generated by Haxe 3.3.0 import matplotlib.pyplot as matplotlib_pyplot_Pyplot_Module import pandas as pandas_Pandas_Module import seaborn as seaborn_Seaborn_Module class Script: __slots__ = () @staticmethod def main(): seaborn_Seaborn_Module.set_style("dark") housing_2013 = pandas_Panda...
ustutz/dataquest
Data_Analyst/Step_7_Python_Applications/Python_for_Business_Analysts/1_Introduction_to_Pandas/8_Practice_histograms/script.py
Python
mit
629
import unittest from test.test_support import requires import Tkinter as tk from Tkinter import Text as tkText from idlelib.idle_test.mock_tk import Text as mkText from idlelib.IdleHistory import History from idlelib.configHandler import idleConf line1 = 'a = 7' line2 = 'b = a' class StoreTest(unittest.T...
alanjw/GreenOpenERP-Win-X86
python/Lib/idlelib/idle_test/test_idlehistory.py
Python
agpl-3.0
5,612
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import pytest import numpy as np from scipy import sparse from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import...
vortex-ape/scikit-learn
sklearn/linear_model/tests/test_base.py
Python
bsd-3-clause
15,721
# Copyright 2019 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Generate documentation from the recipes and modules in the current repo. This can output as a protobuf of various forms (JSON, Text or binary)...
luci/recipes-py
recipe_engine/internal/commands/doc/__init__.py
Python
apache-2.0
979
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Taiga Agile LLC <support@taiga.io> # 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 Foundation, either version 3 of the # License, or (at your option)...
dayatz/taiga-back
taiga/stats/routers.py
Python
agpl-3.0
1,085
""" Django settings for erp project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import...
urkh/erp
erp/settings.py
Python
mit
2,380
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding unique constraint on 'Cat', fields ['slug'] db.create_unique('punns_cat', ['slug']) # Addi...
carquois/blobon
blobon/punns/migrations/0028_auto__add_unique_cat_slug__add_field_punn_publish_on_facebook.py
Python
mit
8,119
import os import uuid import shutil import tarfile import subprocess import gzip import zlib from lutris.util import system from lutris.util.log import logger from lutris import settings class ExtractFailure(Exception): """Exception raised when and archive fails to extract""" def is_7zip_supported(path, extract...
daniel-j/lutris
lutris/util/extract.py
Python
gpl-3.0
5,089
#!/usr/bin/python import os, sys import argparse # Locate the moose/python directory sys.path.append(os.path.join(os.path.abspath('..'), 'python')) # Load the required moose/python packages from FactorySystem import ParseGetPot from PresentationBuilder import base if __name__ == '__main__': # Create the argument ...
danielru/moose
scripts/presentation_builder.py
Python
lgpl-2.1
746
# -*- coding: utf-8 -*- # <nbformat>2</nbformat> # <codecell> # Import Libraries import time as time import numpy as np import scipy as sp import pylab as pl import Image # from sklearn.feature_extraction.image import grid_to_graph from sklearn.cluster import Ward # Get SEM BSE Tiff Data tiffFile = ('/home/jon/Desk...
jonpdx/gsoc2014
bseTiffToClusters.py
Python
gpl-2.0
6,859
import conedy as co N = co.network() co.set("ornUhl_drift" , 0.2) co.set("ornUhl_diffusion" , 0.1) co.set("samplingTime", 0.1) N.addNode(co.ornUhl()) N.setState(0, 1.0) N.observeTime("output/sdeIntegrator.py.series") N.observeAll("output/sdeIntegrator.py.series", co.component(0)) N.evolve(0.0,15000.0) # to c...
Conedy/Conedy
testing/integrators/sdeIntegrator.py
Python
gpl-2.0
643
from __future__ import unicode_literals import posixpath import re from django import template from django.conf import settings from django.contrib.staticfiles.storage import staticfiles_storage from django.forms.utils import flatatt from django.template.base import token_kwargs from systemjs.base import System reg...
sergei-maertens/django-systemjs
systemjs/templatetags/system_tags.py
Python
mit
3,097
import logging import os from typing import Text, Dict, Optional, List, Any, Iterable, Tuple, Union from pathlib import Path from rasa.core.agent import Agent from rasa.engine.storage.local_model_storage import LocalModelStorage import rasa.shared.utils.cli import rasa.shared.utils.common import rasa.shared.utils.io i...
RasaHQ/rasa_nlu
rasa/model_testing.py
Python
apache-2.0
13,138
# # flags.py: global anaconda flags # # Copyright (C) 2001 Red Hat, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your o...
vojtechtrefny/anaconda
pyanaconda/flags.py
Python
gpl-2.0
7,069
import logging from .engine import SimEngine from .successors import SimSuccessors l = logging.getLogger("angr.engines.hook") # pylint: disable=abstract-method,unused-argument,arguments-differ class SimEngineHook(SimEngine): def _check(self, state, procedure=None, **kwargs): # we have not yet entered th...
tyb0807/angr
angr/engines/hook.py
Python
bsd-2-clause
2,179
# Copyright (C) 2010-2013 Henry Ludemann # # This file is part of the bdec decoder library. # # The bdec decoder library 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 2.1 ...
asdf1011/bdec
bdec/tools/encode.py
Python
lgpl-3.0
4,315
""" Specific overrides to the base prod settings to make development easier. """ from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import # Don't use S3 in devstack, fall back to filesystem del DEFAULT_FILE_STORAGE MEDIA_ROOT = "/edx/var/edxapp/uploads" DEBUG = True USE_I18N = True TEMPLATE_DEB...
atsolakid/edx-platform
lms/envs/devstack.py
Python
agpl-3.0
7,126
""" norecurse.py | UTF-8 | Mon, Jan 23, 2017 | Roman S. Collins An implementation of calculating Fibonacci of n using various functions, while plotting their efficiency in miliseconds. Problem: http://cs.marlboro.edu/courses/spring2017/algorithms/special/assignments Find the ratio of consecutive ...
RomanSC/algorithms
chapter-1/norecurse.py
Python
gpl-3.0
6,034
"""Config flow for Awair.""" from typing import Optional from python_awair import Awair from python_awair.exceptions import AuthError, AwairError import voluptuous as vol from homeassistant.config_entries import CONN_CLASS_CLOUD_POLL, ConfigFlow from homeassistant.const import CONF_ACCESS_TOKEN from homeassistant.he...
partofthething/home-assistant
homeassistant/components/awair/config_flow.py
Python
apache-2.0
3,743
# -*- encoding: utf-8 -*- from nose.tools import * from nose import SkipTest import networkx as nx from networkx.utils import * def test_is_string_like(): assert_true(is_string_like("aaaa")) assert_false(is_string_like(None)) assert_false(is_string_like(123)) def test_iterable(): assert_false(iterab...
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/networkx/utils/tests/test_misc.py
Python
gpl-3.0
6,689
#pragma repy restrictions.oneoutgoingsocket if callfunc == "initialize": def foo(): a = openconn("127.0.0.1", <connport>) def bar(a,b,c,d,e): mycontext["count"] += 1 if mycontext["count"] >= 6: stopcomm(e) mycontext["count"] = 0 waitforconn("127.0.0.1", <connport>, bar) foo() foo(...
sburnett/seattle
repy/tests/ut_repytests_oneoutgoingsocket-testemulcommgc.py
Python
mit
354
# -*- coding: utf-8 -*- # ========================================================================= # Copyright (C) 2016 Yunify, Inc. # ------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this work except in compli...
Fiile/qsctl
qingstor/qsctl/commands/mv.py
Python
apache-2.0
1,937
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed ...
SCSSoftware/BlenderTools
addon/io_scs_tools/internals/shaders/flavors/fadesheet/fadesheet_compute_ng.py
Python
gpl-2.0
6,765
""" Implement the Schwartizan Transform method of sorting a list by an arbitrary metric (see the Python FAQ section 4.51). -------------------------------------------------------------------- This program is licensed under the GNU General Public License (GPL). See http://www.fsf.org for details of the license. Andrew...
logxen/Fritzing
tools/gerb-merge/gerbmerge/schwartz.py
Python
gpl-3.0
1,029
from __future__ import absolute_import from rest_framework import permissions # from sentry.models.apikey import ROOT_KEY # from sentry.auth.utils import is_privileged_request class NoPermission(permissions.BasePermission): def has_permission(self, request, view): return False class ScopedPermission(p...
wanghe4096/WangBlog
src/wangblog/api/permissions.py
Python
bsd-2-clause
1,737
import json import time import unittest from context import Bolt client = Bolt("<your-api-key-here>", "<your-bolt-id>") # Pass in the API Key and the client ID. class BoltTests(unittest.TestCase, unittest.TestLoader): """ This is a test class to test, the functionality of the bolt python api library. ...
Inventrom/bolt-api-python
tests/functionality_test/functionality_testing.py
Python
mit
4,150
# -*- coding: utf-8 -*- # # hill_tononi_Vp.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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,...
synergetics/nest
topology/examples/hill_tononi_Vp.py
Python
gpl-2.0
35,334
# Copyright 2017 Google LLC. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #...
google/deepvariant
deepvariant/postprocess_variants.py
Python
bsd-3-clause
49,805
from selenium.common.exceptions import NoSuchElementException from .base import FunctionalTest, login_test_user_with_browser class NewVisitorTest(FunctionalTest): def test_default_page(self): # ์ง€ํ›ˆ์ด๋Š” ๋ฉ‹์ง„ ๊ฒŒ์‹œํŒ ์•ฑ์ด ๋‚˜์™”๋‹ค๋Š” ์†Œ์‹์„ ๋“ฃ๊ณ  # ํ•ด๋‹น ์›น ์‚ฌ์ดํŠธ๋ฅผ ํ™•์ธํ•˜๋Ÿฌ ๊ฐ„๋‹ค. self.browser.get(self.live_server_url) ...
cjh5414/kboard
kboard/functional_test/test_post_creation_and_management.py
Python
mit
9,992
""" This code includes objectives for deep learning loss function. Every computations are tensor operations. """ import numpy as np import theano import theano.tensor as T from lemontree.layers.layer import BaseLayer class CategoricalCrossentropy(BaseLayer): def __init__(self, stabilize=False, mode='mean'): ...
khshim/lemontree
lemontree/objectives.py
Python
mit
19,014
# ________________________________________________________________________ # # Copyright (C) 2014 Andrew Fullford # # 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.apa...
akfullfo/pollinator
pollinator/poll.py
Python
apache-2.0
12,116
# take a bunch of model_0 model_1 etc files and merge them alphabetically # first, import settings; import sys print sys.argv if len(sys.argv) > 1: execfile(sys.argv[1] + "/settings.py") else: from settings import * # for each file, load the file into one giant list # call sort on the list # write this output ...
groppcw/TopicModelingPipeline
common/PLDA/02-collectModel.py
Python
apache-2.0
1,897
from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import Integer from sqlalchemy import select from sqlalchemy import String from sqlalchemy import testing from sqlalchemy import util from sqlalchemy.orm import aliased from sqlalchemy.orm import backref from sqlalchemy.orm import configure_m...
monetate/sqlalchemy
test/orm/inheritance/test_relationship.py
Python
mit
95,137
"""The tests for the notify demo platform.""" import unittest import blumate.components.notify as notify from blumate.components.notify import demo from tests.common import get_test_home_assistant class TestNotifyDemo(unittest.TestCase): """Test the demo notify.""" def setUp(self): # pylint: disable=inval...
bdfoster/blumate
tests/components/notify/test_demo.py
Python
mit
1,653
# -*- coding: utf-8 -*- """ TeleMir developpement version with fake acquisition device lancer dans un terminal : python examples/test_osc_receive.py """ from pyacq import StreamHandler, FakeMultiSignals from pyacq.gui import Oscilloscope, Oscilloscope_f, TimeFreq, TimeFreq2 from TeleMir.gui import Topoplot, Kurtosis...
Hemisphere-Project/Telemir-DatabitMe
Telemir-EEG/TeleMir_171013/Fake_TeleMir_CB.py
Python
gpl-2.0
6,881
from typing import List from typing import Optional from sqlalchemy import Boolean from sqlalchemy import ForeignKey from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy import testing from sqlalchemy.orm import clear_mappers from sqlalchemy.orm import declared_at...
zzzeek/sqlalchemy
test/orm/test_dataclasses_py3k.py
Python
mit
31,652
""" Author: Remi Lafage <remi.lafage@onera.fr> This package is distributed under New BSD license. Mixture of Experts """ # TODO : support for best number of clusters # TODO : implement verbosity 'print_global' # TODO : documentation import numpy as np import warnings OLD_SKLEARN = False try: # scikit-learn < 0.20....
SMTorg/smt
smt/applications/moe.py
Python
bsd-3-clause
25,286
"""FLOW-BUS protocol for Bronkhorst instruments. The protocol is described in the instruction manual number 9.17.027. The implementation uses the `Construct library <http://construct.readthedocs.org/en/latest/>`__. """ from binascii import unhexlify import unittest from construct import * header = Struct("header",...
Synss/pyhard2
pyhard2/driver/_bronkhorst.py
Python
mit
7,674