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 |
|---|---|---|---|---|---|
################################################################################
# Copyright (c) 2015-2019 Skymind, Inc.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless... | deeplearning4j/deeplearning4j | pydl4j/tests/spark_test.py | Python | apache-2.0 | 1,899 |
#!/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... | wubr2000/googleads-python-lib | examples/dfp/v201502/line_item_service/get_all_line_items.py | Python | apache-2.0 | 1,701 |
"""
LEMS XML file format parser.
:author: Gautham Ganapathy
:organization: LEMS (https://github.com/organizations/LEMS)
"""
import xml.etree.ElementTree as xe
from lems.base.base import LEMSBase
from lems.base.errors import ParseError
from lems.model.fundamental import *
from lems.model.component import *
from lems... | LEMS/pylems | lems/parser/LEMS.py | Python | lgpl-3.0 | 57,547 |
#!/usr/bin/python2
import argparse
import os
import subprocess
import sys
BASE_DIR = os.getcwd()
def build_install_orca(prefix, path):
# by default conan will install the files under /usr/local
return subprocess.call(["./configure --prefix={0} && make && make install_local".format(prefix)],
... | yuanzhao/gpdb | concourse/scripts/build_orca.py | Python | apache-2.0 | 1,492 |
import logging
from pyramid_handlers import action
from pyramid.httpexceptions import HTTPFound
import gearmandashboard.models as model
log = logging.getLogger(__name__)
class Handler(object):
def __init__(self, request):
self.request = request
self.url = self.request.url_generator
class Main... | osks/gearman-dashboard | gearmandashboard/handlers.py | Python | mit | 1,406 |
# -*- coding: utf-8 -*-
import sys
from google.appengine.ext import ndb
sys.path.insert(0, 'libs')
import bs4
import urllib2
import logging
import urllib
from operator import itemgetter
import models
from google.appengine.api import search
from google.appengine.api import memcache
from google.appengine.api import... | kasparg/lawcats | parsers/riigiteataja_parse.py | Python | gpl-3.0 | 22,091 |
from django.test import tag
from model_mommy import mommy
from ..actions import verify_consent, unverify_consent
from .consent_test_case import ConsentTestCase
from .dates_test_mixin import DatesTestMixin
from .models import SubjectConsent
from dateutil.relativedelta import relativedelta
from django.contrib.auth.model... | botswana-harvard/edc-consent | edc_consent/tests/test_actions.py | Python | gpl-2.0 | 1,572 |
'''
tmdb.py is a wrapper for The Movie Database API v3
Their documentation is at:
http://docs.themoviedb.apiary.io/
Contributions made by Artifaxx on inital commit
'''
#Standar library imports
import cgi
import json
import urllib
#Third Party Imports
import requests
'''
_____ __ __ ____ _
|_ ... | Tripplesixty/TMDbPy | tmdb.py | Python | mit | 10,641 |
"""
Unit tests for stem.descriptor.server_descriptor.
"""
import datetime
import StringIO
import unittest
import stem.descriptor.server_descriptor
import stem.exit_policy
import stem.prereq
import stem.util.str_tools
from stem.descriptor.server_descriptor import RelayDescriptor, BridgeDescriptor
from test.mocking i... | gsathya/stem | test/unit/descriptor/server_descriptor.py | Python | lgpl-3.0 | 14,891 |
import click
from arrow.cli import pass_context, json_loads
from arrow.decorators import custom_exception, dict_output
@click.command('update_user')
@click.argument("email", type=str)
@click.argument("first_name", type=str)
@click.argument("last_name", type=str)
@click.option(
"--password",
help="User's passw... | galaxy-genome-annotation/python-apollo | arrow/commands/users/update_user.py | Python | mit | 893 |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""Move existing Workflows to new contexts
Revision ID: 4b3316aa1acf
Revises: ... | prasannav7/ggrc-core | src/ggrc_workflows/migrations/versions/20140722203407_4b3316aa1acf_move_existing_workflows_to_new_contexts.py | Python | apache-2.0 | 11,884 |
# -*- coding: utf-8 -*-
from django.db import migrations
def set_collection_path_collation(apps, schema_editor):
"""
Treebeard's path comparison logic can fail on certain locales such as sk_SK, which
sort numbers after letters. To avoid this, we explicitly set the collation for the
'path' column to th... | kaedroho/wagtail | wagtail/core/migrations/0027_fix_collection_path_collation.py | Python | bsd-3-clause | 906 |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 23:34:33 2015
@author: donghochoi
"""
# The first value refers to the total participants.
# Following numbers present the participants' device IDs.
batch_1 = [10,0,1,2,3,4,5,6,7,8,9]
batch_2 = [6,0,2,6,7,8,9]
batch_3 = [9,0,1,2,3,4,5,7,8,9]
batch_4 =[10,0,1,2,3,4,5,6,... | DonghoChoi/Exploration_Study | study_2015/fitbit_used.py | Python | gpl-3.0 | 326 |
try:
xrange(5)
except:
xrange = range
def csv_split(line, splitter):
""" Split the text on splitter, taking into account double quotes """
in_quote = False
out = []
current_stash = []
for letter in line:
if letter in '\'"':
if in_quote:
in_quote = False
else:
in_quote = True
elif letter in s... | eeue56/Svenum | svenum.py | Python | bsd-3-clause | 2,506 |
#!/usr/bin/env python
'''
6. Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx.
9. Bonus Question - Redo exercise6 but have the SSH connections happen
concurrently using either threads or processes (see example). What main issue
is there with using threads in Python?
'''
from netmiko import C... | blahu/pynet-course2 | class4/ex9.py | Python | apache-2.0 | 2,524 |
"""
Test that the po command acts correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class PoVerbosityTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self... | youtube/cobalt | third_party/llvm-project/lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py | Python | bsd-3-clause | 1,992 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 13 21:00:38 2017
@author: pchero
"""
import Tkinter as tk
import ttk
import tkFont
import tkSimpleDialog
class FrameMain(object):
container = None
action_handler = None
data_handler = None
# info
list_headers = ["uuid"]
detail_headers = ... | pchero/asterisk-outbound | tester/view_handler_dialing.py | Python | bsd-2-clause | 8,798 |
# -*- coding: utf-8 -*-
from django.conf import settings as dj_settings
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Post.enable_comments'
db.add_column(u'djangocms_blog_post', 'enable_comments',
... | Venturi/oldcms | env/lib/python2.7/site-packages/djangocms_blog/south_migrations/0006_auto__add_field_post_enable_comments.py | Python | apache-2.0 | 17,189 |
from .core import ConstExpression
CONST_LISTING = {
"NaN": "not a number (same as JavaScript literal NaN)",
"LN10": "the natural log of 10 (alias to Math.LN10)",
"E": "the transcendental number e (alias to Math.E)",
"LOG10E": "the base 10 logarithm e (alias to Math.LOG10E)",
"LOG2E": "the base 2 l... | altair-viz/altair | altair/expr/consts.py | Python | bsd-3-clause | 875 |
from zope.testing import doctest
from unittest import TestSuite
from utils import optionflags
from Testing.ZopeTestCase import FunctionalDocFileSuite
from base import FunctionalTestCase
def test_suite():
tests = ['rolespage.txt',]
suite = TestSuite()
for test in tests:
suite.addTest(FunctionalDocFi... | collective/collective.groupspace.roles | collective/groupspace/roles/tests/test_functional.py | Python | gpl-2.0 | 489 |
from DPAPI.Core import masterkey
from DPAPI.Core import registry
from DPAPI.Probes import dropbox
from DPAPI.Core import blob
import sqlite3
import re
import os
import binascii
# Version 0.1.
class GetOutlookPassword:
def getOutlookPassword(self, mkpDir, sid, credHist, ntUser, userPassword):
dic = {}
... | CarlosLannister/OwadeReborn | owade/fileAnalyze/outlook.py | Python | gpl-3.0 | 3,487 |
import numpy as np
from gplearn.skutils.class_weight import compute_class_weight
from gplearn.skutils.class_weight import compute_sample_weight
from gplearn.skutils.testing import assert_array_almost_equal
from gplearn.skutils.testing import assert_almost_equal
from gplearn.skutils.testing import assert_raises
from g... | danbob123/gplearn | gplearn/skutils/tests/test_class_weight.py | Python | bsd-3-clause | 6,573 |
#!/usr/bin/env python
"""Show the content of DeepCpG data files.
Shows the content of ``dcpg_data.py`` output files for a selected region, for
example the methylation state of the target CpG site, neighboring CpG sites, or
the DNA sequence.
Examples
--------
Show the output methylation state of CpG sites on on chrom... | cangermueller/deepcpg | scripts/dcpg_data_show.py | Python | mit | 7,266 |
import numpy
import os
import numpy as np
import logging
from theano.tensor.signal import pool
from theano.tensor.nnet.abstract_conv import bilinear_upsampling
import joblib
from theano.tensor.nnet import conv2d
from theano.tensor.nnet import relu,softmax
import theano
import theano.tensor as T
from theano.tensor.sign... | jsafyan/style-transfer-theano | src/vgg19/theano_model/vgg19_model.py | Python | mit | 16,402 |
#!/usr/bin/env python
####################################
#
# --- TEXTPATGEN TEMPLATE ---
#
# Users can change the output by editing
# this file directly.
#
# The text is written to a timestamped file.
#
####################################
import time
fp=open(time.strftime('00_%s.txt'), 'w')
fp.write('############... | kevinleake01/textpatgen | 12-workspace-py/tpl-py-file-0009.py | Python | gpl-2.0 | 842 |
# -*- coding: utf-8 -*-
#----------------------------------------------------------------
# load OSM data file into memory
#
#------------------------------------------------------
# Copyright 2007, Oliver White
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | ryfx/modrana | modules/pyroutelib2/loadOsm.py | Python | gpl-3.0 | 7,380 |
import os
import pytest
from pages.desktop.home import Home
@pytest.mark.skipif(os.environ.get('PYTEST_BASE_URL') is None,
reason='Live Server login currently not functioning')
def test_login(my_base_url, selenium, user):
"""User can login"""
page = Home(selenium, my_base_url).open()
... | harikishen/addons-server | tests/ui/test_login.py | Python | bsd-3-clause | 719 |
"""
Monkey patch and defuse all stdlib xml packages and lxml.
"""
import sys
patched_modules = (
'lxml',
'ElementTree',
'minidom',
'pulldom',
'sax',
'expatbuilder',
'expatreader',
'xmlrpc',
)
if any(module in sys.modules for module in patched_modules):
existing_modules = [(module,... | bqbn/addons-server | src/olympia/lib/safe_xml.py | Python | bsd-3-clause | 774 |
import os
import yaml
from itertools import dropwhile
from .command import Command
from .event import Event
from .logger import create_logger
class PluginNotEnabled(RuntimeError):
pass
class Plugin(object):
def __init__(self, bot, path):
self.loaded = False
self.help = 'No help available, s... | aurora-pro/apex-sigma | sigma/core/plugin.py | Python | gpl-3.0 | 2,966 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/pasta | pasta/base/__init__.py | Python | apache-2.0 | 576 |
"""
Installs and configures OpenStack Horizon
"""
import logging
import os
import uuid
from packstack.installer import validators
from packstack.installer import basedefs, output_messages
from packstack.installer import exceptions
import packstack.installer.common_utils as utils
from packstack.modules.ospluginutils ... | slagle/packstack | packstack/plugins/dashboard_500.py | Python | apache-2.0 | 6,797 |
# Copyright 2012 10gen, 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 writing, soft... | adgaudio/mongo-connector | mongo_connector/doc_managers/solr_doc_manager.py | Python | apache-2.0 | 5,852 |
import os
import statsd
import setuptools
if os.path.isfile('README.rst'):
long_description = open('README.rst').read()
else:
long_description = 'See http://pypi.python.org/pypi/python-statsd/'
setuptools.setup(
name=statsd.__package_name__,
version=statsd.__version__,
author=statsd.__author__,
... | fredericmohr/mitro | mitro-mail/build/python-statsd/setup.py | Python | gpl-3.0 | 682 |
import urllib.request
from bs4 import BeautifulSoup
from gtts import gTTS
import os
import datetime
def fetch_news():
link = urllib.request.urlopen('https://news.google.co.in/')
# .co.in will fetch news from India domain
soup = BeautifulSoup(link, "html.parser")
news_heads = soup.findAll('div', {'cla... | Akash1684/ScriptsPy | vocal_news.py | Python | mit | 1,073 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# DNS related functions
#
# Copyright (c) 2005 JAS
#
# Author: Petr Vokac <vokac@kmlinux.fjfi.cvut.cz>
#
# $Id: dnscache.py 57 2007-04-03 23:54:20Z vokac $
#
import logging
import time
import random
import struct
import socket
import threading
import dns.resolver
import dns.e... | Exa-Networks/scavengerexa | lib/scavenger/policy/tools/dnscache.py | Python | agpl-3.0 | 14,826 |
from numpy.testing import assert_equal, TestCase
from numpy.core import ones
from numpy import matrix
class TestDot(TestCase):
def test_matscalar(self):
b1 = matrix(ones((3,3),dtype=complex))
assert_equal(b1*1.0, b1)
| beiko-lab/gengis | bin/Lib/site-packages/numpy/matrixlib/tests/test_numeric.py | Python | gpl-3.0 | 246 |
# Pybatis
# Copyright 2009 Cystems Technology
# Author: Manni Wood (mwood aat cystems-tech.com)
# This file is part of Pybatis.
#
# Pybatis is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either versi... | manniwood/Pybatis | pybatis/__init__.py | Python | gpl-3.0 | 2,036 |
def foo():
"""
Parameters:
<weak_warning descr="Unexpected parameter c in docstring"><caret>c</weak_warning> (int): start of description
continuation line 1
continuation line 2
Returns:
Nothing:
""" | asedunov/intellij-community | python/testData/inspections/GoogleDocStringRemoveParamWithSection.py | Python | apache-2.0 | 253 |
# -*- coding: utf-8 -*-
__doc__ = """This module provides an experimental subclass of
:class:`~formalchemy.forms.FieldSet` to support zope.schema_'s schema. `Simple
validation`_ is supported. `Invariant`_ is not supported.
.. _zope.schema: http://pypi.python.org/pypi/zope.schema
.. _simple validation: http://pypi.pyt... | FormAlchemy/formalchemy | formalchemy/ext/zope/__init__.py | Python | mit | 19,654 |
from apscheduler.scheduler import Scheduler as Sched
from couchpotato.core.event import addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
log = CPLog(__name__)
class Scheduler(Plugin):
crons = {}
intervals = {}
started = False
def __init__(self):
... | entomb/CouchPotatoServer | couchpotato/core/_base/scheduler/main.py | Python | gpl-3.0 | 2,451 |
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
class WeibopError(Exception):
"""Weibopy exception"""
def __init__(self, reason):
self.reason = reason.encode('utf-8')
def __str__(self):
return self.reason
| sunner/buzz2weibo | weibopy/error.py | Python | mit | 256 |
from datetime import (
datetime,
timedelta,
)
import re
import numpy as np
import pytest
from pandas._libs.tslibs import period as libperiod
from pandas.errors import InvalidIndexError
import pandas as pd
from pandas import (
DatetimeIndex,
NaT,
Period,
PeriodIndex,
Series,
Timedelta,... | jorisvandenbossche/pandas | pandas/tests/indexes/period/test_indexing.py | Python | bsd-3-clause | 32,864 |
from __future__ import unicode_literals
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
if not db.dry_run:
from m... | eRestin/MezzGIS | mezzanine/pages/migrations/0010_set_menus.py | Python | bsd-2-clause | 6,132 |
from .base_gan import BaseGAN
from hyperchamber import Config
from hypergan.discriminators import *
from hypergan.distributions import *
from hypergan.gan_component import ValidationException, GANComponent
from hypergan.generators import *
from hypergan.inputs import *
from hypergan.layer_shape import LayerShape
from h... | 255BITS/HyperGAN | hypergan/gans/aligned_gan.py | Python | mit | 4,197 |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | google-research/google-research | structformer/utils.py | Python | apache-2.0 | 1,703 |
#
# 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
# ... | dims/heat | heat/engine/attributes.py | Python | apache-2.0 | 10,194 |
INSTALLED_APPS = ['lino_book.projects.20121124']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
}
SECRET_KEY = "123"
| khchine5/book | lino_book/projects/20121124/settings.py | Python | bsd-2-clause | 185 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-07 00:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0010_auto_20160830_1740'),
]
operations = [
migrations.Ad... | fle-internal/content-curation | contentcuration/contentcuration/migrations/0011_file_source_url.py | Python | mit | 471 |
# Python - 3.6.0
test.assert_equals(head([5, 1]), 5)
test.assert_equals(tail([1]), [])
test.assert_equals(init([1, 5, 7, 9]), [1, 5, 7])
test.assert_equals(last([7, 2]), 2)
| RevansChen/online-judge | Codewars/7kyu/head-tail-init-and-last/Python/test.py | Python | mit | 174 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/connectedvmware/azure-mgmt-connectedvmware/azure/mgmt/connectedvmware/operations/_inventory_items_operations.py | Python | mit | 15,691 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | GoogleCloudPlatform/ai-notebooks-extended | gke-hub-example/docker/jupyter/jupyter-mine-basic/jupyter_notebook_config.py | Python | apache-2.0 | 2,231 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class User(models.Model):
_inherit = 'res.users'
google_calendar_rtoken = fields.Char('Refresh Token', copy=False)
google_calendar_token = fields.Char('User token', copy=Fa... | chienlieu2017/it_management | odoo/addons/google_calendar/models/res_users.py | Python | gpl-3.0 | 697 |
from __future__ import print_function
import h5py
import os
import sys
import time
import shutil
import tempfile
from subprocess import *
from numpy import *
my_path = os.path.dirname(os.path.abspath(__file__))
#sys.path.append(os.path.join(my_path, '..'))
from fds import *
from fds.checkpoint import *
XMACH = 0.1... | qiqi/fds | tests/test_fun3d_mpi.py | Python | gpl-3.0 | 6,188 |
from __future__ import absolute_import, print_function
import argparse
import json
import logging
import logging.config
import os
import sys
import dotenv
import boto
from boto.s3.connection import S3Connection
import tweepy
from tweepy import OAuthHandler
from mosaicme.async.tasks import upload_image
BASE_DIR = os... | arvindkandhare/mosaicme | mosaicme/collector/history.py | Python | mit | 5,058 |
# Copyright 2016 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... | nightjean/Deep-Learning | tensorflow/contrib/tfprof/python/tools/tfprof/model_analyzer_testlib.py | Python | apache-2.0 | 2,651 |
import csv
def lerCSV(path):
values = []
i = 0
with open(path, 'r') as csvfile:
datareader = csv.reader(csvfile,delimiter=',')
for v in datareader:
if(i > 0):
values.append(v[1])
i = i + 1
return values
def ensemble():
arq1 = "knn.csv"
arq2 = "xgboost.csv"
values1 = lerCSV(arq1)
values2 = lerCS... | fmilepe/avito-contest | ensemble.py | Python | apache-2.0 | 905 |
BLANK = u"\u25A1"
from collections import namedtuple
import json
class Tape:
def __init__(self, alphabet: str, size: int, init_data: str = None):
self.alphabet = set(alphabet + BLANK)
self.size = size
if init_data is None:
self.data = [BLANK for x in range(size)]
... | james-dietz/turing | machine.py | Python | gpl-3.0 | 3,758 |
# coding = utf-8
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
tf.set_random_seed(1)
np.random.seed(1)
# Hyper Parameters
BATCH_SIZE = 128
TIME_... | paineliu/tflearn | rnn02.py | Python | apache-2.0 | 2,697 |
import os
import re
from hwt.serializer.hwt import HwtSerializer
from hwt.serializer.systemC import SystemCSerializer
from hwt.serializer.verilog import VerilogSerializer
from hwt.serializer.vhdl import Vhdl2008Serializer
from hwt.synthesizer.unit import Unit
from hwt.synthesizer.utils import to_rtl_str
from hwt.simul... | Nic30/hwtLib | hwtLib/examples/base_serialization_TC.py | Python | mit | 1,714 |
from django.conf import settings
from .api import Graph, TO_NODE as TO_NODE_INDEX, ATTRIBUTES as ATTRIBUTES_INDEX, TIME as TIME_INDEX
from .decorators import crud_aware
# DECORATE the get_object() method for DetailView generic class, to send object_visited signal
DETAIL_VIEW_SEND_VISITED_SIGNAL = getattr(settings, 'D... | suselrd/django-social-graph | social_graph/__init__.py | Python | bsd-3-clause | 861 |
class Console:
def __init__(self, time, char_reader, screen_printer, screen):
self._time = time
self._char_reader = char_reader
self._screen_printer = screen_printer
self._screen = screen
self._finished = False
def main_loop(self):
try:
self._char... | alexsiri7/beantop | beantop/console.py | Python | gpl-3.0 | 1,444 |
#pylint: disable=C0301, C0103, W0212
"""
.. module:: radical.pilot.scheduler.Interface
:platform: Unix
:synopsis: The abstract interface class for all schedulers.
.. moduleauthor:: Ole Weidner <ole.weidner@rutgers.edu>
"""
__copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu"
__license__ = "MIT"
... | JensTimmerman/radical.pilot | src/radical/pilot/scheduler/interface.py | Python | mit | 2,025 |
import numpy as np
import pandas as pd
import datetime
class Tariffs :
def __init__(self, scheme_name, retail_tariff_data_path, duos_data_path, tuos_data_path, nuos_data_path, ui_tariff_data_path):
self.scheme_name = scheme_name
self.retail_tariff_data_path = retail_tariff_data_path
self.du... | lukasmarshall/embedded-network-model | tariffs.py | Python | mit | 22,618 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-dialogflow-cx | samples/generated_samples/dialogflow_v3beta1_generated_webhooks_list_webhooks_sync.py | Python | apache-2.0 | 1,514 |
#!/usr/bin/env python
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master'))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master/wkpf'))
print os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master/wkpf')
from... | wukong-m2m/NanoKong | tools/python/scripts/installer.py | Python | gpl-2.0 | 2,839 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-25 17:04
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... | H0neyBadger/cmdb | organization/migrations/0001_initial.py | Python | mit | 1,544 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gladieter.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| gvkalra/gladieter | gladieter/manage.py | Python | mit | 252 |
import dataset
import datasource
import transformer
| rsk-mind/rsk-mind-framework | tests/__init__.py | Python | mit | 52 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
PyCOMPSs Testbench
========================
"""
# Imports
import unittest
from pycompss.api.api import compss_wait_on
from pycompss.api.task import task
class testMultiReturnInstanceMethods(unittest.TestCase):
@task(returns=(int, int))
def argTask(self, *args)... | mF2C/COMPSs | tests/sources/python/0_multireturn/src/modules/testMultiReturnInstanceMethods.py | Python | apache-2.0 | 10,484 |
# Copyright 2016 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | googleapis/google-auth-library-python | tests/transport/compliance.py | Python | apache-2.0 | 3,742 |
from django.contrib import admin
from django.db import models
from pagedown.widgets import AdminPagedownWidget
from .models import Faq, Category
class FaqAdmin(admin.ModelAdmin):
formfield_overrides = {
models.TextField: {'widget': AdminPagedownWidget},
}
fieldsets = [
('Faq', {'fields'... | ildoc/homeboard | faqs/admin.py | Python | mit | 900 |
from pyVideoDatasets.BackgroundSubtraction import *
from pyVideoDatasets.DepthUtils import *
from pyVideoDatasets.BasePlayer import *
import pyVideoDatasets.configs
from openni import *
import time
class User:
com = []
userID = -1
jointPositions = {}
jointPositionsConfidence = {}
... | colincsl/RGBD-Dataset-Reader | pyVideoDatasets/dataset_readers/RealtimePlayer.py | Python | bsd-2-clause | 12,201 |
#
# Copyright (C) 2015 University of Chicago
# Pierre Riteau <priteau@uchicago.edu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | ChameleonCloud/openstack-nagios-plugins | openstacknagios/keystone/Endpoints.py | Python | gpl-3.0 | 2,385 |
# Common imports
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sklearn.linear_model as skl
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler, StandardScaler, Normalizer
from sklea... | CompPhysics/MachineLearning | doc/src/Regression/franke.py | Python | cc0-1.0 | 2,706 |
__author__ = 'gontarz'
| adgon92/optimalization-project | src/solvers/__init__.py | Python | gpl-2.0 | 23 |
from pyrake.contrib.spiders.crawl import CrawlSpider, Rule
from pyrake.contrib.spiders.feed import XMLFeedSpider, CSVFeedSpider
from pyrake.contrib.spiders.sitemap import SitemapSpider
| elkingtowa/pyrake | pyrake/contrib/spiders/__init__.py | Python | mit | 185 |
from __future__ import unicode_literals
import datetime
from django.http import Http404
from django.utils.timezone import utc
from model_mommy import mommy
from kb.tests.test import ViewTestCase
from kb.models import Article
class TestCategoryFeed(ViewTestCase):
view_name = 'kb:category_feed'
view_kwargs ... | eliostvs/django-kb | kb/tests/category/tests_feeds.py | Python | bsd-3-clause | 2,006 |
# -*- coding: utf-8 -*-
from socialoauth.sites.base import OAuth2
class NetEase(OAuth2):
AUTHORIZE_URL = 'https://api.t.163.com/oauth2/authorize'
ACCESS_TOKEN_URL = 'https://api.t.163.com/oauth2/access_token'
NETEASE_API_URL_PREFIX = 'https://api.t.163.com/'
def build_api_url(self, url):
re... | yueyoum/social-oauth | socialoauth/sites/netease.py | Python | mit | 911 |
import json
from pywinauto import application
def clickOnButton(app, btn_title, n = None):
try:
while True:
app[""][btn_title].Click()
if n is not None and n == 0:
break
else: n-=1
except Exception:
pass
def preTest():
app = applicatio... | DarthThanatos/citySimNG | citySimNGView/test/ResourceSheetAutoTest.py | Python | apache-2.0 | 2,715 |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _
from frappe.model.document import Document
from frappe.utils import (nowdate, getdate, now_d... | saurabh6790/erpnext | erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py | Python | gpl-3.0 | 9,661 |
from xyz.location import build_location
def test_build_location_simple():
# test
Location = build_location()
location = Location("Canada", "Charlottetown")
assert location.country == "Canada"
assert location.city == "Charlottetown"
| codetojoy/gists | python/pipenv_jun_2020/tests/test_location.py | Python | apache-2.0 | 257 |
import os
import argparse
from graphviz import Digraph
def parse_tree_dump_file(tree_dump_file):
pass
def main():
parser = argparse.ArgumentParser(description="A tool for visualizing the TREE structure of GCC")
parser.add_argument("--tree_dump", required=True, help="the tree dump file from GCC by 'gcc -fdump-tr... | benquike/cheatsheets | programming-language/python/gcc_tree_visualize.py | Python | cc0-1.0 | 457 |
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
# Copyright 2011 Google Inc. All Rights Reserved.
"""OSX tests."""
import os
import mock
import mox
from grr.lib import flags
from grr.lib import osx_launchd as testdata
from grr.lib import test_lib
class OSXClientTests(test_lib.OSSpecificClientTests... | pidydx/grr | grr/client/client_actions/osx/osx_test.py | Python | apache-2.0 | 4,587 |
import cherrypy
import handlers.handlerOutput
class JoinGameHandler(handlers.handlerOutput.GetGameData):
@cherrypy.tools.json_out()
def POST(self, gameID):
# Add player to game. This allows him to pick up a websocket to the game. Return adress to ws.
try:
playerName = cherrypy.ses... | flaeder-studios/multipong | handlers/joinGameHandler.py | Python | gpl-2.0 | 787 |
from django.conf import settings
from django.core.cache import cache
from django.utils.hashcompat import md5_constructor
from django.utils.encoding import smart_str
from django.template.defaultfilters import slugify
from django.contrib.auth.models import User
from avatar.settings import (AVATAR_DEFAULT_URL, AVATAR_CA... | jetmc/django-avatar | avatar/util.py | Python | bsd-3-clause | 3,086 |
import os
from imp import reload
import bot_header
class Console(object):
acc = None
acc_number = None
def get_message(self):
if self.acc is not None:
return "%s >> " % self.acc.first_last()
else:
return ''
def exec_startup(self):
with open("startup.h... | ihydrogen/hydrogen-chat-bot-py | console/bot_console.py | Python | apache-2.0 | 2,724 |
#!/usr/bin/python
#
# Copyright (C) 2007-2008 Arnold Krille
#
# This file is part of FFADO
# FFADO = Free Firewire (pro-)audio drivers for linux
#
# FFADO is based upon FreeBoB.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | llekn/ffado | admin/pyuic.py | Python | gpl-2.0 | 1,522 |
from MultiDark import *
box = MultiDarkSimulation(Lbox=4000.0 * uu.Mpc, boxDir = "MD_4Gpc")
ll = n.array( glob.glob( "/data2/DATA/eBOSS/Multidark-lightcones/MD_4Gpc/snapshots/out_128*.fits" ) )
box.compute2PCF_MASS(ll, rmax=30, dr = 0.1, Nmax=1000000, vmin=n.log10(box.Melement)+2, dlogBin=0.05, name="rmax_30")
| JohanComparat/nbody-npt-functions | bin/bin_MD/2PCF-mbins-30-MD40box.py | Python | cc0-1.0 | 318 |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='datamanager',
version='0.1.0',
description='Datamanager for X-Ray Nano Imaging Beamline in Pohang Accelerator Laboratory',
author='Hyounggyu Kim',
author_email='hgkim10@gmail.com',
url='https://github.com/hyounggyu/datam... | hyounggyu/datamanager | setup.py | Python | gpl-2.0 | 364 |
#!/usr/bin/env python
# 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.
'''Tool to determine inputs and outputs of a grit file.
'''
import optparse
import os
import posixpath
import sys
from grit impor... | geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/grit/grit_info.py | Python | gpl-3.0 | 6,776 |
#!/usr/bin/python3
#
# Code in this file is derived from icb.py carrying this license:
#
## Copyright (c) 2011, Michael C. Thornburgh
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without modification,
## are permitted provided that the following conditions are met:
##
## 1.... | gpshead/icbhead | icb.py | Python | bsd-2-clause | 32,013 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-01-12 10:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0001_initial'),
]
operations = [
migrations.AlterField(
... | MEEM-MLHD/territoire_conseil | src/projects/migrations/0002_auto_20170112_1016.py | Python | bsd-3-clause | 2,915 |
# 2017-06-13
# Successful run with US stocks. I tried using Yahoo Finance as the source but it didn't work,
# likely because Yahoo has changed its API for data downloading.
# I also tried to use the codes below to obtain HKEX stocks but was not successful
# turned out that google does not support HKEX after I spent ... | hjliu-QTrader/Python | Getting Stock Price Data from Google Finance.py | Python | mit | 904 |
# -*- coding: utf-8 -*-
# © 2015 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api
class ProductTemplate(models.Model):
_inherit = 'product.template'
@api.multi
@api.depends('virtual_available', 'incoming_qty')
def _immediately_usa... | avoinsystems/stock-logistics-warehouse | stock_available_immediately/models/product_template.py | Python | agpl-3.0 | 622 |
# -*- coding: utf-8 -*-
import xc_base
import geom
import xc
__author__= "Luis C. Pérez Tato (LCPT)"
__copyright__= "Copyright 2014, LCPT"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
feProblem= xc.FEProblem()
preprocessor= feProblem.getPreprocessor
# Definimos geometria
points= preproc... | lcpt/xc | verif/tests/postprocess/vtk/dibuja_edges.py | Python | gpl-3.0 | 1,366 |
"""urlconf for the base application"""
from django.conf.urls import url, patterns, include
from forms import *
from haystack.views import SearchView, search_view_factory, FacetedSearchView
from haystack.query import SearchQuerySet
class SubjectFacetedSearchView(FacetedSearchView):
"""
We subclass the base hay... | sashafr/uronline | base/urls.py | Python | bsd-3-clause | 6,979 |
# coding: utf-8
from __future__ import division
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfpage import PDFTextExtractionNotAllowed
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.pdfinterp import PDFPageIn... | thisismattmiller/lcc-pdf-to-json | extract_outlines.py | Python | mit | 11,159 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-21 13:24
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('timetable', '0007_cminstances_cminstancesa_cminstancesb_stumodulesa_stumodulesb'),
]
opera... | uclapi/uclapi | backend/uclapi/timetable/migrations/0008_auto_20190221_1324.py | Python | mit | 476 |
def get_embed():
from django.shortcuts import render_to_response
return render_to_response('clock/widget.html').content
| devpixelwolf/Pixelboard | src/clock/service.py | Python | gpl-3.0 | 129 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from six import stri... | laurentgo/pants | src/python/pants/option/optionable.py | Python | apache-2.0 | 1,844 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.