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
""" $url teamliquid.net $url tl.net $type live """ import logging import re from urllib.parse import urlparse from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugins.afreeca import AfreecaTV from streamlink.plugins.twitch import Twitch log = logging.getLogger(__name__) @pluginmatcher(re.compile...
streamlink/streamlink
src/streamlink/plugins/teamliquid.py
Python
bsd-2-clause
1,128
0.000887
"""" This module handles sending grades back to edX Most of this module is a python 3 port of pylti (github.com/mitodl/sga-lti) and should be moved back into that library. """ import uuid from xml.etree import ElementTree as etree import oauth2 from django.conf import settings class SendGradeFailure(Exception): ...
koljanos/sga-lti
sga/backend/send_grades.py
Python
bsd-3-clause
4,039
0.00099
""" The Spatial Reference class, represents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY...
sametmax/Django--an-app-at-a-time
ignore_this_directory/django/contrib/gis/gdal/srs.py
Python
mit
11,540
0.00078
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # ERPNext - web based ERP (http://erpnext.com) # For license information, please see license.txt from __future__ import unicode_literals import frappe, unittest from frappe.utils import flt, ...
manqala/erpnext
erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
Python
gpl-3.0
4,815
0.023261
from flask_wtf import Form from flask_wtf.file import FileRequired, FileAllowed, FileField from wtforms import StringField, BooleanField, PasswordField, TextAreaField from wtforms.validators import DataRequired, Email, Length class SignUpForm(Form): username = StringField('username', validators=[DataRequired(), L...
andersbogsnes/blog
app/forms.py
Python
mit
1,224
0.006536
import tensorflow as tf import numpy as np class TextCNN(object): ''' A CNN for text classification Uses and embedding layer, followed by a convolutional, max-pooling and softmax layer. ''' def __init__( self, sequence_length, num_classes, embedding_size, filter_sizes, num_filters,...
imyeego/MLinPy
zh_cnn_text_classify/text_cnn.py
Python
mit
3,414
0.045694
from django.conf import settings from django.template import loader from django.views.i18n import set_language from xadmin.plugins.utils import get_context_dict from xadmin.sites import site from xadmin.views import BaseAdminPlugin, CommAdminView, BaseAdminView class SetLangNavPlugin(BaseAdminPlugin): def block...
sshwsfc/django-xadmin
xadmin/plugins/language.py
Python
bsd-3-clause
1,002
0.003992
# """SearchIndex classes for Django-haystack.""" from typing import List from django.utils.html import format_html, mark_safe from haystack import indexes from projects.models import Project, Nomination, Claim class ProjectIndex(indexes.SearchIndex, indexes.Indexable): """Django-haystack index of Project model....
CobwebOrg/cobweb-django
projects/search_indexes.py
Python
mit
4,143
0.003862
""" Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,i...
amrdraz/brython
www/src/Lib/encodings/iso8859_1.py
Python
bsd-3-clause
13,483
0.021064
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Functionality to build scripts, as well as SignatureHash(). This file is modified from python-ioplib. ...
Anfauglith/iop-hd
test/functional/test_framework/script.py
Python
mit
25,954
0.01021
# Config.py file for motion-track.py # Display Settings debug = True # Set to False for no data display window_on = False # Set to True displays opencv windows (GUI desktop reqd) diff_window_on = False # Show OpenCV image difference window thresh_window_on = False # Show OpenCV image Threshold window SHOW_C...
lustigerluke/motion-track
config.py
Python
mit
1,176
0.005102
import os import re import json import shutil import tarfile import tempfile from climb.config import config from climb.commands import Commands, command, completers from climb.exceptions import CLIException from climb.paths import format_path, split_path, ROOT_PATH from grafcli.documents import Document, Dashboard, R...
m110/grafcli
grafcli/commands.py
Python
mit
8,828
0.000227
# coding: utf-8 # Copyright 2015 Jonathan Goble # # 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, merge, ...
jcgoble3/luapatt
tests/test_lua1_basics.py
Python
mit
6,266
0.009595
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(5, GPIO.OUT) GPIO.output(5, GPIO.HIGH) GPIO.output(5, GPIO.LOW)
phodal/iot-code
chapter2/gpio.py
Python
mit
124
0
# This file is part of Buildbot. Buildbot 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 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
anish/buildbot
master/buildbot/test/unit/test_revlinks.py
Python
gpl-2.0
5,555
0.00234
#!/usr/bin/python # # Copyright (C) 2010, 2011 Google Inc. # # 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 p...
badp/ganeti
test/py/ganeti.rapi.client_unittest.py
Python
gpl-2.0
59,059
0.004809
import re import simplejson from django.contrib.auth.models import User from django.test import TestCase from django.urls import reverse from astrobin.models import Collection, Image from astrobin_apps_images.models import KeyValueTag class CollectionTest(TestCase): def setUp(self): self.user = User.obj...
astrobin/astrobin
astrobin/tests/test_collection.py
Python
agpl-3.0
11,674
0.002998
from collections import OrderedDict import pytest from ucca import textutil from ucca.constructions import CATEGORIES_NAME, DEFAULT, CONSTRUCTIONS, extract_candidates from .conftest import PASSAGES, loaded, loaded_valid, multi_sent, crossing, discontiguous, l1_passage, empty """Tests the constructions module functio...
danielhers/ucca
ucca/tests/test_constructions.py
Python
gpl-3.0
2,357
0.00594
""" RFB protocol implementattion, client side. Override RFBClient and RFBFactory in your application. See vncviewer.py for an example. Reference: http://www.realvnc.com/docs/rfbproto.pdf (C) 2003 [email protected] MIT License """ # flake8: noqa import sys import math import zlib import getpass import os from Crypto...
sibson/vncdotool
vncdotool/rfb.py
Python
mit
35,587
0.005789
#!/usr/bin/python import argparse import sys import os import subprocess import signal import getpass import simplejson from termcolor import colored import ConfigParser import StringIO import functools import time import random import string from configobj import ConfigObj import tempfile import pwd, grp import trace...
mrwangxc/zstack-utility
zstackctl/zstackctl/ctl.py
Python
apache-2.0
302,359
0.005626
from django.db.models import Prefetch, Case, When, Value, IntegerField, Q from lily.accounts.models import Website, Account from lily.integrations.models import Document from lily.notes.models import Note from lily.socialmedia.models import SocialMedia from lily.tags.models import Tag from lily.utils.models.models imp...
HelloLily/hellolily
lily/hubspot/prefetch_objects.py
Python
agpl-3.0
2,414
0.000829
import asyncio import inspect import itertools import string import typing from .. import helpers, utils, hints from ..requestiter import RequestIter from ..tl import types, functions, custom if typing.TYPE_CHECKING: from .telegramclient import TelegramClient _MAX_PARTICIPANTS_CHUNK_SIZE = 200 _MAX_ADMIN_LOG_CHU...
expectocode/Telethon
telethon/client/chats.py
Python
mit
42,127
0.000688
#!/usr/bin/python #coding: utf-8 from __future__ import unicode_literals import os import unittest import xlrd import msp.schedule_parser as schedule_parser __author__ = "Andrey Konovalov" __copyright__ = "Copyright (C) 2014 Andrey Konovalov" __license__ = "MIT" __version__ = "0.1" this_dir, this_filename = os.pat...
xairy/mipt-schedule-parser
msp/test/schedule_tests.py
Python
mit
8,974
0.007132
import codecs import doctest import inspect import io import os import platform import re import shutil import subprocess import sys import textwrap import time import traceback import types def place( frame_record): ''' Useful debugging function - returns representation of source position of caller. ...
ArtifexSoftware/mupdf
scripts/jlib.py
Python
agpl-3.0
81,616
0.004717
from collections import namedtuple from model.flyweight import Flyweight from model.static.database import database class ControlTowerResource(Flyweight): def __init__(self,control_tower_type_id): #prevents reinitializing if "_inited" in self.__dict__: return self._inited = None...
Iconik/eve-suite
src/model/static/inv/control_tower_resources.py
Python
gpl-3.0
1,085
0.00553
# -*- coding: utf-8 -*- # Functions to parse court data in XML format into a list of dictionaries. import hashlib import os import re import xml.etree.cElementTree as ET import dateutil.parser as dparser from juriscraper.lib.string_utils import titlecase, harmonize, clean_string, CaseNameTweaker from lxml import etre...
voutilad/courtlistener
cl/corpus_importer/import_columbia/parse_opinions.py
Python
agpl-3.0
15,489
0.002066
"""File to interact with cache folder to isolate cache handling functionality from main controllers code. The CacheHandler should only be accessed by controller classes. """ #.-------------------. #| imports | #'-------------------' import os import pickle #.-------------------. #| main ...
i-sultan/Smart-Trader
src/st_cache_handler.py
Python
gpl-3.0
3,536
0.009055
import json import uuid from time import time from typing import Any, Callable, Optional import aiomcache from aiohttp import web from . import AbstractStorage, Session class MemcachedStorage(AbstractStorage): """Memcached storage""" def __init__( # type: ignore[no-any-unimported] # TODO: aiomcache ...
aio-libs/aiohttp_session
aiohttp_session/memcached_storage.py
Python
apache-2.0
3,256
0
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: """ACE -- Automated Coordinate Extraction. """ __all__ = ["config", "database", "datatable", "exporter", "set_logging_level", "scrape", "sources", "tableparser", "tests", "__version__"] import log...
neurosynth/ACE
ace/__init__.py
Python
mit
1,044
0.007663
def agts(queue): d = queue.add('dipole.py', ncpus=4, walltime=60) queue.add('plot.py', deps=d, ncpus=1, walltime=10, creates=['zero.png', 'periodic.png', 'corrected.png', 'slab.png']) queue.add('check.py', deps=d, ncpus=1, walltime=10)
robwarm/gpaw-symm
doc/tutorials/dipole_correction/submit.agts.py
Python
gpl-3.0
285
0
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.page import page_set import page_sets class PageSetsUnittest(unittest.TestCase): """Verfies that all the pagesets in th...
timopulkkinen/BubbleFish
tools/perf/page_sets/page_sets_unittest.py
Python
bsd-3-clause
643
0.010886
# $Id: admonitions.py 7681 2013-07-12 07:52:27Z milde $ # Author: David Goodger <[email protected]> # Copyright: This module has been placed in the public domain. """ Admonition directives. """ __docformat__ = 'reStructuredText' from docutils.parsers.rst import Directive from docutils.parsers.rst import states, di...
JulienMcJay/eclock
windows/Python27/Lib/site-packages/docutils/parsers/rst/directives/admonitions.py
Python
gpl-2.0
2,413
0.000414
from calendar import setfirstweekday stopped_in_user_file = True setfirstweekday(15)
akosyakov/intellij-community
python/testData/debug/test_ignore_lib.py
Python
apache-2.0
84
0.011905
# python3 """ Mastermind without kivy - by Luis merciless edited by hans """ import random import re class G(): valid_chars = '123456' secret_len = 5 solved = '+' * secret_len regex_str = "^[{0}]{{{1},{1}}}$".format(valid_chars, secret_len) valid_input = re.compile(regex_str) # regular exp...
hans-boden/pyws-fablab-lisbon
contribs/luis_mp/mm_proposal_wo_kivi.py
Python
unlicense
1,919
0.008863
#!/usr/bin/env python #-*- coding: utf-8 -*- import multiprocessing, time class Consumer(multiprocessing.Process): def __init__(self, task_queue, result_queue): multiprocessing.Process.__init__(self) self.task_queue = task_queue self.result_queue = result_queue def run(self): p...
relic7/prodimages
python/jbmodules/image_processing/marketplace/multiprocmagick.py
Python
mit
8,914
0.010433
import os import sys import errno import itertools import logging import stat import threading from fuse import FuseOSError, Operations from . import exceptions, utils from .keys import Key from .logs import Log from .views import View logger = logging.getLogger('basefs.fs') class ViewToErrno(): def __enter__...
glic3rinu/basefs
basefs/fs.py
Python
mit
8,050
0.002733
# import libraries import math import random import pygame from pygame.locals import * pygame.init() pygame.mixer.init() width, height = 800, 600 screen = pygame.display.set_mode((width, height)) keys = [False, False, False, False] player = [100, 520] invaders = [] bullets = [] bombs = [] rockets = [] rocketpieces =...
vlna/another-py-invaders
another-py-invaders.py
Python
gpl-3.0
3,451
0.006375
import django_filters import pytest from django.core.exceptions import ImproperlyConfigured from adhocracy4.filters.filters import FreeTextFilter from adhocracy4.filters.views import FilteredListView from tests.apps.questions import models as question_models class SearchFilterSet(django_filters.FilterSet): sear...
liqd/adhocracy4
tests/filter/test_free_text_filter.py
Python
agpl-3.0
2,219
0
# Challenge: guess-number game infinite number of guesses # The game: Guess the number game. # In this game we will try to guess a random number between 0 and 100 generated # by the computer. Depending on our guess, the computer will give us hints, # whether we guessed too high, too low or if we guessed correctly. # # ...
vinaymayar/python-game-workshop
lesson4/guess_game.py
Python
mit
1,288
0.009317
# Copyright (c) 2016, Science and Technology Facilities Council # This software is distributed under a BSD licence. See LICENSE.txt. """ Tests for mrcmemmap.py """ # Import Python 3 features for future-proofing from __future__ import (absolute_import, division, print_function, unicode_literals...
ccpem/mrcfile
tests/test_mrcmemmap.py
Python
bsd-3-clause
2,865
0.004538
########################################################################## # # Copyright 2011 Jose Fonseca # Copyright 2008-2009 VMware, Inc. # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to...
PeterLValve/apitrace
specs/d3d9types.py
Python
mit
30,033
0.001232
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-06-02 20:34 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 = [ migratio...
gabriellmb05/trabalho-les
src/project_manager/migrations/0001_initial.py
Python
gpl-3.0
2,659
0.004137
import typecat.font2img as f2i import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class FontBox(Gtk.FlowBoxChild): def set_text(self, arg1): if type(arg1) is str: self.text = arg1 if type(arg1) is int: self.font_size = arg1 try: ...
LordPharaoh/typecat
typecat/display/fontbox.py
Python
mit
1,483
0.00472
import server.settings import requests import json import re class BatchJob(object): def __init__(self, id, state, log): self.id = id self.state = state self.log = log def __str__(self): return 'id: %s, state: %s, log: %s' % (self.id, self.state, '\n'.join(self.log)) class S...
smartshark/serverSHARK
smartshark/sparkconnector.py
Python
apache-2.0
2,541
0.00669
# coding: utf-8 from datetime import date, datetime from typing import List, Dict, Type from openapi_server.models.base_model_ import Model from openapi_server.models.cause_action import CauseAction from openapi_server.models.free_style_build import FreeStyleBuild from openapi_server.models.free_style_project import...
cliffano/swaggy-jenkins
clients/python-aiohttp/generated/openapi_server/models/queue_left_item.py
Python
mit
8,986
0.003116
# Guillaume Valadon <[email protected]> """ Scapy *BSD native support """
CodeNameGhost/shiva
thirdparty/scapy/arch/bpf/__init__.py
Python
mit
79
0
#!/usr/bin/python # # Copyright 2008-2010 WebDriver committers # Copyright 2008-2010 Google 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...
ktan2020/legacy-automation
win/Lib/site-packages/selenium/webdriver/ie/__init__.py
Python
mit
643
0
import unittest from app.commands.file_command import FileCommand class TestFileCommand(unittest.TestCase): def setUp(self): self.window = WindowSpy() self.settings = PluginSettingsStub() self.sublime = SublimeSpy() self.os_path = OsPathSpy() # SUT self.command = ...
ldgit/remote-phpunit
tests/app/commands/test_file_command.py
Python
mit
7,821
0.005114
"""Test the TcEx Batch Module.""" # third-party import pytest class TestAttributes: """Test the TcEx Batch Module.""" @pytest.mark.parametrize( 'name,description,attr_type,attr_value,displayed,source', [ ( 'pytest-adversary-i1-001', 'Attribute Testi...
kstilwell/tcex
tests/batch/test_attributes_1.py
Python
apache-2.0
1,808
0
# Copyright 2015 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 ag...
KaranToor/MA450
google-cloud-sdk/lib/surface/config/configurations/list.py
Python
apache-2.0
2,092
0.003824
# -*- coding: utf-8 -*- """ Copyright (C) 2015, MuChu Hsu Contributed by Muchu Hsu ([email protected]) This file is part of BSD license <https://opensource.org/licenses/BSD-3-Clause> """ import unittest import logging from cameo.spiderForTECHORANGE import SpiderForTECHORANGE """ 測試 抓取 TECHORANGE """ class SpiderFor...
muchu1983/104_cameo
test/unit/test_spiderForTECHORANGE.py
Python
bsd-3-clause
1,235
0.008425
# Copyright 2012 VMware, 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 ...
eayunstack/neutron
neutron/tests/unit/agent/l3/test_agent.py
Python
apache-2.0
165,163
0.000121
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2018, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
neuroidss/nupic.research
htmresearch/frameworks/location/location_network_creation.py
Python
agpl-3.0
17,520
0.005936
from pkg_resources import resource_filename from pyramid.events import ( BeforeRender, subscriber, ) from pyramid.httpexceptions import ( HTTPMovedPermanently, HTTPPreconditionFailed, HTTPUnauthorized, HTTPUnsupportedMediaType, ) from pyramid.security import forget from pyramid.settings import a...
philiptzou/clincoded
src/clincoded/renderers.py
Python
mit
7,833
0.000383
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditi...
tkaitchuck/nupic
lang/py/engine/__init__.py
Python
gpl-3.0
23,539
0.014741
#! /usr/bin/env python # # Copyright 2015 George-Cristian Muraru <[email protected]> # Copyright 2015 Tobias Mueller <[email protected]> # ...
murarugeorgec/USB-checking
USB/USB_devices/usb_list.py
Python
gpl-3.0
11,203
0.015532
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('users', '0007_settings_no_ads'), ] operations = [ migrations.AlterModelOptions( name='settings', opt...
RossBrunton/BMAT
users/migrations/0008_auto_20150712_2143.py
Python
mit
379
0
# Generated by Django 2.0.6 on 2018-11-21 08:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('invoicing', '0018_invoice_attachments'), # ('invoicing', '0020_auto_20181001_1025'), ] operations = [ migrations.AddField( ...
PragmaticMates/django-invoicing
invoicing/migrations/0021_invoice_related_document.py
Python
gpl-2.0
463
0
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from firefox_puppeteer import PuppeteerMixin from firefox_puppeteer.errors import NoCertificateError from marionette_har...
Yukarumya/Yukarum-Redfoxes
testing/firefox-ui/tests/puppeteer/test_security.py
Python
mpl-2.0
1,926
0
#!/usr/bin/python # The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt # # # This simple example shows how to call dlib's optimal linear assignment problem solver. # It is an implementation of the famous Hungarian algorithm and is quite fast, operating in # O(N^3) time. # # COMPIL...
kaathleen/LeapGesture-library
DynamicGestures/dlib-18.5/python_examples/max_cost_assignment.py
Python
mit
2,357
0.00891
''' FFmpeg video abstraction ======================== .. versionadded:: 1.0.8 This abstraction requires ffmpeg python extensions. We have made a special extension that is used for the android platform but can also be used on x86 platforms. The project is available at:: http://github.com/tito/ffmpeg-android The ...
Cheaterman/kivy
kivy/core/video/video_ffmpeg.py
Python
mit
2,694
0.000371
# -*- coding: utf-8 -*- """ Created on Sat May 16 18:33:20 2015 @author: oliver """ from sympy import symbols, lambdify, sign, re, acos, asin, sin, cos, bspline_basis from matplotlib import pyplot as plt from scipy.interpolate import interp1d import numpy as np def read_kl(filename): with open(filename, 'r') a...
DocBO/mubosym
mubosym/interp1d_interface.py
Python
mit
1,728
0.015046
"""Test the Plugwise config flow.""" from unittest.mock import AsyncMock, MagicMock, patch from plugwise.exceptions import ( ConnectionFailedError, InvalidAuthentication, PlugwiseException, ) import pytest from homeassistant import setup from homeassistant.components.plugwise.const import ( API, D...
Danielhiversen/home-assistant
tests/components/plugwise/test_config_flow.py
Python
apache-2.0
13,553
0.000516
from flask import Flask from flask.ext import restful from flask.ext.restful import Resource, reqparse from lxml import html import urllib2 import json app = Flask(__name__) api = restful.Api(app) parser = reqparse.RequestParser() parser.add_argument('url', type=str, location='form') parser.add_argument('xpath', ty...
sparkica/simex-service
service.py
Python
gpl-2.0
1,442
0.021498
from django.test import TestCase from apps.taxonomy.models import Act from apps.taxonomy.tests import factories from apps.taxonomy.tests.base import TaxonomyBaseTestMixin class TestActCreation(TestCase): def setUp(self): super(TestActCreation, self).setUp() factories.TaxonRankFactory(id=0) ...
TU-NHM/plutof-taxonomy-module
apps/taxonomy/tests/act_tests.py
Python
gpl-3.0
2,683
0.003354
class Backend(object): ''' Backend type with a plugin and zero or more parameters (Parameter functionality is TBD. Links to categories handled by this backend ''' def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] ...
compatibleone/accords-platform
tools/codegen/OCCI/Backend.py
Python
apache-2.0
544
0.011029
import hashlib from tango.ast import * from tango.builtin import Int, Double, String from tango.types import FunctionType, NominalType, TypeUnion def transpile(module, header_stream, source_stream): transpiler = Transpiler(header_stream, source_stream) transpiler.visit(module) def compatibilize(name): ...
kyouko-taiga/tango
tango/transpilers/cpp.py
Python
apache-2.0
8,789
0.001252
from django.views.generic import ListView, DetailView from django.core.exceptions import ObjectDoesNotExist from competition.models.competition_model import Competition class CompetitionListView(ListView): """Lists every single competition""" context_object_name = 'competitions' model = Competition t...
michaelwisely/django-competition
src/competition/views/competition_views.py
Python
bsd-3-clause
1,178
0.000849
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2013, 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
eLBati/purchase-workflow
framework_agreement/model/pricelist.py
Python
agpl-3.0
3,558
0.000281
import numpy as np import matplotlib.pyplot as plt from stimulus import * from myintegrator import * from functions import * import matplotlib.gridspec as gridspec import cPickle as pickle #------------------------------------------------------------------- #-------------------------------------------------------------...
ulisespereira/PereiraBrunel2016
figure7/plotting.py
Python
gpl-2.0
5,736
0.043061
# -*- coding: utf-8 -*- # Copyright © 2014-2018 GWHAT Project Contributors # https://github.com/jnsebgosselin/gwhat # # This file is part of GWHAT (Ground-Water Hydrograph Analysis Toolbox). # Licensed under the terms of the GNU General Public License. # Standard library imports : import platform # Third party impo...
jnsebgosselin/WHAT
gwhat/common/styles.py
Python
gpl-3.0
1,792
0.001117
# Django settings for myproject project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '[email protected]'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
chrisglass/buildout-django_base_project
myproject/settings.py
Python
bsd-3-clause
5,070
0.001578
""" WSGI config for HealthNet 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
moiseslorap/RIT
Intro to Software Engineering/Release 2/HealthNet/HealthNet/wsgi.py
Python
mit
395
0
import pytest import tempfile import os import ConfigParser def getConfig(optionname,thedefault,section,configfile): """read an option from a config file or set a default send 'thedefault' as the data class you want to get a string back i.e. 'True' will return a string True will return a bool...
netantho/MozDef
tests/conftest.py
Python
mpl-2.0
2,263
0.028281
# -*- coding: utf-8 -*- # Copyright 2014-2016 Akretion (http://www.akretion.com) # @author Alexis de Lattre <[email protected]> # Copyright 2016 Sodexis (http://sodexis.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields, api, _ from openerp.exceptions imp...
stellaf/sales_rental
sale_rental/models/product.py
Python
gpl-3.0
2,194
0
######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
CloudifySource/cloudify-aws
setup.py
Python
apache-2.0
1,176
0
#!/usr/bin/env python """ The following functions save or load instances of all `Study` types using the Python package `dill`. """ from __future__ import division, print_function import dill def save(filename, study): """ Save an instance of a bayesloop study class to file. Args: filename(str): ...
christophmark/bayesloop
bayesloop/fileIO.py
Python
mit
947
0.002112
__author__ = 'pvarenik' from sys import maxsize class Group: def __init__(self, name=None, header=None, footer=None, id=None): self.name = name self.header = header self.footer = footer self.id = id def __repr__(self): return "%s,%s,%s,%s" % (self.id, self.name, self.h...
pvarenik/PyCourses
model/group.py
Python
gpl-2.0
592
0.005068
# -*- coding: utf-8 -*- import urlparse from selenium import webdriver from django.test import TestCase from django.conf import settings class BackendsTest(TestCase): def setUp(self): self.driver = webdriver.Firefox() def tearDown(self): self.driver.quit() def url(self, path): ...
brianmckinneyrocks/django-social-auth
contrib/tests/test_core.py
Python
bsd-3-clause
5,521
0.00163
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from reviewboard.attachments.models import FileAttachment class FileAttachmentAdmin(admin.ModelAdmin): list_display = ('file', 'caption', 'mimetype', 'review_request_id') list_display_links = ('file',...
Khan/reviewboard
reviewboard/attachments/admin.py
Python
mit
582
0
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
SKIRT/PTS
evolve/genomes/nucleobases.py
Python
agpl-3.0
1,754
0.001711
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Region.region_code' db.alter_column('region', 'region_...
SeedScientific/polio
datapoints/migrations/0039_auto__chg_field_region_region_code.py
Python
agpl-3.0
15,288
0.008242
from pylearn2.models.mlp import MLP class Autoencoder(MLP): """ An MLP whose output domain is the same as its input domain. """ def get_target_source(self): return 'features'
CKehl/pylearn2
pylearn2/scripts/tutorials/convolutional_network/autoencoder.py
Python
bsd-3-clause
201
0.004975
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cnh_profile', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='cnhprofile', nam...
tpeek/Copy-n-Haste
CopyHaste/cnh_profile/migrations/0002_auto_20150810_1822.py
Python
mit
764
0.002618
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013-2015 Marcos Organizador de Negocios SRL http://marcos.do # Write by Eneldo Serrata ([email protected]) # # This program is free software: you can redistribute it and/or modify # it un...
jpshort/odoo
marcos_addons/marcos_stock/__openerp__.py
Python
agpl-3.0
2,134
0.001406
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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/li...
wallnerryan/quantum_migrate
quantum/agent/linux/external_process.py
Python
apache-2.0
3,644
0
"""Module to train sequence model. Vectorizes training and validation texts into sequences and uses that for training a sequence model - a sepCNN model. We use sequence model for text classification when the ratio of number of samples to number of words per sample for the given dataset is very large (>~15K). """ from ...
google/eng-edu
ml/guides/text_classification/train_sequence_model.py
Python
apache-2.0
5,062
0
import gzip import hashlib import os import re import warnings from struct import unpack import six class _StarDictIfo(object): """ The .ifo file has the following format: StarDict's dict ifo file version=2.4.2 [options] Note that the current "version" string must be "2.4.2" or "3.0.0". If...
lig/pystardict
pystardict.py
Python
gpl-3.0
19,916
0.001308
# # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
aronparsons/spacewalk
backend/server/action/kickstart_guest.py
Python
gpl-2.0
4,321
0.001389
# -*- coding: utf-8 -*- """ Created on Wed Jun 24 17:55:05 2015 @author: LLP-admin """ import os import time import pandas as pd import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn.decomposition import PCA #encoding from sklearn.preprocessing import LabelEncoder ...
cocoaaa/ml_gesture
feature_selection.py
Python
mit
14,963
0.026064
from django.apps import AppConfig class ExcelUploadConfig(AppConfig): name = 'excel_upload'
Bielicki/lcda
excel_upload/apps.py
Python
gpl-3.0
98
0
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2014 Daniel Elstner <[email protected]> ## ## 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...
robacklin/sigrok
libsigrokdecode/decoders/z80/__init__.py
Python
gpl-3.0
1,313
0.009139
import os import re import copy import collections import logging import MooseDocs import collections import subprocess import yaml log = logging.getLogger(__name__) class PagesHelper(object): """ A helper class for checking if a markdown file is include in the 'pages.yml' file. """ def __init__(self,...
katyhuff/moose
python/MooseDocs/MooseApplicationSyntax.py
Python
lgpl-2.1
13,523
0.002884
######### # Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
geokala/cloudify-agent
cloudify_agent/api/utils.py
Python
apache-2.0
10,561
0
import os from autotest_lib.client.bin import test, utils class isic(test.test): version = 2 # http://www.packetfactory.net/Projects/ISIC/isic-0.06.tgz # + http://www.stardust.webpages.pl/files/crap/isic-gcc41-fix.patch def initialize(self): self.job.require_gcc() self.job.setup_dep(...
yochow/autotest
client/tests/isic/isic.py
Python
gpl-2.0
831
0.008424
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
reyoung/Paddle
python/paddle/fluid/tests/unittests/test_sequence_unpad_op.py
Python
apache-2.0
2,170
0
import pika import sys credentials = pika.PlainCredentials('qunews', 'qunews') connection = pika.BlockingConnection(pika.ConnectionParameters('localhost', 5672, 'qunews_host', credentials)) channel = connection.channel() channel.exchange_declare(exchange='qunews_data', type='topic') result =...
carvalhodj/qunews
rabbitmq/receive.py
Python
apache-2.0
1,031
0.00291
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
djkonro/client-python
kubernetes/client/models/v1_container_state_waiting.py
Python
apache-2.0
3,830
0.000522
VERSION = (0, 0, 1, 'dev') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2]...
yceruto/django-formapi
formapi/__init__.py
Python
mit
348
0
from django.conf import settings from django.db import models from django.core.cache import cache from django.dispatch import receiver from seahub.base.fields import LowerCaseCharField from seahub.profile.settings import EMAIL_ID_CACHE_PREFIX, EMAIL_ID_CACHE_TIMEOUT from registration.signals import user_registered cl...
skmezanul/seahub
seahub/profile/models.py
Python
apache-2.0
3,686
0.003256