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 filecmp import os import re import shutil from logisim_script import build_path def get_doc_locales(src_dir): doc_locales = [] for locale in os.listdir(src_dir): locale_src = build_path(src_dir, locale) contents_src = build_path(locale_src, 'html/contents.html') if (len(locale) =...
YottaByte090/LogisimKR
scripts/copy_doc.py
Python
gpl-2.0
11,541
from exams.E2006.pagrindinis.u1 import u1 from exams.testing import read from exams.testing import write def test(path): write(path / 'Duom1.txt', [ '3', '2 15 41', '4 1 2 3 4', '3 22 11 24', ]) u1.main(path) assert read(path / 'Rez1.txt') == [ '17.08', ]
python-dirbtuves/it-brandos-egzaminai
exams/E2006/pagrindinis/u1/tests.py
Python
agpl-3.0
318
""" ================== SMOTE borderline 1 ================== An illustration of the random SMOTE borderline 1 method. """ print(__doc__) import matplotlib.pyplot as plt import seaborn as sns sns.set() # Define some color for the plotting almost_black = '#262626' palette = sns.color_palette() from sklearn.datasets...
RPGOne/Skynet
imbalanced-learn-master/examples/over-sampling/plot_smote_bordeline_1.py
Python
bsd-3-clause
1,892
# Test File Expectations import os import platform import pytest import great_expectations as ge from great_expectations.data_context.util import file_relative_path def test_expect_file_line_regex_match_count_to_be_between(): #####Invalid File Path###### joke_file_path = "joke.txt" assert not os.path.is...
great-expectations/great_expectations
tests/data_asset/test_filedata_asset_expectations.py
Python
apache-2.0
10,517
""" Nose testing plugin for configuring Workspace URL during tests. """ # Imports # Stdlib import os # Third-party from nose.plugins import Plugin # Local from doekbase.data_api import core from doekbase.data_api.util import get_logger # Logging _log = get_logger(__name__) class WorkspaceURL(Plugin): """Plugin t...
realmarcin/data_api
lib/doekbase/data_api/tests/nose_plugin_wsurl.py
Python
mit
2,127
# -*- coding: utf-8 - # # This file is part of http_parser released under the MIT license. # See the NOTICE for more information. version_info = (0, 7, 5) __version__ = ".".join(map(str, version_info))
emidln/django_roa
env/lib/python2.7/site-packages/http_parser/__init__.py
Python
bsd-3-clause
203
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: Robert McGibbon # Contributors: Kyle A. Beauchamp # # MDTraj i...
daviddesancho/mdtraj
mdtraj/geometry/__init__.py
Python
lgpl-2.1
2,293
from cobiv.MainApp import Cobiv if __name__ == '__main__': Cobiv().run()
gokudomatic/cobiv
cobiv.py
Python
mit
78
"""Fixer for import statements. If spam is being imported from the local directory, this import: from spam import eggs Becomes: from .spam import eggs And this import: import spam Becomes: from . import spam """ # Local imports from .. import fixer_base from os.path import dirname, join,...
harmy/kbengine
kbe/res/scripts/common/Lib/lib2to3/fixes/fix_import.py
Python
lgpl-3.0
3,354
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ("pinboard", "0013_auto_20151026_1546"), ] operations = [ migrations.AlterModelOptions( name="bookmarktag", ...
philgyford/django-ditto
ditto/pinboard/migrations/0014_auto_20151028_1556.py
Python
mit
689
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Tickfont(_BaseLayoutHierarchyType): # class properties # -------------------- _parent_path_str = "layout.smith.imaginaryaxis" _path_str = "layout.smith.imaginaryaxis.tickfont" _valid_pr...
plotly/plotly.py
packages/python/plotly/plotly/graph_objs/layout/smith/imaginaryaxis/_tickfont.py
Python
mit
8,509
''' add data to dataset ''' import os import re import sys import time import fcntl import datetime import commands import threading import xml.dom.minidom import ErrorCode from dq2.clientapi import DQ2 try: from dq2.clientapi.cli import Register2 except: pass import brokerage.broker_util import Closer from...
fbarreir/panda-server
pandaserver/dataservice/Adder2.py
Python
apache-2.0
54,260
try: import unittest2 as unittest except ImportError: import unittest from simon import Model from simon.base import Meta from .utils import ModelFactory class TestModelFactory(unittest.TestCase): def test_modelfactory(self): """Test the `ModelFactory()` method.""" TestModel = ModelFacto...
dirn/Simon
tests/test_test_utils.py
Python
bsd-3-clause
2,155
# -*- test-case-name: twisted.test.test_log -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Logging and metrics infrastructure. """ from __future__ import division import sys import time import warnings from datetime import datetime import logging from zope.interface import Interface...
nlloyd/SubliminalCollaborator
libs/twisted/python/log.py
Python
apache-2.0
18,774
#!/usr/bin/env python # encoding: utf-8 import threading import select _EPOLLIN = 0x001 _EPOLLOUT = 0x004 _EPOLLERR = 0x008 _EPOLLHUP = 0x010 # Our events map exactly to the epoll events NONE = 0 READ = _EPOLLIN WRITE = _EPOLLOUT ERROR = _EPOLLERR | _EPOLLHUP class IOLoop(object): _instance_lock = thread...
mengzhuo/ioloop
ioloop/__init__.py
Python
mit
2,440
""" Support for Sense HAT sensors. For more details about this component, please refer to the documentation at https://home-assistant.io/components/sensor.sensehat """ import os import logging from datetime import timedelta import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from hom...
JshWright/home-assistant
homeassistant/components/sensor/sensehat.py
Python
apache-2.0
4,285
# # Status Indicator Circuit Controller # Author: Francis T # # Controls the status indicator circuit to reflect the current state # of the aggregator node # from time import sleep # import RPi.GPIO as GPIO import dummy_gpio as GPIO STATUS_INACTIVE = 0 STATUS_READY = 1 STATUS_BUSY = 2 STATUS_SHUTDOWN ...
Francis-T/citas-dryad
dryad/status_controller.py
Python
mit
1,968
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
bearstech/ansible
lib/ansible/modules/cloud/cloudstack/cs_vmsnapshot.py
Python
gpl-3.0
8,253
from __future__ import division from bisect import bisect_left from ea_globals import * from operator import attrgetter import random import math def roulette(prob_list): '''TODO: Explain this shit''' cumulative = [prob_list[i] + sum(prob_list[:i]) for i in xrange(len(prob_list))] randval = random.random(...
imre-kerr/better-ea
ea/parent_selection.py
Python
mit
3,043
#!/usr/bin/env python """ """ # Python 2.6 and newer support from __future__ import (absolute_import, division, print_function, unicode_literals) from future.builtins import ( bytes, dict, int, list, object, range, str, ascii, chr, hex, input, next, oct, open, ...
sfinucane/deviceutils
deviceutils/error/error.py
Python
apache-2.0
1,279
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "BlogforSummyChou.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Adai0808/SummyChou
BlogforSummyChou/manage.py
Python
gpl-2.0
259
""" Horizontal boxplot with observations ==================================== _thumb: .7, .37 """ import seaborn as sns import matplotlib.pyplot as plt sns.set_theme(style="ticks") # Initialize the figure with a logarithmic x axis f, ax = plt.subplots(figsize=(7, 6)) ax.set_xscale("log") # Load the example planets ...
mwaskom/seaborn
examples/horizontal_boxplot.py
Python
bsd-3-clause
768
# Copyright (c) 2013 Rackspace Hosting # 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 req...
zestrada/nova-cs498cc
nova/tests/cells/test_cells_state_manager.py
Python
apache-2.0
4,370
import sys import time from multiprocessing import Process, Queue import yaml import numpy as np import zmq import pycuda.driver as drv sys.path.append('./lib') from tools import (save_weights, load_weights, save_momentums, load_momentums) from train_funcs import (unpack_configs, adjust_learning_ra...
mesnilgr/theano_alexnet
train.py
Python
bsd-3-clause
6,671
""" Wrapper around path.py to add dry run support and other paver integration. """ from __future__ import with_statement import functools import os from contextlib import contextmanager import sys if sys.version_info[0] == 3: from paver.deps.path3 import path as _orig_path else: from paver.deps.path2 import p...
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/paver/path.py
Python
agpl-3.0
2,647
# -*- coding: utf-8 -*- from django.db import migrations, models from django.conf import settings import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('issuer', '0023_auto_20170531_1044'), ] ...
concentricsky/badgr-server
apps/backpack/migrations/0001_initial.py
Python
agpl-3.0
3,368
#!/usr/bin/python """ This sample application is a server that supports many core services that applications need to present data on a BACnet network. It supports Who-Is and I-Am for device binding, Read and Write Property, Read and Write Property Multiple, and COV subscriptions. Change the process_task() function t...
JoelBender/bacpypes
samples/mini_device.py
Python
mit
3,599
from pkg_resources import parse_version from pyramid.interfaces import ( PHASE1_CONFIG, PHASE2_CONFIG, ) import venusian def includeme(config): config.registry['migrator'] = Migrator() config.add_directive('add_upgrade', add_upgrade) config.add_directive('add_upgrade_step', add_upgrade_step) c...
ClinGen/clincoded
src/contentbase/upgrader.py
Python
mit
6,948
""" sentry.management.commands.upgrade ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function from django.core.management import call_command from django.core.mana...
argonemyth/sentry
src/sentry/management/commands/upgrade.py
Python
bsd-3-clause
1,149
"""Coregistration between different coordinate frames.""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) from .externals.six.moves import configparser from .externals.six import string_types import fnmatch from glob import glob, iglob import os import stat import sys import re i...
jaeilepp/mne-python
mne/coreg.py
Python
bsd-3-clause
42,970
from django.http import HttpResponseRedirect from django.views import generic from traceability.models.incident import Incident from traceability.forms.incident import UpdateFormSet, IncidentUpdate class IncidentDetail(generic.DetailView): model = Incident template_name = 'traceability/incident/incident_detai...
vandorjw/django-traceability
traceability/views/incident.py
Python
bsd-3-clause
2,000
"""Tests for the certificates panel of the instructor dash. """ import contextlib import ddt import mock import json from nose.plugins.attrib import attr from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist from django.test.utils import override_settings from django.conf i...
cognitiveclass/edx-platform
lms/djangoapps/instructor/tests/test_certificates.py
Python
agpl-3.0
38,581
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
cpcloud/arrow
cmake-format.py
Python
apache-2.0
2,947
""" Test service is deployed and running """ def test_httpd_is_running(Service): httpd = Service('httpd') assert httpd.is_enabled assert httpd.is_running def test_httpd_is_serving(Command): assert Command('curl 127.0.0.1').rc == 0
amitsaha/learning
infra/testing/testinfra/test_deployment.py
Python
unlicense
250
from selenium.webdriver.common.by import By class LearningCircleCreationPageLocators(object): FIRST_COURSE_BUTTON = (By.CSS_SELECTOR, ".result-item:nth-child(1) button") FIRST_COURSE_TITLE = (By.CSS_SELECTOR, ".result-item .title") REMOVE_COURSE_SELECTION_LINK = (By.LINK_TEXT, "Remove selection") NEXT_...
p2pu/learning-circles
e2e/tests/selenium/locators.py
Python
mit
3,035
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license # encoding: 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): pass ...
thiagof/treeio
treeio/news/south_migrations/0001_initial.py
Python
mit
413
from __future__ import absolute_import, print_function, unicode_literals from django.views.generic.base import TemplateView class CoachToolsView(TemplateView): template_name = "coach/coach.html"
aronasorman/kolibri
kolibri/plugins/coach/views.py
Python
mit
201
# -*- coding: utf-8 -*- # Scrapy settings for slideshare project # # For simplicity, this file contains only the most important settings by # default. All the other settings are documented here: # # http://doc.scrapy.org/en/latest/topics/settings.html # BOT_NAME = 'slideshare' SPIDER_MODULES = ['slideshare.spide...
lmorillas/recursoscaa
slideshare/settings.py
Python
apache-2.0
552
from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('grades.views', url(r'^$', 'list', name='list'), url(r'^get/(?P<idObj>\d+)/$', 'get', name='get'), url(r'^create/$', 'create', name='create'), url(r'^delete/(?P<idObj>\d+)$', 'delete', name='delete'), url(r'^update/...
tdsimao/tt
grades/urls.py
Python
gpl-2.0
435
from Tools.Profile import profile profile('LOAD:ElementTree') import xml.etree.cElementTree import os profile('LOAD:enigma_skin') from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop from Components.config import ConfigSubsection, ...
fairbird/OpenPLI-BlackHole
skin.py
Python
gpl-2.0
41,554
from datetime import datetime, timedelta from sqlalchemy import Column, DateTime, Integer, String, PickleType from sqlalchemy.sql import func from database.model import Base class Message(Base): __tablename__ = 'message' id = Column(Integer, primary_key=True) source = Column(String(20)) ...
nstoik/sensor_monitor
database/message_model.py
Python
apache-2.0
1,187
"""Test methods for `zcode/math/math_core.py`. Can be run with: $ nosetests math/tests/test_math_core.py $ nosetests math/tests/test_math_core.py:TestMathCore.test_around $ python math/tests/test_math_core.py """ from __future__ import absolute_import, division, print_function, unicode_literals import nu...
lzkelley/zcode
zcode/math/tests/test_math_core.py
Python
mit
31,267
from django.conf.urls.defaults import patterns urlpatterns = patterns('djangorestframework.utils.staticviews', (r'^accounts/login/$', 'api_login'), (r'^accounts/logout/$', 'api_logout'), )
seanfisk/buzzword-bingo-server
djangorestframework/urls.py
Python
bsd-3-clause
198
#!/usr/local/bin/env python # ============================================================================================= # MODULE DOCSTRING # ============================================================================================= """ Run YANK self tests after installation. """ # ===========================...
pgrinaway/yank
Yank/commands/selftest.py
Python
lgpl-3.0
6,835
VERSION = (0, 1, 0) __version__ = VERSION __versionstr__ = '.'.join(map(str, VERSION))
Almad/rpgrules
rpgrules/__init__.py
Python
bsd-3-clause
90
#!/usr/bin/env python import os import sys import argparse import math import pat3dem.pdb as p3p def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <pdb1, pdb2> Output pdb1, whose bfactor is replaced by CA deviation between pdb1 and pdb2. """ args_def = {} parser = argparse....
emkailu/PAT3DEM
bin/p3pdbdev.py
Python
mit
1,439
import time import traceback as tb import pickle import requests import sys import os.path from collections import defaultdict, deque from datetime import datetime from config import * ### Message Queues ### last_message = datetime(2000, 1, 1) priority_queue = [] message_queue = [] def group_value_factory(): retu...
tysongg/zkillbot
zkillbot.py
Python
mit
6,018
# encoding: 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): # Deleting field 'RafflePrize.round_name' db.delete_column('raffle_raffleprize', 'round_name') def b...
KendyllD/boukenda-project
makahiki/apps/widgets/raffle/migrations/0003_auto__del_field_raffleprize_round_name.py
Python
mit
5,980
import os import subprocess import numpy """ This script creates a symbolic link to the chimp source code in your python's site-packages directory """ np_path = numpy.__file__ source_path = os.path.dirname(os.path.realpath("setup.py")) + "/chimp" np_split = np_path.split("/") target_path = '/'.join(np_split[:-2]) + ...
sisl/Chimp
setup.py
Python
apache-2.0
452
# version code 3e169d60c2de+ coursera = 1 # Please fill out this stencil and submit using the provided submission script. ## 1: (Problem 0.8.3) Tuple Sum def tuple_sum(A, B): ''' Input: -A: a list of tuples -B: a list of tuples Output: -list of pairs (x,y) in which the first element o...
M4573R/Coding-the-Matrix-Linear-Algebra-through-Computer-Science-Applications
The_Function_problems.py
Python
mit
1,473
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 3.0.0.11832 (http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit) on 2017-03-22. # 2017, SMART Health IT. from . import domainresource class ExplanationOfBenefit(domainresource.DomainResource): """ Explanation of Benefit resource. ...
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_3_0_0/models/explanationofbenefit.py
Python
bsd-3-clause
58,443
#!/usr/bin/python # -*- coding: utf-8 -*- numero = 34 + 5j
psicobyte/ejemplos-python
cap5/p55b.py
Python
gpl-3.0
60
import time import picamera import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(23, GPIO.IN) GPIO.setup(18, GPIO.OUT) GPIO.output(18, False) while True: if(GPIO.input(23) == 1): print "motion" GPIO.output(18, True) with picamera.PiCamera() as camera: # Turn the camera's ...
jmbott/test-repo
motion_cam.py
Python
mit
1,069
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # streamondemand.- XBMC Plugin # Canal para piratestreaming # http://blog.tvalacarta.info/plugin-xbmc/streamondemand. # ------------------------------------------------------------ import re import sys import urlparse from core impo...
orione7/Italorione
channels/guardarefilm.py
Python
gpl-3.0
11,213
# -*- coding: utf-8 -*- from django.conf import settings from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^', include('blogging.urls')), ]
jibaku/blogging
tests/urls.py
Python
bsd-3-clause
240
"""timezone at metavj level Revision ID: 224621d9edde Revises: 14346346596e Create Date: 2015-12-21 16:52:30.275508 """ # revision identifiers, used by Alembic. revision = '224621d9edde' down_revision = '5a590ae95255' from alembic import op import sqlalchemy as sa import geoalchemy2 as ga def upgrade(): op.cr...
TeXitoi/navitia
source/sql/alembic/versions/224621d9edde_timezone_at_metavj_level.py
Python
agpl-3.0
1,446
#!/usr/bin/env python # # $File: statNeInterval.py $ # # This file is part of simuPOP, a forward-time population genetics # simulation environment. Please visit http://simupop.sourceforge.net # for details. # # Copyright (C) 2004 - 2010 Bo Peng (bpeng@mdanderson.org) # # This program is free software: you can redistri...
BoPeng/simuPOP
docs/statNeInterval.py
Python
gpl-2.0
1,919
# Django from django.contrib import admin # Internal from .models import Mapping class MappingAdmin(admin.ModelAdmin): fields = ('label', 'data_map',) list_display = ('label', 'data_map',) search_fields = ('label',) admin.site.register(Mapping, MappingAdmin)
YAmikep/django-xmlmapping
xmlmapping/admin.py
Python
bsd-3-clause
290
from django.test import TestCase from .models import ( Event, Movie, Package, PackageNullFK, Person, Screening, ScreeningNullFK, ) # These are tests for #16715. The basic scheme is always the same: 3 models with # 2 relations. The first relation may be null, while the second is non-nullable. # In some cases, Dja...
Beauhurst/django
tests/nested_foreign_keys/tests.py
Python
bsd-3-clause
9,453
from __future__ import absolute_import from datetime import datetime import pytz import logging from django.conf import settings from django.contrib.auth import logout from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers, status from rest_framework.response import Response ...
beeftornado/sentry
src/sentry/api/endpoints/user_details.py
Python
bsd-3-clause
8,705
#!/usr/bin/env python3 import math # hardcoded values and physical constants MAX_ITERATIONS = 1000000 EM_DRIVE_FORCE = 1000 GRAVITATION = 6.67408e-11 FALCON_9_MASS = 549054 # kg DIST_ALPHA_CENTAURI = 4.0113e16 # m EARTH = { 'mass': 5.972e24, # kg 'radius': 6371000, # m 'orbital_radius': 1...
isobelsv/nyu-python
assignment_7/debugging.py
Python
mit
4,260
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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 p...
maxikov/bikedatan
data_utils.py
Python
gpl-3.0
6,356
# -*- coding: utf-8 -*- from openerp import fields, models, api class crm_leads_dry_run(models.TransientModel): _name = "crm.leads.dry.run" lead_id = fields.Many2one('crm.lead', string='Lead', required=True) team_id = fields.Many2one('crm.team', string='SaleTeam', required=True, oldname='section_id') ...
addition-it-solutions/project-all
addons/website_crm_score/models/leads_dry_run.py
Python
agpl-3.0
1,257
# -*- coding: utf-8 -*- import re import sys import _pytest._code import py import pytest from _pytest import python, fixtures import hypothesis from hypothesis import strategies PY3 = sys.version_info >= (3, 0) class TestMetafunc(object): def Metafunc(self, func, config=None): # the unit tests of this...
tareqalayan/pytest
testing/python/metafunc.py
Python
mit
54,856
# 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...
googleapis/google-cloud-cpp-bigquery
.cmake-format.py
Python
apache-2.0
1,408
#!/usr/bin/python # -*- coding: utf-8 -*- # # striations.py: A class to implement striations in the affine plane...
glassnotes/Balthasar
src/balthasar/striations.py
Python
bsd-3-clause
6,780
# -*- coding: utf-8 -*- from __future__ import with_statement import copy from django.contrib.sites.models import Site from cms.api import create_page from cms.models import Page, Placeholder from cms.utils import get_cms_setting from cms.test_utils.testcases import CMSTestCase from cms.test_utils.util.context_manage...
damianmoore/django-cms
cms/tests/site.py
Python
bsd-3-clause
5,996
""" Universidad Nacional de La Matanza Catedra Lenguajes y Compiladores - 2013 Mariano Francischini, Alejandro Giorgi, Roberto Bravo TP Compilador Basado en PLY (Python Lex-Yacc) http://www.dabeaz.com/ply/ Ej: http://www.dalkescientific.com/writings/NBN/parsing_with_ply.html """ # coding=utf8 import ply.yacc a...
xbx/compilador_yacc
lenguaje.py
Python
mit
10,617
"""Data handling by server or instance.""" import json import urllib3 class DataHandler(object): """Handle data.""" def __init__(self, server_port=None): """Initialize. :param server_port: Int. local port. """ self.server_port = server_port self.logged_requests = {} ...
danpozmanter/monitor_requests
monitor_requests/data.py
Python
bsd-3-clause
3,207
""" WSGI config for motte project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "motte.settings") from django.core.wsgi ...
doctormo/motte
motte/wsgi.py
Python
agpl-3.0
385
"""Define a function called anti_vowel that takes one string, text, as input and returns the text with all of the vowels removed. For example: anti_vowel("Hey You!") should return "Hy Y!". Don't count Y as a vowel. Make sure to remove lowercase and uppercase vowels.""" def anti_vowel(text): vowels = "aeiouAEIOU" n...
MapuH/Coursera-Python
anti-vowels.py
Python
mit
470
#!/usr/bin/python # -*- coding: utf-8 -*- # ===--- test_compare_perf_tests.py --------------------------------------===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library...
jckarter/swift
benchmark/scripts/test_compare_perf_tests.py
Python
apache-2.0
46,859
from probfit.pdf import crystalball from probfit.plotting import draw_normed_pdf import matplotlib.pyplot as plt bound = (5.22, 5.30) arg = dict(alpha=1., n=2., mean=5.28, sigma=0.01) draw_normed_pdf(crystalball, arg=arg, bound=bound, label=str(arg), density=True) arg = dict(alpha=0.5, n=10., mean=5.28, sigma=0.005)...
mtresch/probfit
doc/pyplots/pdf/crystalball.py
Python
mit
458
# =============================================================================== # Copyright 2020 ross # # 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/LICE...
USGSDenverPychron/pychron
pychron/pipeline/nodes/runid_edit.py
Python
apache-2.0
4,327
#************************************************************************* #* Dionaea #* - catches bugs - #* #* #* #* Copyright (C) 2010 Markus Koetter #* #* This program is free software; you can redistribute it and/or #* modify it under the terms of the GNU Gen...
GovCERT-CZ/dionaea
modules/python/scripts/smb/include/asn1/ber.py
Python
gpl-2.0
15,167
""" MiniMax and AlphaBeta algorithms. Author: Cyrille Dejemeppe <cyrille.dejemeppe@uclouvain.be> Copyright (C) 2014, Université catholique de Louvain 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; v...
fthuin/artificial-intelligence
assignment3/Code/zipremise/minimax.py
Python
mit
4,112
#!/usr/bin/env python3 from LoLIM.interferometry.interferometry_absBefore import interferometric_locator ## these lines are anachronistic and should be fixed at some point from LoLIM import utilities utilities.default_raw_data_loc = "/exp_app2/appexp1/public/raw_data" utilities.default_processed_data_loc = "/home/br...
Bhare8972/LOFAR-LIM
LIM_scripts/interferometry/examples/run_3Dinterferometry_absBefore.py
Python
mit
2,688
from __future__ import print_function import os from git import GitConfigParser, Repo import six # github group GROUP = "BristolTopGroup" # mapping of github user names to aliases (for remotes) DEVELOPERS = { "DouglasBurns": "doug", "EmyrClement": 'emyr', "kreczko": 'luke', } GITHUB_BASE = "https://github....
BristolTopGroup/BristolAnalysisSoftwareStack
recipes/git_projects.py
Python
apache-2.0
1,665
import threading import math from typing import Callable, Dict, Iterable, List, Optional, Union try: from collections.abc import Mapping except ImportError: from collections import Mapping import logging import binascii from ..sdo import SdoAbortedError from .. import objectdictionary from .. import variable ...
christiansandberg/canopen
canopen/pdo/base.py
Python
mit
24,131
from django.conf.urls import include, url from dynamic_rest.routers import DynamicRouter from tests import viewsets router = DynamicRouter() router.register_resource(viewsets.UserViewSet) router.register_resource(viewsets.GroupViewSet) router.register_resource(viewsets.ProfileViewSet) router.register_resource(viewset...
sanoma/dynamic-rest
tests/urls.py
Python
mit
995
from parameters import * __all__ = ["Param", "ParamPair", "ParamMap", "ParamGridBuilder"]
mengxr/spark-ml
src/main/python/ml/__init__.py
Python
apache-2.0
91
import pytest import sqlalchemy as sa from sqlalchemy_continuum import versioning_manager from sqlalchemy_continuum.plugins import ActivityPlugin from tests import TestCase, QueryPool, uses_native_versioning class ActivityTestCase(TestCase): plugins = [ActivityPlugin()] def create_models(self): TestC...
avilaton/sqlalchemy-continuum
tests/plugins/test_activity.py
Python
bsd-3-clause
5,680
seed = "jc74FlUna852Ji9o" seed += (17 - len(seed))*"\x00" seed_l = [ord(s) for s in seed] domain = "blackfreeqazyio.cc" print(domain) for i in range(100): domain_l = [ord(l) for l in domain] seed_sum = sum(seed_l[:16]) new_domain = [] tmp = seed_l[15] & 0xFF for i in range(12): while True: ...
trogdorsey/domain_generation_algorithms
tinba/dga.py
Python
gpl-2.0
736
# vim: fileencoding=utf-8 et ts=4 sts=4 sw=4 tw=0 """ A base class for RPC services and proxies. Authors: * Brian Granger * Alexander Glyzov * Axel Voitier """ #----------------------------------------------------------------------------- # Copyright (C) 2012-2014. Brian Granger, Min Ragan-Kelley, Alexander Glyzov,...
Alidron/demo-nao
alidron-env/lib/python2.7/site-packages/netcall/base.py
Python
mpl-2.0
15,091
# -*- python -*- # -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2001-2007 Donald N. Allingham, Martin Hawlisch # # 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...
Forage/Gramps
gramps/gen/utils/libformatting.py
Python
gpl-2.0
7,920
from django.core.exceptions import ObjectDoesNotExist from django.db.models.query import F from django.http import Http404 from django_filters import ModelChoiceFilter from django_filters.rest_framework import CharFilter from django_filters.rest_framework import DjangoFilterBackend from django_filters.rest_framework im...
DXCanas/kolibri
kolibri/core/logger/api.py
Python
mit
8,848
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import difflib from collections import Order...
claudep/pootle
pootle/apps/pootle_store/diff.py
Python
gpl-3.0
12,331
# python 1.py tools/libxl/libxl.c libxl 372 import sys import commands argvs = sys.argv argc = len(argvs) f = open(argvs[1]) line = f.readline() while line: #print line.strip() cmdstr = "grep " + line.strip() + " apkurl.txt" print cmdstr check = commands.getoutput("cmdstr") line = f.readl...
twurl/farisvm
src/grep.py
Python
bsd-3-clause
327
import json from contextlib import contextmanager import datetime from django import template from django.template.base import Node, Parser, TOKEN_VAR, TOKEN_TEXT from .. import appsettings from ..views import AngularMagicMixin register = template.Library() class AngularAppNode(Node): def __init__(self, nodel...
dferens/django-angularmagic
angularmagic/templatetags/angularmagic.py
Python
mit
1,418
from flask import Blueprint, current_app from flask_jwt_extended import jwt_required from app.comms.stats import send_ga_event from app.dao.emails_dao import dao_get_emails_sent_count from app.na_celery.stats_tasks import send_num_subscribers_and_social_stats from app.errors import register_errors stats_blueprint = B...
NewAcropolis/api
app/routes/stats/rest.py
Python
mit
1,794
"""Module containing class `InvertibleMap`.""" class InvertibleMap: def __call__(self, x): raise NotImplementedError() @property def inverse(self): raise NotImplementedError()
HaroldMills/Vesper
vesper/signal/invertible_map.py
Python
mit
218
# python script to generate configoptions.cpp from config.xml # # Copyright (C) 1997-2013 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby # granted. No representations are made about the suitabi...
basvodde/doxygen
src/configgen.py
Python
gpl-2.0
5,064
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
bealdav/OpenUpgrade
openerp/addons/base/res/ir_property.py
Python
agpl-3.0
7,509
# Copyright (c) 2011-2015 Rusty Wagner # # 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...
ColdHeat/binaryninja-python
Fonts.py
Python
gpl-2.0
2,763
import numpy as np import time def sigmoid(input): return 1.0 / (1 + np.exp(-input)) class BoltzmannMachine(object): def __init__(self, input_size, hidden_size, output_size): self.total_nodes = input_size + hidden_size + output_size self.state = np.random.randint(0, 2, self.total_nodes, dtyp...
Spstolar/BMachine
PythonCode/genericBM_hw_part_1.py
Python
mit
4,375
# coding: utf-8 """ Vericred API Vericred's API allows you to search for Health Plans that a specific doctor accepts. ## Getting Started Visit our [Developer Portal](https://developers.vericred.com) to create an account. Once you have created an account, you can create one Application for Production and an...
vericred/vericred-python
test/test_provider_show_response.py
Python
apache-2.0
10,071
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 CERN. ## ## Invenio 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) a...
jmartinm/invenio
modules/webauthorprofile/lib/webauthorprofile_interface.py
Python
gpl-2.0
919
import axi2s_c import sys uut = axi2s_c.axi2s_c() uut.read(sys.argv[1])
ruishihan/R7-with-notes
src/python/ioread.py
Python
apache-2.0
82
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # ...
vlegoff/tsunami
src/primaires/evt/commandes/__init__.py
Python
bsd-3-clause
1,667
#----------------------------------------------------------------------------- # Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley # # This file is part of pyzmq # # Distributed under the terms of the New BSD License. The full license is in # the file COPYING.BSD, distributed as part of this software. #-----...
skycucumber/Messaging-Gateway
webapp/venv/lib/python2.7/site-packages/zmq/tests/test_ioloop.py
Python
gpl-2.0
3,903