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 __future__ import annotations
import argparse
import sys
from pprint import pformat
from cctbx.xray import observation_types
from iotbx.reflection_file_reader import any_reflection_file
from iotbx.shelx.hklf import miller_array_export_as_shelx_hklf
def read_input_data(lb, params, update_params=True):
print... | xia2/xia2 | src/xia2/cli/to_shelxcde.py | Python | bsd-3-clause | 8,062 |
# Eidolon Biomedical Framework
# Copyright (C) 2016-8 Eric Kerfoot, King's College London, all rights reserved
#
# This file is part of Eidolon.
#
# Eidolon 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 Foundati... | ericspod/Eidolon | tests/meshtests/tettest.py | Python | gpl-3.0 | 1,193 |
#__all__ = ['deque', 'defaultdict', 'Counter']
#from _collections import deque, defaultdict
#from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString', 'Counter', 'OrderedDict']
# For bootstrapping r... | 40223133/cadp_w2 | wsgi/static/templates/jscript/Lib/collections.py | Python | gpl-3.0 | 35,032 |
from collections import defaultdict
import copy
registers = defaultdict(int)
registers['a'] = 0
registers['b'] = 0
registers['c'] = 1
registers['d'] = 0
f = open('inputs/Day12.txt')
lines = f.read().splitlines()
def copy(r1, r2):
if r1.isdigit():
registers[r2] = int(r1)
else:
registers[r2] =... | snyderks/advent-solutions | Day12.py | Python | mit | 999 |
from test.test_support import verbose, TestFailed, verify
import types
class F:
def a(self):
pass
def b():
'my docstring'
pass
# __module__ is a special attribute
verify(b.__module__ == __name__)
verify(verify.__module__ == "test.test_support")
# setting attributes on functions
try:
b.publis... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.4/Lib/test/test_funcattrs.py | Python | mit | 9,384 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import paramiko
import threading
from collections import Iterable
from .utils import get_logger
from .conf import config
from .service import app_service
logger = get_logger(__file__)
class SSHInterface(paramiko.ServerInterface):
"""
使用paramiko提供的接口实现ssh ser... | jumpserver/coco | coco/interface.py | Python | gpl-3.0 | 8,875 |
import numpy as np
from vanilla_neural_nets.base.parameter_object import _NetworkWeightParameter, _NetworkBiasParameter
class _RNNNetworkBiasParameter(_NetworkBiasParameter):
def __init__(self, name, size):
self.name = name
self.value = np.zeros(size)
self.reset_gradient_to_zero()
cla... | cavaunpeu/vanilla-neural-nets | vanilla_neural_nets/recurrent_neural_network/parameter_object.py | Python | mit | 5,117 |
"""
Openvswitch Module
This module allows the management of OVS on a given minion.
*Requires openvswitch-switch to be installed and service running.*
Functions available:
br-int:
ovs.add_bridge
br-int:
ovs.add_port:
- port: eth0
br-int:
ovs.remove_bridge
br-int:
ovs.remove_port:
- port: eth0
The... | jahkeup/salt-openstack | _modules/ovs.py | Python | bsd-2-clause | 4,202 |
#!/usr/bin/python
script = r"""
MD Dir1
MD Dir1\Dir2
CD Dir1
MD EDir4
MD GDir5
MD Dir2\Dir3
MF Dir2\Dir3\readme.txt
CD EDir4
MF temp.dat
MHL C:\DIR1\EDIR4 c:\dir1
MDL C:\DIR1\EDIR4\temp.dat c:\dir1
"""
expected = r"""
C:
|_DIR1
|_hlink[C:\DIR1\EDIR4]
|_dlink[C:\DIR1\EDIR4\temp.dat]
|_DIR2
| |_DIR3
... | artemkin/sandbox | fme/tests/test_mdl_mhl.py | Python | bsd-2-clause | 445 |
# -*- coding: utf-8 -*-
"""
Python Markdown
A Python implementation of John Gruber's Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few yea... | unreal666/outwiker | plugins/markdown/markdown/markdown_plugin_libs/markdown/extensions/__init__.py | Python | gpl-3.0 | 3,599 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
######################## BEGIN LICENSE BLOCK ########################
# This file is part of the cygapt package.
#
# Copyright (C) 2002-2009 Jan Nieuwenhuizen <janneke@gnu.org>
# 2002-2009 Chris Cormie <cjcormie@gmail.com>
# 2012 Jame... | nylen/cyg-apt | src/cygapt/test/test_path_mapper.py | Python | gpl-3.0 | 3,221 |
# -*- coding: utf-8 -*-
import http_lazy_headers as hlh
from . import utils
class TransferEncodingTest(utils.FieldTestCase):
field = hlh.TransferEncoding
def test_raw_values(self):
self.assertFieldRawEqual(
['gzip, chunked', 'foobar;bar=qux'],
((hlh.Encodings.gzip, hlh.Para... | nitely/http-lazy-headers | tests/tests_fields_/tests_transfer_encoding.py | Python | mit | 2,131 |
#!/home/bolt/.python_compiled/bin/python3
import math
from PIL import Image
def complex_wrapper(func, scale_factor=1):
"""
Modifies a complex function that takes a complex
argument and returns a complex number to take a
tuple and return a tuple.
"""
def inner(real, imag):
complex_num=c... | Bolt64/my_code | Code Snippets/domain_coloring.py | Python | mit | 3,030 |
import pytest
from spacy.ml.models.tok2vec import build_Tok2Vec_model
from spacy.ml.models.tok2vec import MultiHashEmbed, CharacterEmbed
from spacy.ml.models.tok2vec import MishWindowEncoder, MaxoutWindowEncoder
from spacy.pipeline.tok2vec import Tok2Vec, Tok2VecListener
from spacy.vocab import Vocab
from spacy.tokens ... | explosion/spaCy | spacy/tests/pipeline/test_tok2vec.py | Python | mit | 15,130 |
# 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... | Acehaidrey/incubator-airflow | tests/providers/amazon/aws/sensors/test_redshift_cluster.py | Python | apache-2.0 | 2,881 |
# encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
class CornerType(__gobject.GEnum):
# no doc
def __init__(se... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/CornerType.py | Python | gpl-2.0 | 721 |
"""Phylotyper module
Start phylotyper job. Uses default result directories
Example:
:
$ python example_google.py
"""
import subprocess
import os
import shutil
import logging
from tempfile import mkdtemp
import pandas as pd
import cPickle as pickle
from rdflib import Graph, BNode, Literal, XSD
import re... | superphy/backend | app/modules/phylotyper/phylotyper.py | Python | apache-2.0 | 11,856 |
# Copyright 2014 Google Inc. All Rights Reserved.
"""Command for deleting target instances."""
from googlecloudsdk.compute.lib import base_classes
class Delete(base_classes.ZonalDeleter):
"""Delete target instances."""
@property
def service(self):
return self.compute.targetInstances
@property
def reso... | harshilasu/LinkurApp | y/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/target_instances/delete.py | Python | gpl-3.0 | 678 |
# coding: utf-8
import os
PRODUCTION = os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Eng')
DEBUG = DEVELOPMENT = not PRODUCTION
try:
# This part is surrounded in try/except because the config.py file is
# also used in the run.py script which is used to compile/minify the client
# side files (*.l... | lipis/electron-crash-reporter | main/config.py | Python | mit | 1,326 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'file_dialog_ui.ui'
#
# Created: Wed Feb 5 09:29:49 2014
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except ... | INM-6/swan | swan/gui/file_dialog_ui.py | Python | bsd-3-clause | 5,089 |
#!/usr/bin/env python
from distutils.core import setup
setup(
name='samklang-pages',
version="0.5.0",
author='Sigurd Gartmann',
author_email='sigurdga-samklang@sigurdga.no',
url='http://github.com/sigurdga/samklang-pages',
description='Pages module for Samklang',
... | sigurdga/samklang-pages | setup.py | Python | agpl-3.0 | 949 |
from dispel4py.provenance import *
from dispel4py.core import NAME, TYPE, GenericPE
import uuid
import traceback
from obspy.core import Trace,Stream
from dispel4py.base import SimpleFunctionPE
import traceback
try:
from obspy.core.utcdatetime import UTCDateTime
except ImportError:
pass
class SeismoPE(Provenan... | KNMI/VERCE | verce-hpc-pe/src/dispel4py/seismo/seismo.py | Python | mit | 2,826 |
# -*- coding: utf-8 -*-
import os
import requests
class AreaNotFoundException(BaseException):
pass
class HotPepperGourmetAPI(object):
BASE_URL = 'http://webservice.recruit.co.jp/hotpepper/{0}/v1/'
def __init__(self, api_key=None):
self.__api_key = os.environ.get('HOTPEPPER_API_KEY', api_key)
... | syugoing/communication | dialogue_system/backend/apis/hotpepper.py | Python | mit | 2,776 |
"""
Integration tests for pydht
"""
import pytest
import time
import random
from dht3k import DHT
from dht3k import hashing
from dht3k.log import l
class TestPyDht(object):
""" Testing the DHT """
def setup(self):
""" Setup """
time.sleep(0.4)
self.dht1 = DHT(
41... | ganwell/dht3k | test/test_dht3k.py | Python | mit | 3,527 |
# Copyright (c) 2016 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... | olivierlemasle/murano | murano_tempest_tests/tests/api/application_catalog/test_environments_negative.py | Python | apache-2.0 | 3,454 |
# Repeated String
# Developer: Murillo Grubler
# https://www.hackerrank.com/challenges/repeated-string/problem
# Time Complexity = O(n)
import math
def repeated_string(text, total):
if len(text) == 1 and text == 'a':
return total
if text.find('a')!=-1:
add_value = len([text[i] for i in range... | Murillo/Hackerrank-Algorithms | Algorithms/Implementation/repeated-string.py | Python | mit | 597 |
"""
==============================================
Phase-Amplitude Coupling tutorial on sEEG data
==============================================
In this example, we illustrate how to conduct a PAC analysis on real data. The
data used here are taken from Combrisson et al. 2017
:cite:`combrisson2017intentions`. The task... | EtienneCmb/tensorpac | examples/tuto/plot_real_data.py | Python | bsd-3-clause | 18,798 |
import gc
import logging
from pprint import pformat
from pympler import summary
from pympler import tracker
from pympler import muppy
from pympler.util import stringutils
from twisted.python import log
from twisted.internet import defer
from zope.component import provideSubscriptionAdapter
from zope.interface import i... | valintinr/opennode-management | opennode/oms/tools/memory_profiler.py | Python | gpl-3.0 | 10,194 |
def kevin_yield():
print '1'
yield 1
print 'x'
yield 5
x = kevin_yield()
x.next()
x.next()
x.next()
| kevinhikali/ml_kevin | py_demo/yield.py | Python | gpl-3.0 | 117 |
"""Native adapter for serving CherryPy via its builtin server."""
import logging
import sys
import io
import cherrypy
from cherrypy._cperror import format_exc, bare_error
from cherrypy.lib import httputil
from cherrypy import wsgiserver
class NativeGateway(wsgiserver.Gateway):
recursive = False
def respon... | junalmeida/Sick-Beard | lib/cherrypy/_cpnative_server.py | Python | gpl-3.0 | 5,974 |
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.signals import connection_created
from django.conf import settings
from django.utils.functional import wraps
from pymongo.connection import Connection
from pymongo.collection import Collection
from .creation import DatabaseCreation
from .... | umitproject/tease-o-matic | django_mongodb_engine/base.py | Python | bsd-3-clause | 6,228 |
# coding: utf-8
import argparse
import image
import naivefusion
import laplacianfusion
# Loading the arguments
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
'-l',
'--list',
dest='names',
type=str,
default='list_images.txt',
... | Rachine/ExposureFusion | main.py | Python | mit | 1,569 |
import torch
from . import Distribution, Categorical
from .. import util
class Mixture(Distribution):
def __init__(self, distributions, probs=None):
self._distributions = distributions
self.length = len(distributions)
if probs is None:
self._probs = util.to_tensor(torch.zeros(... | probprog/pyprob | pyprob/distributions/mixture.py | Python | bsd-2-clause | 3,418 |
import collections
import sys
from laf.fabric import LafFabric
processor = LafFabric(verbose='DETAIL')
API = processor.load('bhs3.txt.hdr', '--', 'lingo',
{
"xmlids": {"node": False, "edge": False},
"features": ("otype monads maxmonad minmonad gender part_of_speech verse_label", ""),
... | ETCBC/laf-fabric | examples/lingo.py | Python | unlicense | 3,572 |
#!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_decrypt_text
from youtube_dl.utils impo... | Facetracker-project/facetracker-core | lib/youtube-dl/test/test_aes.py | Python | gpl-2.0 | 1,631 |
# -*- coding: utf-8 -*-
__LICENSE__ = u"""
This file is part of Hufrce Program.
Hufrce 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 opt... | wnt-zhp/hufce | urls.py | Python | gpl-3.0 | 2,468 |
import sys
from mock import (
patch, call, Mock, MagicMock
)
import kiwi
from ..test_helper import argv_kiwi_tests
from kiwi.tasks.image_info import ImageInfoTask
from collections import namedtuple
class TestImageInfoTask:
def setup(self):
sys.argv = [
sys.argv[0], '--profile', 'vmxFl... | SUSE/kiwi | test/unit/tasks/image_info_test.py | Python | gpl-3.0 | 6,228 |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | supermari0/ironic | ironic/tests/db/utils.py | Python | apache-2.0 | 8,896 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The Initia... | gale320/newfies-dialer | newfies/frontend/urls.py | Python | mpl-2.0 | 984 |
# Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | tensorflow/federated | tensorflow_federated/python/learning/templates/finalizers_test.py | Python | apache-2.0 | 19,036 |
"""
Methods for exporting course data to XML
"""
import logging
import lxml.etree
from xblock.fields import Scope
from xmodule.contentstore.content import StaticContent
from xmodule.exceptions import NotFoundError
from xmodule.modulestore import EdxJSONEncoder, ModuleStoreEnum
from xmodule.modulestore.inheritance impo... | wwj718/murp-edx | common/lib/xmodule/xmodule/modulestore/xml_exporter.py | Python | agpl-3.0 | 10,085 |
import re
import sys
from unittest import TestCase
from . import Mock
from sqlalchemy import MetaData, Column, Table, Integer, String, Text, \
Numeric, CHAR, ForeignKey, DATETIME, INTEGER, \
TypeDecorator, CheckConstraint, Unicode, Enum,\
UniqueConstraint, Boolean, ForeignKeyConstraint,\
PrimaryKeyCons... | 6si/alembic | tests/test_autogenerate.py | Python | mit | 52,371 |
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import swaggyjenkins
from swaggyjenkins.mo... | cliffano/swaggy-jenkins | clients/python/generated/test/test_github_scm.py | Python | mit | 856 |
#!/usr/bin/env python
import argparse
import re
import urllib2
import csv
import os, sys
# Adding the path to ENV for importing constants.
sys.path.append(os.path.abspath('..'))
from recap_constants import *
from celery import Celery
from celery.registry import tasks
app = Celery('recap_docket_downloader', broker=CEL... | Andr3iC/courtlistener | cl/recap/download/recap_docket_downloader.py | Python | agpl-3.0 | 4,120 |
# Copyright 2014-2015 Zuercher Hochschule fuer Angewandte Wissenschaften
# 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/lice... | Pentadactylus/sm_openstack | sm/mongo_key_replacer.py | Python | apache-2.0 | 3,197 |
from .notifications import *
from .site_msgs import *
| jumpserver/jumpserver | apps/notifications/serializers/__init__.py | Python | gpl-3.0 | 54 |
# This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | eliasdesousa/indico | indico/web/forms/fields/location.py | Python | gpl-3.0 | 2,683 |
from blinker import signal
event_generator_init = signal('event_generator_init')
event_generator_finalized = signal('event_generator_finalized')
event_generator_preread = signal('event_generator_preread')
event_generator_context = signal('event_generator_context')
| rackerlabs/pelican-events | pelican_events/signals/__init__.py | Python | apache-2.0 | 267 |
#!/opt/python/bin/python
# -*- coding: utf-8 -*-
import logging
import json
import sys
import stat
import ctypes
import time
import copy
import datetime
import settings
from config import *
from cloghandler import ConcurrentRotatingFileHandler
from random import random
from os.path import relpath, exists, lexists... | sdsc/lustre-data-mover | cmover_del.py | Python | bsd-2-clause | 6,047 |
# 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 list of conditions and the following disclaimer.
# * Redistributions in binary... | Hellowlol/PyTunes | libs/engines/nova/helpers.py | Python | gpl-3.0 | 4,394 |
# Copyright (C) 2016, A10 Networks 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 requi... | mdurrant-b3/acos-client | acos_client/tests/unit/v30/test_license_manager.py | Python | apache-2.0 | 4,133 |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | franek/weboob | modules/bred/browser.py | Python | agpl-3.0 | 3,776 |
from amitools.vamos.machine.regs import *
from amitools.vamos.libcore import LibImpl
from amitools.vamos.log import log_math
from amitools.util.Math import *
import math
class MathIEEEDoubTransLibrary(LibImpl):
def IEEEDPAcos(self,ctx):
arg = regs_to_double(ctx.cpu.r_reg(REG_D0),ctx.cpu.r_reg(REG_D1))
try:... | FrodeSolheim/fs-uae-launcher | amitools/vamos/lib/MathIEEEDoubTransLibrary.py | Python | gpl-2.0 | 4,647 |
#!/usr/bin/env python
from generator.actions import Actions
from random import randint, choice
from struct import pack
import ctypes
import sys
class Protocol():
def empty_frame(self, id):
return self.frame(id, '')
def frame(self, id, data):
return pack('<2B', id, len(data)) + data
class Scra... | f0rki/cb-multios | original-challenges/Carbonate/poller/for-testing/machine.py | Python | mit | 5,403 |
from resolwe.flow.models import Data
from resolwe.test import tag_process, with_resolwe_host
from resolwe_bio.utils.test import KBBioProcessTestCase
class MicroRNATestCase(KBBioProcessTestCase):
@with_resolwe_host
@tag_process("workflow-mirna")
def test_mirna_workflow(self):
# Prepare data for al... | genialis/resolwe-bio | resolwe_bio/tests/workflows/test_mirna.py | Python | apache-2.0 | 2,406 |
from volunteer.apps.accounts.utils import (
generate_registration_token,
reverse_registration_url,
unsign_registration_token,
)
def test_url_generation():
token = generate_registration_token('test@example.com')
url = reverse_registration_url('test@example.com')
assert token in url
def test_... | Apogaea/voldb | tests/accounts/test_url_token_utils.py | Python | gpl-3.0 | 536 |
#!/usr/bin/env python
"""Python GRR API connectors library."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
| dunkhong/grr | api_client/python/grr_api_client/connectors/__init__.py | Python | apache-2.0 | 174 |
# 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... | codrut3/tensorflow | tensorflow/contrib/bayesflow/python/ops/layers_dense_variational_impl.py | Python | apache-2.0 | 52,457 |
# -*- coding: latin-1 -*-
import string
from string import *
import os.path
from random import choice
import string
from numpy import *
import PIL.Image
from reportlab.pdfgen import canvas
from reportlab.graphics import renderPDF
from reportlab.graphics.shapes import Drawing, Group, String, Circle, Rect
from reportlab... | wyolum/ClockFOUR | fabricate/ClockFOUR_Chronogram_v3.0/create_ClockFOUR_v3.0.py | Python | mit | 20,154 |
from django.db import models
from django.contrib.auth.models import User
from froala_editor.fields import FroalaField
class Article(models.Model):
"""Represents a blog article"""
title = models.CharField(max_length=62)
slug = models.SlugField(unique=True, max_length=100)
body = FroalaField()
... | Sult/daf | apps/blog/models/blog.py | Python | mit | 1,234 |
# Written by Mike Smith michaeltsmith.org.uk
from __future__ import division
import numpy as np
from .kern import Kern
from ...core.parameterization import Param
from paramz.transformations import Logexp
import math
class Multidimensional_Integral_Limits(Kern): #todo do I need to inherit from Stationary
"""
I... | ysekky/GPy | GPy/kern/src/multidimensional_integral_limits.py | Python | bsd-3-clause | 6,207 |
from __future__ import print_function
import sys
import win32com.client
import pywintypes
import pythoncom
import numpy as np
import subprocess as sp
import concurrent.futures
import atexit
import json
import zmq
import os
from six.moves import range
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')... | acq4/acq4 | acq4/util/igorpro.py | Python | mit | 10,366 |
"""
Author: RedFantom
Contributors: Daethyra (Naiii) and Sprigellania (Zarainia)
License: GNU GPLv3 as in LICENSE
Copyright (C) 2016-2018 RedFantom
"""
# Standard Library
import os
from subprocess import Popen, PIPE
# Packages
from PIL import Image, ImageFilter
from pytesseract import pytesseract as tesseract
# Project... | RedFantom/GSF-Parser | parsing/tesseract.py | Python | gpl-3.0 | 4,670 |
# -*- coding: utf-8 -*-
#
# restflow documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 31 07:32:50 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | CognitionGuidedSurgery/restflow | doc/conf.py | Python | gpl-3.0 | 8,911 |
"""
A PyrobotSimulator world. A large room with two robots and
two lights.
(c) 2005, PyroRobotics.org. Licensed under the GNU GPL.
"""
from pyrobot.simulators.pysim import TkSimulator, TkPioneer, \
PioneerFrontSonars, PioneerFrontLightSensors
def INIT():
# (width, height), (offset x, offset y), scale:
s... | emilydolson/forestcat | pyrobot/plugins/worlds/Pyrobot/Braitenberg2Lights1Robot.py | Python | agpl-3.0 | 1,004 |
"""
WSGI config for ElectionSimulation project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APP... | CSC301H-Fall2013/ElectionSimulation | Code/ElectionSimulationInstaller/ElectionSimulation/ElectionSimulation/wsgi.py | Python | mit | 1,455 |
import re
import json
import urllib2
import argparse
URL_TEMPLATE = 'http://www.tvp.pl/shared/cdn/tokenizer_v2.php?object_id=%s'
parser = argparse.ArgumentParser(description='Download tvp.pl video')
parser.add_argument('url', action='store', metavar='URL')
args = parser.parse_args()
try:
response = urllib2.url... | jackMort/tvp_downloader | tvp_downloader.py | Python | gpl-3.0 | 1,437 |
"""
Rubric for open-ended response problems, including calibration and peer-grading.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
class ScoreMismatchError(Exception):
"""
The provided scores do not match the rubric on the page.
"""
pass
class RubricPage(... | Semi-global/edx-platform | common/test/acceptance/pages/lms/rubric.py | Python | agpl-3.0 | 5,142 |
#!/usr/bin/python
'''
Copyright 2010 - Greg Hellings
This file is part of the Automated FTP Dominator.
The Automated FTP Dominator is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the... | greg-hellings/Automated-FTP-Dominator | dominator.py | Python | gpl-3.0 | 1,348 |
"""
Support for LiteJet switch.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.litejet/
"""
import logging
import homeassistant.components.litejet as litejet
from homeassistant.components.switch import SwitchDevice
DEPENDENCIES = ['litejet']
AT... | happyleavesaoc/home-assistant | homeassistant/components/switch/litejet.py | Python | apache-2.0 | 2,283 |
import os
from csv import DictReader
from altmetric_client.output_writer_csv.csv_writer_user_demographics import CSVWriterUserDemographics
from altmetric_client.user_demographics import UserDemographics
class TestBareMinimumUserDemographics:
def setup_method(self):
self._files_out_directory = '../files_... | CamLib/AltmetricClient | tests/output_writer_csv/test_bare_minimum_user_demographics_output.py | Python | gpl-3.0 | 5,175 |
# -*- coding:utf-8 -*-
"""
Ядро платформы.
Для генерации Web-приложений по декларативной конфигурации
"""
| barsgroup/barsup-core | src/pynch/__init__.py | Python | mit | 169 |
#
# Generated by TigerShark.tools.convertPyX12 on 2012-07-10 16:29:58.682345
#
from tigershark.X12.parse import Message, Loop, Segment, Composite, Element, Properties
parsed_277U_HEADER = Loop( u'HEADER', Properties(looptype=u'wrapper',repeat=u'1',pos=u'015',req_sit=u'R',desc=u'Table 1 - Header'),
Segment( u'BHT', Prop... | jdavisp3/TigerShark | tigershark/parsers/M277U_4010_X070.py | Python | bsd-3-clause | 49,720 |
"""
Illustrate the rec array utility funcitons by loading prices from a
csv file, computing the daily returns, appending the results to the
record arrays, joining on date
"""
import urllib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
# grab the price data off yahoo
u1 = urllib.urlr... | bundgus/python-playground | matplotlib-playground/examples/misc/longshort.py | Python | mit | 1,660 |
wdf = Runtime.createAndStart("wikiDataFetcher", "WikiDataFetcher")
query = "eiffel tower"
wdf.setWebSite("enwiki")
print "Url : " + wdf.getData(query,"P856")
# Display a property ( high of the eiffel tower )
print "high : " + wdf.getData(query,"P2048")
# Display a monolingual value
print "Birthname of Adam Sandler :... | MyRobotLab/pyrobotlab | home/beetlejuice/wikiDataFetcher_demo2.py | Python | apache-2.0 | 874 |
#!/usr/bin/python
server = "server.themanaworld.org"
port = 6901
account = "accountname"
password = "password"
character = 0 #slot character is in, 0 for first, 1 for second, 2 for third
charactername = "" # change if it differs
master = "maincharacter" #character bot will direct public chat to
import socket
import s... | doomstal/Whisperbot | whisperbot.py | Python | gpl-3.0 | 8,644 |
from django.apps import AppConfig
class FeedbackConfig(AppConfig):
name = 'geoq.feedback'
verbose_name = 'Feedback'
| ngageoint/geoq | geoq/feedback/apps.py | Python | mit | 125 |
# This file is part of Checkbox.
#
# Copyright 2012, 2013 Canonical Ltd.
# Written by:
# Sylvain Pineau <sylvain.pineau@canonical.com>
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Checkbox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | zyga/debian.plainbox | plainbox/impl/secure/rfc822.py | Python | gpl-3.0 | 16,235 |
from sympy import symbols, Derivative, Integral, exp, cos, oo, Function
from sympy.functions.special.bessel import besselj
from sympy.functions.special.polynomials import legendre
from sympy.functions.combinatorial.numbers import bell
from sympy.printing.conventions import split_super_sub, requires_partial
def test_s... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/sympy/printing/tests/test_conventions.py | Python | mit | 3,780 |
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | floodlight/loxigen-artifacts | pyloxi/loxi/of15/action.py | Python | apache-2.0 | 37,452 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tedx', '0003_registration_user'),
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
... | enjaz/enjaz | tedx/migrations/0004_game.py | Python | agpl-3.0 | 2,045 |
from __future__ import unicode_literals
notification_settings = {
# PostgreSQL backend with JSON fields
'STORAGE_BACKEND': 'notification.backends.DefaultBackend'
}
| Lysxia/dissemin | notification/settings.py | Python | agpl-3.0 | 173 |
# proxy module
from __future__ import absolute_import
from enable.pyglet_backend.pyglet_app import *
| enthought/etsproxy | enthought/enable/pyglet_backend/pyglet_app.py | Python | bsd-3-clause | 101 |
from typing import List, Type
from andreas.db.database import db
from andreas.db.model import Model
from andreas.models.event import Event
from andreas.models.keypair import KeyPair
from andreas.models.post import Post
from andreas.models.relations import PostPostRelation, UserPostRelation
from andreas.models.server i... | maaaks/andreas | andreas/commands/dbcommands.py | Python | mit | 1,291 |
"""
RobotReviewer tokenizer
"""
import logging
log = logging.getLogger(__name__)
log.debug('Loading spacy.io data for tokenization')
import spacy
nlp = spacy.load('en') | ijmarshall/robotreviewer3 | robotreviewer/textprocessing/tokenizer.py | Python | gpl-3.0 | 169 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import sys
import os
import hnbot
class HnbotMessage(unittest.TestCase):
def testTooLarge(self):
"""test should fail if message size is bigger than 140 characters"""
self.assertEqual(1,1)
if __name__ == "__main__":
unittest.main()
| aayoubi/HNTwitter-bot | hnbot/test/test_hnbot.py | Python | gpl-3.0 | 306 |
# This file is part of the Minecraft Overviewer.
#
# Minecraft Overviewer 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... | kevinwchang/Minecraft-Overviewer | overviewer_core/files.py | Python | gpl-3.0 | 7,186 |
'''
Created on Jan 20, 2015
@author: adam
'''
import csv
import os
current_dir = os.getcwd()
file_entry = '/home/adam/workspace/TEES/text_files/final_protein_word_dict_known60.txt'
protein_word_dict = {}
with open(file_entry, 'r') as my_file:
reader = csv.reader(my_file, delimiter='\t')
proteins = []
lis... | rothadamg/UPSITE | text_files/Parsers/Final_protein_word_Parser.py | Python | mit | 485 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('features', '0003_auto_20140919_1154'),
('campaigns', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | chbrun/behavui | behavui/campaigns/migrations/0002_auto_20140919_1200.py | Python | gpl-2.0 | 602 |
import os
import simmanager as sim
import subprocess as sproc
import time
import atexit
if __name__ == '__main__':
print('Creating simulation manager...')
sman = sim.SimManager()
self_pid = os.getpid()
atexit.register(sman.StopAllTools, blocking=True)
# Clear Gem5 stats folder
# folder = 'm5o... | hplp/gem5-reclaim | src/reclaim.py | Python | bsd-3-clause | 6,533 |
# Copyright 2019 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... | ghchinoy/tensorflow | tensorflow/python/data/experimental/kernel_tests/serialization/choose_fastest_dataset_serialization_test.py | Python | apache-2.0 | 1,690 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apach... | bbc/kamaelia | Sketches/AM/KPIFramework/KPI/tools/createuser.py | Python | apache-2.0 | 1,237 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from rapidsms.models import Contact, Connection
class Message(models.Model):
INCOMING = "I"
OUTGOING = "O"
DIRECTION_CHOICES = (
... | lsgunth/rapidsms | rapidsms/contrib/messagelog/models.py | Python | bsd-3-clause | 2,304 |
# Copyright 2014 OpenStack LLC.
# 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... | NetApp/manila | manila/api/views/share_networks.py | Python | apache-2.0 | 2,764 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, os, urllib, urllib2
sys.path.append(os.path.join(os.getcwd().replace(';', ''), 'resources', 'lib'))
if (__name__ == "__main__" ):
import addon
addon.addon_main()
| Dave667/service | plugin.video.ulitka.tv/default.py | Python | gpl-2.0 | 228 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | ema/conpaas | conpaas-services/contrib/libcloud/compute/base.py | Python | bsd-3-clause | 33,322 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | jeffery9/mixprint_addons | project/__openerp__.py | Python | agpl-3.0 | 3,184 |
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
a = tf.constant(2)
b = tf.constant(3)
x = tf.add(a, b)
with tf.Session() as sess:
writer = tf.summary.FileWriter('./graphs', sess.graph)
print(sess.run(x))
writer.close()
a = tf.constant([2, 2], name='a')
b = tf.constant([[0, 1], [2, 3]], name... | JasonHanG/tensor-gallery | basic-operation/basic_op.py | Python | apache-2.0 | 1,589 |
"""
This module contains the main logic for start, query, stop graphlab server client connection.
"""
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
from ..cython.cy_unity import UnityGloba... | haijieg/SFrame | oss_src/unity/python/sframe/connect/main.py | Python | bsd-3-clause | 5,005 |
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import factory
from zipfelchappe.cod.models import CodPayment
class CodPaymentFactory(factory.DjangoModelFactory):
class Meta:
model = CodPayment
| feinheit/zipfelchappe | tests/cod/factories.py | Python | bsd-3-clause | 234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.