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
""" Boolean algebra module for SymPy """ from __future__ import print_function, division from collections import defaultdict from itertools import combinations, product from sympy.core.basic import Basic from sympy.core.cache import cacheit from sympy.core.core import C from sympy.core.numbers import Number from symp...
AunShiLord/sympy
sympy/logic/boolalg.py
Python
bsd-3-clause
49,069
0.000346
# Copyright 2016 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 re # Note: this module is tested by a unit test config_validation_test.py, # rather than recipe simulation tests. _BISECT_CONFIG_SCHEMA = { 'com...
eunchong/build
scripts/slave/recipe_modules/auto_bisect/config_validation.py
Python
bsd-3-clause
3,647
0.007952
# -*- coding: utf-8 -*- # Copyright (C) 2014 Canonical # # Authors: # Didier Roche # # 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; version 3. # # This program is distributed in the hope that ...
LyzardKing/ubuntu-make
umake/frameworks/dart.py
Python
gpl-3.0
5,057
0.002768
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-08-22 10:47 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0017_auto_20160821_1833'), ] operations = [ migrations.AlterField( ...
niksoc/srmconnect
app/migrations/0018_auto_20160822_1047.py
Python
gpl-3.0
4,536
0
# encoding: utf-8 # module PyKDE4.kio # from /usr/lib/python3/dist-packages/PyKDE4/kio.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdeui as __PyKDE4_kdeui import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui class KUrlComboBox(__PyKDE4_kdeui.KComboBox): ...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247971765/PyKDE4/kio/KUrlComboBox.py
Python
gpl-2.0
1,586
0.010719
import unittest import numpy as np from ..emissions import GaussianEmissions, MultinomialEmissions from ..hsmm import GaussianHSMM, MultinomialHSMM class TestHSMMWrappers(unittest.TestCase): def setUp(self): # Exact values don't matter self.tmat = np.eye(3) self.durations = np.eye(3) ...
jvkersch/hsmmlearn
hsmmlearn/tests/test_hsmm_wrappers.py
Python
gpl-3.0
1,757
0
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RProdlim(RPackage): """Product-Limit Estimation for Censored Event History Analysis P...
LLNL/spack
var/spack/repos/builtin/packages/r-prodlim/package.py
Python
lgpl-2.1
1,415
0.003534
""" A 2-dimensional vector class >>> v1 = Vector2d(3, 4) >>> print(v1.x, v1.y) 3.0 4.0 >>> x, y = v1 >>> x, y (3.0, 4.0) >>> v1 Vector2d(3.0, 4.0) >>> v1_clone = eval(repr(v1)) >>> v1 == v1_clone True >>> print(v1) (3.0, 4.0) >>> octets = bytes(v1...
YuxuanLing/trunk
trunk/code/study/python/Fluent-Python-example-code/09-pythonic-obj/vector2d_v3_slots.py
Python
gpl-3.0
3,560
0.000281
#!/usr/bin/env python import argparse import datetime import pandas as pd import yaml from pytrthree import TRTH from pytrthree.utils import retry def make_request(daterange, criteria): request = api.factory.LargeRequestSpec(**template) short_dates = sorted([x.replace('-', '') for x in daterange.values()]) ...
plugaai/pytrthree
tools/request_sender.py
Python
mit
2,685
0.003724
# -*- coding: utf-8 -*- """ zine.docs.builder ~~~~~~~~~~~~~~~~~~~~~~ The documentation building system. This is only used by the documentation building script. :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re impor...
mitsuhiko/zine
zine/docs/builder.py
Python
bsd-3-clause
2,947
0.001018
#!/usr/bin/env python # -*- coding: utf-8 -*- # import ## batteries import os import sys import pytest ## 3rd party import pandas as pd ## package from pyTecanFluent import Utils # data dir test_dir = os.path.join(os.path.dirname(__file__)) data_dir = os.path.join(test_dir, 'data') # tests def test_make_range(): ...
leylabmpi/pyTecanFluent
tests/test_Utils.py
Python
mit
1,127
0.022183
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('gallery', '0005_piece_medium'), ] operations = [ migrations.AlterField( model_name='medium', name='m...
mudbungie/carrieocoyle
gallery/migrations/0006_auto_20151027_1101.py
Python
mit
404
0
""" Utility functions for the UEA multivariate time series classification archive. """ # Author: Johann Faouzi <johann.faouzi@gmail.com> # License: BSD-3-Clause import numpy as np import os import pickle from scipy.io.arff import loadarff from sklearn.utils import Bunch from urllib.request import urlretrieve import z...
johannfaouzi/pyts
pyts/datasets/uea.py
Python
bsd-3-clause
9,597
0
import frappe from frappe.utils import cstr def execute(): # Update Social Logins in User run_patch() # Create Social Login Key(s) from Social Login Keys frappe.reload_doc("integrations", "doctype", "social_login_key", force=True) if not frappe.db.exists('DocType', 'Social Login Keys'): return social_login_...
frappe/frappe
frappe/patches/v10_0/refactor_social_login_keys.py
Python
mit
4,935
0.024924
from heapq import heappush, heappop import numpy as np from gtfspy.route_types import WALK from .event import Event class EventHeap: """ EventHeap represents a container for the event heap to run time-dependent Dijkstra for public transport routing objects. """ def __init__(self, pd_df=None): ...
CxAalto/gtfspy
gtfspy/spreading/heap.py
Python
mit
2,529
0.001977
""" @file @brief Validator for MetaIR Does semantic validation of the MetaIR instance """ from common import * def meta_ir_validate_parser(instance): """ @brief Semantic validation of an MetaIR instance @param instance The MetaIR instance map @returns Boolean, True if instance is valid. The inst...
OpenNetworkingFoundation/PIF-Open-Intermediate-Representation
pif_ir/meta_ir/validate.py
Python
apache-2.0
4,103
0.006581
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Wright-Fisher model of mutation, selection and random genetic drift # <markdowncell> # A Wright-Fisher model has a fixed population size *N* and discrete non-overlapping generations. Each generation, each individual has a random number of ...
alvason/probability-insighter
code/mutation-drift-selection.py
Python
gpl-2.0
11,460
0.006457
__all__ = [ 'HTML5TreeBuilder', ] import warnings from bs4.builder import ( PERMISSIVE, HTML, HTML_5, HTMLTreeBuilder, ) from bs4.element import NamespacedAttribute import html5lib from html5lib.constants import namespaces from bs4.element import ( Comment, Doctype, NavigableString, Tag, ) class HTML5Tree...
colobas/gerador-horarios
bs4/builder/_html5lib.py
Python
mit
6,730
0.027637
# -*- coding: utf-8 -*- # Copyright (C) 2016 Matthias Luescher # # Authors: # Matthias Luescher # # This file is part of edi. # # edi is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of...
erickeller/edi
tests/lib/test_playbookrunner.py
Python
lgpl-3.0
2,684
0.000373
import unittest from GUI.PopUps.RemovePresentationsPopUp import RemovePresentationsPopUp class TestBindPresentationToSlavePopup(unittest.TestCase): def setUp(self): self.presentations = ["Slave1", "Slave2"] self.remove_popup = RemovePresentationsPopUp(self.presentations, None) def test_init_...
RemuTeam/Remu
project/tests/GUI/PopUps/test_remove_presentations_pop_up.py
Python
mit
1,094
0.002742
#!/usr/bin/env python """ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import httplib import os import re import urlparse import tempfile import time from lib.core.common import clearConsoleLine from lib.core.common import dataToStdout from lib....
undefinedv/Jingubang
sqlmap/lib/utils/crawler.py
Python
gpl-3.0
8,802
0.002272
from collections import OrderedDict import logging import time import sys import pandas as pd import numpy as np import pyprind import dask from dask import delayed from dask.diagnostics import ProgressBar import cloudpickle as cp import pickle from py_entitymatching.blocker.blocker import Blocker import py_entitym...
anhaidgroup/py_entitymatching
py_entitymatching/dask/dask_black_box_blocker.py
Python
bsd-3-clause
22,385
0.00344
from easyprocess import EasyProcess # @UnresolvedImport import logging # turn on logging logging.basicConfig(level=logging.DEBUG) EasyProcess('python --version').call() EasyProcess('ping localhost').start().sleep(1).stop() EasyProcess('python --version').check() try: EasyProcess('bad_command').check() except Exc...
ppizarror/korektor
bin/easyprocess/examples/log.py
Python
gpl-2.0
447
0
#!/usr/bin/python2 #coding=utf8 import httplib import urllib import urllib2 import json req = urllib2.Request('http://h.acfun.tv/综合版1.json') res = urllib2.urlopen(req) json_str = res.read() json_dic = json.loads(json_str) print json.dumps(json_dic, indent=4, encoding='utf-8') # print json.dumps(json_dic['data']['repl...
SnowOnion/ero
acfunh.py
Python
mit
353
0.002882
'''Test gibson design module.''' from nose.tools import assert_equal, assert_raises from coral import design, DNA, Primer def test_gibson_primers(): '''Test gibson_primers function.''' # Fuse tdh3 promoter sequence to yfp (trimmed for readability) tdh3_3prime = DNA('aaccagttccctgaaattattcccctacttgactaataa...
klavinslab/coral
tests/tests/test_design/test_gibson.py
Python
mit
2,083
0
#!/usr/bin/python import sys sys.path.append("..") from allantools import noise import numpy import pytest def test_noise(): N = 500 #rate = 1.0 w = noise.white(N) b = noise.brown(N) v = noise.violet(N) p = noise.pink(N) # check output length assert len(w) == N assert len(b...
aewallin/allantools
tests/functional_tests/test_noise.py
Python
lgpl-3.0
556
0.01259
from django.contrib import admin from forum.models import * admin.site.register(Student) admin.site.register(Professor) admin.site.register(Classroom)
Hastu/educ_plateform
educ/authentification/admin.py
Python
mit
152
0.006579
# -*- coding: utf-8 -*- import six import marshmallow as ma from flask_apispec import ResourceMeta, Ref, doc, marshal_with, use_kwargs class Pet: def __init__(self, name, type): self.name = name self.type = type class PetSchema(ma.Schema): name = ma.fields.Str() type = ma.fields.Str() c...
Tackitt/flask-apispec
examples/petstore.py
Python
mit
2,262
0.007515
# Copyright 2016 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 by applicable law or agreed ...
yebrahim/pydatalab
datalab/utils/_gcp_job.py
Python
apache-2.0
1,521
0.006575
# # The weights for this model come from training in a neural network library called CognitoNet which is now retired. # # That training session used images from the Face Scrub data set: # http: http://vintage.winklerbros.net/facescrub.html # H.-W. Ng, S. Winkler. # A data-driven approach to cleaning large fac...
jfrancis71/TensorFlowApps
CZFaceDetection.py
Python
mit
9,947
0.036594
#!/usr/bin/env python3 ''' bm = sd.Bitmap(Width,Height) for x in xrange(Height*Width): j= x // Width i= x % Width col = Color[x] bm.SetPixel(i,j,col) bm.Save(PathWrite,sd.Imaging.ImageFormat.Bmp) ''' from PIL import Image w = h = 255 img = Image.new( 'RGB', (w, h), "black") # Create a new black image...
michielkauwatjoe/Meta
meta/rgb.py
Python
mit
524
0.009542
class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ # Op1: isNegative = False if x < 0: isNegative = True x *= -1 x = int(str(x)[::-1]) if isNegative: x *= -1 return x if ab...
rx2130/Leetcode
python/7 Reverse Integer.py
Python
apache-2.0
710
0.002817
# -*- encoding: utf-8 -*- """ Rapids expressions. These are helper classes for H2OFrame. :copyright: (c) 2016 H2O.ai :license: Apache License Version 2.0 (see LICENSE for details) """ from __future__ import division, print_function, absolute_import, unicode_literals import collections import copy import gc import m...
mathemage/h2o-3
h2o-py/h2o/expr.py
Python
apache-2.0
15,701
0.004204
# # pyfeyner - a simple Python interface for making Feynman diagrams. # Copyright (C) 2005-2010 Andy Buckley, Georg von Hippel # Copyright (C) 2013 Ismo Toijala # # pyfeyner 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...
itoijala/pyfeyner
tests/test-bend90a.py
Python
gpl-2.0
1,085
0.000922
# -*- coding: utf-8 -*- ''' Created on 2017/09/14 @author: yuyang ''' import os import urllib import uuid import re import docx_ext from docx.shared import Pt from docx.shared import RGBColor from docx.shared import Inches JPEG_EXTENSION = '.jpg' PNG_EXTENSION = '.png' GIF_EXTENSION = '.gif' SPLIT_STRING = '///' T...
coolcooldool/tencent-weibo-exporter
loginver4/tencent_util.py
Python
apache-2.0
10,110
0.006012
'''OpenGL extension NV.read_depth_stencil This module customises the behaviour of the OpenGL.raw.GLES2.NV.read_depth_stencil to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/registry/specs/NV/read_depth_stencil.txt ''' from OpenGL import platfo...
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/GLES2/NV/read_depth_stencil.py
Python
lgpl-3.0
785
0.008917
import numpy as np from .base_signal import BaseSignal __all__ = ['CAR'] class CAR(BaseSignal): """Signal generatpr for continuously autoregressive (CAR) signals. Parameters ---------- ar_param : number (default 1.0) Parameter of the AR(1) process sigma : number (default 1.0) Sta...
TimeSynth/TimeSynth
timesynth/signals/car.py
Python
mit
1,472
0.001359
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2016 Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u...
jhgg/discord.py
discord/colour.py
Python
mit
6,401
0.003749
# # 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...
enigmampc/catalyst
catalyst/finance/performance/position.py
Python
apache-2.0
7,850
0.000127
#!/usr/bin/env python # encoding: utf-8 # # Copyright © 2014 deanishe@deanishe.net # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2014-04-06 # """ Run background tasks """ from __future__ import print_function, unicode_literals import sys import os import subprocess import pickle from workfl...
dalimatt/Instastalk
dependencies/workflow/background.py
Python
mit
7,361
0.001359
# coding=utf-8 """ Provides crossplatform checking of current power source, battery warning level and battery time remaining estimate. Allows you to add observer for power notifications if platform supports it. Usage: from power import PowerManagement, PowerManagementObserver # Automatically imports platform-speci...
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/power/__init__.py
Python
agpl-3.0
1,441
0.002776
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-05-21 12:34 from __future__ import unicode_literals import dictionary.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dictionary', '0011_auto_20160503_1535'), ] operations = [ ...
nirvaris/nirvaris-dictionary
dictionary/migrations/0012_auto_20160521_1234.py
Python
mit
887
0.002255
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
savi-dev/horizon
horizon/views/auth_forms.py
Python
apache-2.0
8,511
0.000587
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from collections import OrderedDict import json import datetime from odoo import api, fields, models, _ from odoo.exceptions import AccessError, ValidationError from odoo.addons import decimal_precision as dp class L...
maxive/erp
addons/lunch/models/lunch.py
Python
agpl-3.0
14,593
0.003358
#!/usr/bin/env python """ ================================================ ABElectronics IO Pi Tests | test get_bus_pullups function Requires python smbus to be installed For Python 2 install with: sudo apt-get install python-smbus For Python 3 install with: sudo apt-get install python3-smbus run with: python3 get_b...
abelectronicsuk/ABElectronics_Python_Libraries
IOPi/tests/get_bus_pullups.py
Python
gpl-2.0
1,397
0
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2012,2014,2016 Contributor # # 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...
quattor/aquilon
lib/aquilon/worker/commands/show_realm_all.py
Python
apache-2.0
1,108
0
"""LTI integration tests""" import json from collections import OrderedDict import mock import oauthlib import six from django.conf import settings from django.urls import reverse from six import text_type from lms.djangoapps.courseware.tests.helpers import BaseTestXmodule from lms.djangoapps.courseware.views.views...
edx-solutions/edx-platform
lms/djangoapps/courseware/tests/test_lti_integration.py
Python
agpl-3.0
9,264
0.002807
import time import wx import xapian from threading import Thread from stop_words import stop_words class NoteEntryFrame(wx.Frame): def __init__(self, parent): wx.Frame.__init__(self, None, title="Note Entry", size=(300, 300)) self.db_path = "db" self.InitUI() def InitUI(self): panel = wx.Panel(se...
narrowmark/engelbart
note_entry.py
Python
mit
4,157
0.006495
# Copyright 2016 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 by applicable law or agree...
rew4332/tensorflow
tensorflow/contrib/slim/python/slim/evaluation.py
Python
apache-2.0
12,824
0.002963
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
cjaymes/pyscap
src/scap/model/oval_5/defs/linux/SystemDUnitDependencyStateElement.py
Python
gpl-3.0
1,172
0.00256
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on Jul 16, 2014 @author: anroco How to define the number of decimal digits of a float in Python? ¿Cómo definir la cantidad de digitos decimales de un float en Python? ''' #crate a float number f = 13.9497389867 print(f) #this method rounded to the number of...
OxPython/Python_float_round
src/digit_precision_float.py
Python
epl-1.0
432
0.006977
from ArduinoSerial import sendData, beginTransmission import serial import time import atexit ser = serial.Serial("/dev/ttyACM0",115200) ser.flushInput() #The next five lines allow the motors to stop once the ctrl+c command is given to abort the program. def exit_handler(): sendData(ser,1,0) sendData(ser,2,0) atex...
IllinoisRoboticsInSpace/Arduino_Control
RemoteControl/Move.py
Python
mit
675
0.056296
""" 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 use this ...
zouzhberk/ambaridemo
demo-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/package/scripts/application_timeline_server.py
Python
apache-2.0
1,573
0.006357
"""Tests for update records.""" import unittest from dbdiff.fixture import Fixture from .base import TestImportBase, FixtureDir class TestUpdate(TestImportBase): """Tests update procedure.""" def test_update_fields(self): """Test all fields are updated.""" fixture_dir = FixtureDir('update') ...
yourlabs/django-cities-light
src/cities_light/tests/test_update.py
Python
mit
5,691
0
# -*- coding: utf-8 -*- from .api import get_artifactory_config_from_url, update_ldapSettings_from_dict, update_artifactory_config, cr_repository, update_password, get_repo_configs, get_repo_list
brain461/ar_too
ar_too/__init__.py
Python
apache-2.0
197
0.005076
# 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...
kevin-coder/tensorflow-fork
tensorflow/python/compiler/tensorrt/test/batch_matmul_test.py
Python
apache-2.0
3,185
0.002826
# -*- coding: utf-8 -*- from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS import gettext PluginLanguageDomain = "OpenWebif" PluginLanguagePath = "Extensions/OpenWebif/locale" def localeInit(): gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLU...
pr2git/e2openplugin-OpenWebif
plugin/__init__.py
Python
gpl-3.0
509
0.011788
"""kuoteng_bot URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
rapirent/toc_project
kuoteng_bot/kuoteng_bot/urls.py
Python
mit
972
0.002058
""" AUTHOR: Dr. Andrew David Burbanks, 2005 This software is Copyright (C) 2004-2008 Bristol University and is released under the GNU General Public License version 2. MODULE: CoordinateChange PURPOSE: Compute the coordinate changes relating complex diagonal to complex normal form coordinates. NOTES: For paralle...
Peter-Collins/NormalForm
src/py/CoordinateChange.py
Python
gpl-2.0
3,820
0.003141
# coding=utf-8 # The MIT License # # Copyright (c) 2016 OpenAI (https://openai.com) # Copyright (c) 2018 The TF-Agents Authors. # Copyright (c) 2018 Google LLC (http://google.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ...
google-research/episodic-curiosity
third_party/gym/ant_wrapper_test.py
Python
apache-2.0
2,294
0.001308
# Copyright (c) 2015-2019, Activision Publishing, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of ...
ActivisionGameScience/assertpy
tests/test_same_as.py
Python
bsd-3-clause
2,899
0.008624
# Copyright (c) 2012 OpenStack Foundation. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
sebrandon1/neutron
neutron/extensions/providernet.py
Python
apache-2.0
3,608
0
from functools import partial from random import random, randint, choice import pygame import init as _ from baseclass import BaseClass from options import Options try: from cython_ import collide except ImportError: from python_ import collide from miscellaneous import further_than, scale from t...
thdb-theo/Zombie-Survival
src/pickup.py
Python
mit
3,543
0.001411
# -*- encoding: utf-8 -*- from hypothesis import given from hypothesis.strategies import integers, lists import pytest from taskpaper import TaskPaperItem, TaskPaperError from utils import taskpaper_item_strategy @given(integers()) def test_setting_tab_size(tab_size): """We can set the tab size on TaskPaperIte...
alexwlchan/python-taskpaper
test/test_item.py
Python
mit
3,541
0
from rest_framework.decorators import api_view from rest_framework.response import Response from django.contrib.auth.models import User from application.serializers import UserSerializer, ApplicationSerializer, ApplicationListSerializer from rest_framework import viewsets, status from application.models import Applicat...
mkmeral/TevitolApplication
application/backend/application/views.py
Python
gpl-3.0
2,676
0.00299
#!/usr/bin/env python import os import sys import unittest import pysam import sam_utils class TestMISO(unittest.TestCase): """ Test MISO functionality. """ def setUp(self): # Find out the current directory self.miso_path = \ os.path.dirname(os.path.abspath(os.path.expandus...
Xinglab/rmats2sashimiplot
src/MISO/misopy/test_miso.py
Python
gpl-2.0
7,024
0.002847
# from .. import Workflow, Stage, Task, TaskFile # # from flask.ext import admin # from flask.ext.admin.contrib import sqla # # # def add_cosmos_admin(flask_app, session): # adm = admin.Admin(flask_app, 'Flask Admin', base_template="admin_layout.html") # for m in [Workflow, Stage, Task, TaskFile]: # adm...
vamst/COSMOS2
cosmos/web/admin.py
Python
gpl-3.0
358
0.002793
# -*- coding: utf-8 -*- """ Unit tests for LMS instructor-initiated background tasks helper functions. Tests that CSV grade report generation works with unicode emails. """ import ddt from mock import Mock, patch import tempfile from openedx.core.djangoapps.course_groups import cohorts import unicodecsv from django....
jamiefolsom/edx-platform
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
Python
agpl-3.0
61,734
0.003193
# 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...
noironetworks/group-based-policy
gbpservice/nfp/common/constants.py
Python
apache-2.0
4,212
0.000237
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import os import argparse import tarfile import gzip import json import requests import shutil from amptk import amptklib try: from urllib.request import urlopen except Impo...
nextgenusfs/ufits
amptk/install.py
Python
bsd-2-clause
3,232
0.008045
from django.test import TestCase, Client from sendgrid import utils, signals import json class SignalTestCase(TestCase): def setUp(self): self.client = Client() self.email_data = {'subject': 'Test Subject', 'body': 'Hi, I am a test body', 'fr...
resmio/django-sendgrid
sendgrid/tests/test_signals.py
Python
bsd-2-clause
3,625
0
# The Hazard Library # Copyright (C) 2013-2022 GEM Foundation # # 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) any later version. #...
gem/oq-engine
openquake/hazardlib/source/non_parametric.py
Python
agpl-3.0
10,119
0
#!/usr/bin/python import pygeoip import json from logsparser.lognormalizer import LogNormalizer as LN import gzip import glob import socket import urllib2 IP = 'IP.Of,Your.Server' normalizer = LN('/usr/local/share/logsparser/normalizers') gi = pygeoip.GeoIP('../GeoLiteCity.dat') def complete(text, state): return (gl...
radman404/Who-s-attacking-me-now--
wamnclient.py
Python
gpl-2.0
2,126
0.024929
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Indexed corpus is a mechanism for random-accessing corpora. While the standard corpus interface in gensim allows iterating over co...
markroxor/gensim
gensim/corpora/indexedcorpus.py
Python
lgpl-2.1
5,378
0.002789
#!/usr/bin/env python import optparse from sys import * import os,sys,re from optparse import OptionParser import glob import subprocess from os import system import linecache import time #========================= def setupParserOptions(): parser = optparse.OptionParser() parser.set_usage("%prog -i <...
leschzinerlab/ISAC
ISAC.py
Python
mit
8,169
0.045048
#!/usr/bin/python # # Copyright 2013 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...
lociii/googleads-python-lib
examples/adspygoogle/dfp/v201306/creative_service/get_creatives_by_statement.py
Python
apache-2.0
2,090
0.002871
from __future__ import absolute_import import logging from datetime import timedelta from django.utils import timezone from rest_framework import serializers, status from rest_framework.response import Response from sentry.api.base import DocSection from sentry.api.bases.project import ProjectEndpoint from sentry.ap...
nicholasserra/sentry
src/sentry/api/endpoints/project_details.py
Python
bsd-3-clause
8,377
0.002029
from django.conf import settings from django.contrib.auth import get_user_model from django.core.cache import cache from django.urls import reverse from django.utils import timezone from freezegun import freeze_time from rest_framework import status, test from rest_framework.authtoken.models import Token from . import...
opennode/nodeconductor-assembly-waldur
src/waldur_core/core/tests/test_authentication.py
Python
mit
7,832
0.002937
from django.core.urlresolvers import reverse from mappings.tests import MappingBaseTest from mappings.validation_messages import OPENMRS_SINGLE_MAPPING_BETWEEN_TWO_CONCEPTS from oclapi.models import CUSTOM_VALIDATION_SCHEMA_OPENMRS from test_helper.base import create_user, create_source, create_concept class OpenMRS...
ayseyo/oclapi
django-nonrel/ocl/integration_tests/tests/openmrs_mapping_validation.py
Python
mpl-2.0
1,429
0.003499
import unittest from unittest import skip from decimal import Decimal from cnab240 import errors from cnab240.bancos import itau from tests.data import get_itau_data_from_file class TestRegistro(unittest.TestCase): def setUp(self): itau_data = get_itau_data_from_file() self.header_arquivo = it...
Trust-Code/python-cnab
tests/test_registro.py
Python
mit
4,409
0.000454
"""Event loop using a selector and related classes. A selector is a "notify-when-ready" multiplexer. For a subclass which also includes support for signal handling, see the unix_events sub-module. """ __all__ = ['BaseSelectorEventLoop'] import collections import errno import functools import socket import warnings ...
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/asyncio/selector_events.py
Python
gpl-3.0
39,441
0.000076
# Copyright 2018 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, s...
quartzmo/gcloud-ruby
google-cloud-bigquery-data_transfer/synth.py
Python
apache-2.0
3,453
0.001448
# -*- coding: utf-8 -*- """ Event objects for the notification system. These are intended to be used within event handlers such as `~trigger.utils.notifications.handlers.email_handler()`. If not customized within :setting:`NOTIFICATION_HANDLERS`, the default notification type is an `~trigger.utils.notification.event...
coxley/trigger
trigger/utils/notifications/events.py
Python
bsd-3-clause
4,682
0.001495
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
allenlavoie/tensorflow
tensorflow/contrib/model_pruning/python/pruning_test.py
Python
apache-2.0
9,014
0.006989
# Copyright 2004-2017 Tom Rothamel <pytom@bishoujo.us> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, m...
kfcpaladin/sze-the-game
renpy/display/joystick.py
Python
mit
1,793
0.001673
# Copyright (c) 2012 OpenStack Foundation. # Administrator of the National Aeronautics and Space Administration. # 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 a...
rdo-management/neutron
neutron/openstack/common/eventlet_backdoor.py
Python
apache-2.0
4,859
0
# coding: utf-8 """ MINDBODY Public API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import impo...
mindbody/API-Examples
SDKs/Python/test/test_custom_payment_method.py
Python
bsd-2-clause
980
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import json from prjxray.segmaker i...
SymbiFlow/prjxray
fuzzers/031-cmt-mmcm/generate.py
Python
isc
3,572
0.00056
### Start of fixing import paths import os, sys, inspect # realpath() with make your script run, even if you symlink it :) cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0])) if cmd_folder not in sys.path: sys.path.insert(0, cmd_folder) # use this if you want...
EnTeQuAk/dotfiles
sublime-text-3/Packages/Search in Project/searchengines/grep.py
Python
unlicense
953
0.018888
# attempting the classify the charts, after armor/tests/imageToDataTest3.py # Plan: 1. compute features and store them # 2. classify # 3. display # #sleepTime= 140000 sleepTime =0 import time print time.asctime() print 'sleeping now for ', sleepTime, 'seconds' time.sleep(sleepTime) import os...
yaukwankiu/armor
tests/imageToDataTest4.py
Python
cc0-1.0
5,132
0.01286
import supriya.commands import supriya.realtime from supriya.system.SupriyaValueObject import SupriyaValueObject class NodeTransition(SupriyaValueObject): """ A non-realtime state transition. """ ### CLASS VARIABLES ### __documentation_section__ = "Session Internals" __slots__ = ("_source",...
Pulgama/supriya
supriya/nonrealtime/NodeTransition.py
Python
mit
4,163
0.001441
import os.path import tempfile from time import time from streaming_form_data import StreamingFormDataParser from streaming_form_data.targets import FileTarget, ValueTarget from tornado.ioloop import IOLoop from tornado.web import Application, RequestHandler, stream_request_body one_hundred_gb = 100 * 1024 * 1024 * ...
siddhantgoel/streaming-form-data
examples/tornado/stream_request_body.py
Python
mit
1,487
0
import logging class BorgSingleton: _shared_state = {} def __init__(self): self.__dict__ = self._shared_state class LoggerSetup(BorgSingleton): """Logger setup convenience class""" DEFAULT_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' def __init__(self, logger_name, ...
kevgraham7/toolbox
python/samples/git-tools/util/log_setup.py
Python
apache-2.0
1,033
0.001936
# -*- coding: utf-8 -*- from django.conf.urls import re_path from . import views app_name = 'bookmark' urlpatterns = [ re_path(r'^(?P<topic_id>[0-9]+)/create/$', views.create, name='create'), re_path(r'^(?P<topic_id>[0-9]+)/find/$', views.find, name='find'), ]
nitely/Spirit
spirit/comment/bookmark/urls.py
Python
mit
273
0
from __future__ import absolute_import import datetime from typing import Any, List from django.conf import settings from django.core.management.base import BaseCommand from django.utils.timezone import now as timezone_now from zerver.lib.digest import enqueue_emails, DIGEST_CUTOFF from zerver.lib.logging_util impor...
verma-varsha/zulip
zerver/management/commands/enqueue_digest_emails.py
Python
apache-2.0
728
0.002747
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_space_rebel_tier3_ezkiel.iff" result.attribute_template_id = 9...
obi-two/Rebelion
data/scripts/templates/object/mobile/shared_space_rebel_tier3_ezkiel.py
Python
mit
452
0.04646
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from random import shuffle class Carta(): def __init__(self, numero, naipe): self.numero = numero self.naipe = naipe def __repr__(self): return '%s de %s' % (self.numero, self.naipe) class Baralho(): ...
renzon/fatec-script
backend/appengine/pythonicos.py
Python
mit
1,283
0.003118
# Copyright 2018, The TensorFlow Federated 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 o...
tensorflow/federated
tensorflow_federated/python/learning/model.py
Python
apache-2.0
12,401
0.002903
# coding=utf-8 from django.conf.urls import url from .views import ( AliTemplateView, AliVideoconferenciasDetailView, AreaDetailView, AulaDetailView, CuerpoDetailView, IndexView, LaboratorioDetailView, LaboratorioInformaticoDetailView, LaboratorioInformaticoListView, NivelDetai...
utn-frm-si/reservas
app_reservas/urls.py
Python
mit
4,160
0
"""Management command for uploading master json data for OCW courses""" from django.core.management import BaseCommand from course_catalog.etl.deduplication import generate_duplicates_yaml class Command(BaseCommand): """Print course duplicates yaml""" help = "Print course duplicates yaml" def handle(se...
mitodl/open-discussions
course_catalog/management/commands/print_course_duplicates_yaml.py
Python
bsd-3-clause
397
0