src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
"""
W tym pliku następuje konwersja pliku wsadowego z programu GMSH na plik do programu Calculix.
"""
import numpy as np
import os
def zmianaElem(mesh, stMesh):
"""
Funkcja zmienia formę zapisu elementów na odpowiednia dla Calculix'a.
"""
np.set_printoptions(threshold='nan')
... |
# coding: utf-8
# flake8: noqa
"""
Kubeflow Pipelines API
This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition.
Contact: kubeflow-pipelines@google.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute... |
import json
import os
import shutil
import tempfile
import time
import yaml
from bzt import TaurusConfigError, TaurusException
from bzt.bza import Master, Test, MultiTest
from bzt.engine import ScenarioExecutor, ManualShutdown, Service
from bzt.modules.aggregator import ConsolidatingAggregator, DataPoint, KPISet
from... |
from random import randrange
from myhdl import *
vectors = tuple([randrange(0, 9) for i in range(1000)])
from calc_next_age import calc_next_age
def tb():
age_out = Signal(bool(0))
live_count = Signal(intbv(0, min=0, max=9))
step = Signal(bool(0))
clock = Signal(bool(0))
reset =... |
#!/usr/bin/env python
import urllib.request
def genterm(inp):
def foo(x):
if x.isalpha():
return x
else:
return '%{0}'.format(hex(ord(x))[2:])
return ''.join(map(foo,inp))
def genresults(inp):
page=urllib.request.urlopen('http://ajax.googleapis.com/ajax/services/sea... |
# coding = 'utf-8'
import math
import config as cfg
import re
import jieba
import urllib.request
from urllib import error
from sklearn.feature_extraction.text import TfidfVectorizer
# 手机
user_agent = r'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 ... |
#
# Copyright (C) 2017 Kevin Thornton <krthornt@uci.edu>
#
# This file is part of fwdpy11.
#
# fwdpy11 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... |
#!/usr/bin/env python
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2018 Intel Corporation
#
# 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-... |
"""
Exceptions thrown by KeyStore objects
"""
class ItemNotFoundError(Exception):
pass
class ItemWriteConflictError(Exception):
pass
class MultipleCourseBlocksFound(Exception):
"""
Raise this exception when Iterating over the course blocks return multiple course blocks.
"""
pass # lint-am... |
# -*- coding: utf-8 -*-
#
# 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
#... |
import datetime
import unittest
import thalesians.tsa.q as kdb
class TestDataTypes(unittest.TestCase):
def setUp(self):
self.conn = kdb.q('localhost', 41822)
def testInteger(self):
self.conn.k('{[x]test::x}', (15,))
self.assertEqual(self.conn.k('test'), 15)
self.conn.k('test:2... |
# Copyright (C) 2017 Linaro Limited
# Author: Andy Doan <andy.doan@linaro.org>
import datetime
import json
import logging
import mimetypes
import mmap
import os
import time
import urllib.error
import urllib.request
import urllib.parse
from http.client import HTTPException
from multiprocessing.pool import ThreadPool
... |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... |
# -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = os_env.get('WEBSTERTON_SECRET', 'secret-key') # TODO: Change me
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
BCRYPT_LOG_R... |
import sys
import re
from os import listdir, linesep
from os.path import isfile, join, splitext
def clearLine(line):
return line.strip().replace(r'\&', '').replace(r'\fB', '').replace(r'\fC', '').replace(r'\fP', '').replace(r'\-', '-').replace(r'#', '<nowiki>#</nowiki>')
def convert(in_filename, out_filename):
f = ... |
#-*- coding:utf-8 -*-
__author__ = 'hermes'
import socket
from os import system
from time import sleep
from datetime import datetime
global connectionName
connectionName = 'TOGOTELECOM' # Definir le nom de votre reseau
def is_connected():
# http://stackoverflow.com/questions/20913411/test-if-an-internet-connectio... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""The Controller class for Excavations."""
import re
from flask import Blueprint, render_template, redirect, url_for, current_app, \
request, abort
from modules.Shared.database import db
from modules.Countries.model import Country
from modules.Regions.model import Region
... |
#!/usr/bin/python
# Copyright (c) 2013 The Gapcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
from urllib import urlopen
import requests
import getpass
from string import Template
import sys
i... |
# This file is part of DevParrot.
#
# Author: Matthieu Gautier <matthieu.gautier@devparrot.org>
#
# DevParrot 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
... |
# This function plots up a series of maps illustrating forest loss through time,
# as modelled based on global forest watch annual forest loss distributed temporally
# based on the "seasonality" of FORMA
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from mpl_toolkits.basemap import Basemap, s... |
__module_name__ = "xchat-clementine"
__module_version__ = "1.0"
__module_description__ = "Get NP information from Clementine"
from dbus import Bus, DBusException
import xchat
import os
import sys
import re
import string
bus = Bus(Bus.TYPE_SESSION)
global nowplaying
global time
global chan
global cnc
nowplaying = " "
de... |
"""
This is the template for the computation problem of computing a Groebner basis of an ideal
generated by a finite set of polynomials with integer coefficients (commutative). It creates
code for the computer algebra system Maple.
.. moduleauthor:: Albert Heinle <albert.heinle@rwth-aachen.de>
"""
#------------------... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import alerts
import json
import random
import string
import unittest
import webtest
from google.appengine.api import memcache
from google.appengine.ext imp... |
#!/usr/bin/env python
# This file should be compatible with both Python 2 and 3.
# If it is not, please file a bug report.
"""
This is the set of installed images that bellongs to a given user.
"""
#external imports
import os,json,collections,sys
#internal imports
import subuserlib.classes.installedImage,subuserlib.c... |
from .base import URLSettingsBase, is_importable
class CacheSettings(URLSettingsBase):
REDIS_CONFIG = {'BACKEND': 'django_redis.cache.RedisCache', 'OPTIONS': {}}
CONFIG = {
'locmem': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'},
'file': {'BACKEND': 'django.core.cache.backends... |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Google Inc.
# 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. Redistributions of source code must retain the above ... |
#!/bin/env python3.1
# Bradley N. Miller, David L. Ranum
# Introduction to Data Structures and Algorithms in Python
# Copyright 2005, 2010
#
class BinarySearchTree:
'''
Author: Brad Miller
Date: 1/15/2005
Description: Imlement a binary search tree with the following interface
func... |
# 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 ... |
# -*- coding: utf-8 -*-
"""Module containing judge user profiles and various utilities."""
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals impor... |
# 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 ... |
#!/usr/bin/env python
"""A module with client action for talking with osquery."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import os
from future.builtins import map
from future.utils import iterkeys
from typing import Any
from t... |
#!/usr/bin/env python
import bottle, socket
import yaml
import os, io, time
import build
# Site path
path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '_site')
src_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '_template')
# Method to set up site
def setup(path):
# Link site
... |
from __future__ import absolute_import
from webfriend.rpc import Base
from datetime import datetime
from base64 import b64decode
class Cookie(object):
def __init__(self, rpc, definition):
self._rpc = rpc
self._definition = definition
self.name = definition['name']
... |
#!/usr/bin/python
##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# 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 ... |
import numpy as np
import pandas as pd
from .common import (
_contains_datetime_like_objects,
is_np_datetime_like,
is_np_timedelta_like,
)
from .pycompat import dask_array_type
def _season_from_months(months):
"""Compute season (DJF, MAM, JJA, SON) from month ordinal"""
# TODO: Move "season" acce... |
# Copyright 2013 Open Cloud Consortium
#
# 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 a... |
#!/usr/bin/env python
import os, errno, shutil
import sys, subprocess
import argparse
import xml.etree.ElementTree as ET
class ParameterError(Exception):
pass
class PathError(Exception):
pass
class MesherNotRunError(Exception):
pass
class colours:
ylw = '\033[93m'
blu = '\033[94m'
... |
import xbmc
import xbmcaddon
import inspect
import os
import sys
import socket
import re
class printDebug:
def __init__(self, main, sub=None):
self.main=main
if sub:
self.sub="."+sub
else:
self.sub=''
self.level=settings.get_debug()
... |
<<<<<<< HEAD
<<<<<<< HEAD
import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import... |
import nltk
import pandas as pd
import re
from googletrans import Translator
from unicodedata import normalize
def read_csv(file):
df1 = pd.DataFrame.from_csv('files_extern/%s.csv'%(file),sep=';',index_col=0,encoding ='ISO-8859-1')
df1 = df1.reset_index()
return df1
def write_csv(data,file):
d... |
from itertools import chain
from math import ceil, log
from utils import *
import os.path
import re
import sys
import yaml
data = dict()
labels = dict()
memory = []
maxnum = 0
# Helper
def show_error( s ):
return s, False
# Helper
def round_to_word( i ):
return int( int( i/data[ 'consts' ][ 'words_per_line'... |
# Copyright 2019 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.
"""
Builds Web IDL database.
Web IDL database is a Python object that supports a variety of accessors to
IDL definitions such as IDL interface and IDL attri... |
#!/usr/bin/python
from lofar.messaging.RPC import RPC, RPCException, RPCWrapper
import logging
import sys
logger = logging.getLogger(__name__)
from lofar.sas.systemstatus.service.config import DEFAULT_SSDB_BUSNAME
from lofar.sas.systemstatus.service.config import DEFAULT_SSDB_SERVICENAME
class SSDBRPC(RPCWrapper):
... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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
#
# ... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-8 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
# Author: Hubert Kario, (c) 2015
# Released under Gnu GPL v2.0, see LICENSE file for details
from __future__ import print_function
import traceback
import sys
import getopt
from itertools import chain
from random import sample
from tlsfuzzer.runner import Runner
from tlsfuzzer.messages import Connect, ClientHelloGene... |
# -*- coding: utf-8 -*-
{
'# of International Staff': '# अन्तराष्ट्रिय स्टाफ',
'# of National Staff': '# राष्ट्रिय स्टाफ',
'# selected': '# छानियो',
'%(app)s not installed. Ask the Server Administrator to install on Server.': '%(app)s इन्स्टल हुन सकेन । सर्भरलाई इन्स्टल गर्नको निम्ति सर्भरको एडमिनिस्ट्राटरलाई सोध्नुहोस... |
""" Cisco_IOS_XR_bundlemgr_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR bundlemgr package configuration.
This module contains definitions
for the following management objects\:
lacp\: Link Aggregation Control Protocol commands
This YANG module augments the
Cisco\-IOS\-XR\-ifmgr\-c... |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.functional import lazy
from django.core.cache import cache
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from yats.models import tickets
from yats.models import base
import datetime
import base64
import ht... |
from unittest.mock import MagicMock, Mock, call, patch, sentinel
import pytest
from graph_structures_pb2 import (
SLI,
Client,
Dependency,
Node,
NodeType,
SLIType,
UserJourney,
)
import ujt.server.generate_data
@pytest.fixture
def patch_path():
return "ujt.server.generate_data"
def... |
from .fetcher import Fetcher
from .fetcher import NoRecordsFetchedException
from .oai_fetcher import OAIFetcher
from .solr_fetcher import SolrFetcher
from .solr_fetcher import PySolrFetcher
from .solr_fetcher import PySolrQueryFetcher
from .solr_fetcher import RequestsSolrFetcher
from .marc_fetcher import MARCFetcher
f... |
import logging
from ip import get_ip
log_vals = {
'CRITICAL': logging.CRITICAL,
'ERROR': logging.ERROR,
'WARNING': logging.WARNING,
'INFO': logging.INFO,
'DEBUG': logging.DEBUG,
'NOTSET': logging.NOTSET}
class LoggingError(Exception):
def __init__(self, arg):
self.message = 'Log... |
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This file is part of cloud-init. See LICENSE file for license information.
"""
SSH Import Id
---------... |
#!/usr/bin/env python
import flask
from flask import Flask
from flask import request
from werkzeug import secure_filename
import os, random, datetime, codecs
import sys, json, magic
import cPickle as pickle
import regex as re
import keywords
import argparse
import xml.etree.ElementTree
import zipfile
app = Flask(__na... |
#
# Copyright (c) SAS Institute 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 w... |
# coding=utf-8
import re
import requests
import six
from django.core.exceptions import ValidationError
from .models import Country
DATA_HEADERS_ORDERED = [
'ISO', 'ISO3', 'ISO-Numeric', 'fips', 'Country', 'Capital', 'Area(in sq km)',
'Population', 'Continent', 'tld', 'CurrencyCode', 'CurrencyName', 'Phone',
... |
from __future__ import print_function, division
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import ipdb
def RNN_LSTM(batch_size_in = 5, total_len_in = 30000, pad_len_in = 5, backprop_len_in = 50, state_size_in = 10, num_class_in = 32):
# total_len_in = (backprop_len_in) * (num_batches... |
import json
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.hashers import make_password
from django.core.exceptions import ObjectDoesNotExist # ORM get查询不到数据
from django.core.urlresolvers import reverse
from django.db.models i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import amis
def check_env(env, default=None):
"""Check/Set environment variables"""
if not os.environ.get(env) and not default:
print "Error: '{0}' environment variable not set".format(env)
sys.exit()
return os.environ.... |
# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
from odoo import models, api, fields, _
from odoo.exceptions import ValidationError
class AccountAnalyticDimension(models.Model):
_inherit = 'account.analytic.dimension'
ref_model_i... |
##
## This file is part of the sigrok-meter project.
##
## Copyright (C) 2015 Jens Steinhauser <jens.steinhauser@gmail.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2... |
# -*- coding: utf-8 -*-
# WikidumpParser, Copyright 2014 Daniel Schneider.
# schneider.dnl(at)gmail.com
# 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
# (a... |
import math
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
def _variable_with_weight_decay(name, shape, wd=1e-3):
with tf.device("/cpu:0"): # store all weights in CPU to optimize weights sharing among GPUs
var = tf.get_variable(name, shape, initializer=tf.contrib.... |
import sys
import time
from orbitalperturbation.perturbation_utils import create_backup, command_exists, execute_command
class GaussianOrbitalPerturber:
executable_name = "gaussian_perturbation"
formchk_command = "formchk"
unfchk_command = "unfchk"
def __init__(self, checkpoint_file):
self.c... |
#!/usr/bin/env python
import argparse
import six
import subprocess
def parallel_link_jobs():
try:
import multiprocessing
cpus = multiprocessing.cpu_count()
return max(cpus / 4, 2)
except:
return 2
parser = argparse.ArgumentParser(
description=
"CMake configuration op... |
"""
Tests for Shopping Cart views
"""
import json
from collections import OrderedDict
from datetime import datetime, timedelta
from decimal import Decimal
from urlparse import urlparse
import ddt
import pytz
from django.conf import settings
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.mode... |
#https://github.com/mkleehammer/pyodbc/wiki/
import os
import re
import logging
import pyodbc
from openpyxl import Workbook
from openpyxl.styles import Font
class SQLserver:
def __init__(self, params, autocommit=False, searchescape=None, timeout=None):
params_str = r'DRIVER={ODBC Driver 11 for SQL Server};'
para... |
from kivy.animation import Animation
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.metrics import dp
from kivy.properties import BooleanProperty, ObjectProperty, StringProperty
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.image import Image
from kivy.uix.recycleview import Re... |
from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from sentry.api import client
from sentry.models import OrganizationMemb... |
"""
Helper functions that can display leaflet maps inline in an ipython notebook
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins i... |
"""Natural Language Processing; Chart Parsing and PageRanking (Chapter 22-23)"""
from collections import defaultdict
from utils import weighted_choice
import urllib.request
import re
# ______________________________________________________________________________
# Grammars and Lexicons
def Rules(**rules):
"""C... |
# Copyright (c) 2014 Rackspace Hosting
#
# 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 ... |
"""
Support for sensors from the Dovado router.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.dovado/
"""
import logging
import re
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from... |
from collections import OrderedDict
from config import *
##########################################################
class Score:
# name
# desc
# ovelapScores
# errorNum
# overlap
# error
# successRateList
def __init__(self, name, desc, tracker=None, evalType=None, seqs=[],
over... |
"""
Slactorbot - A Python Slack Bot with hot patch!
"""
import os
import re
from setuptools import find_packages, setup
def fread(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def get_version():
VERSIONFILE = "slactorbot/_version.py"
verstrline = fread(VERSIONFILE).strip()
... |
"""
RNN-based decoders.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from encoder_decoder import decoder, data_utils, graph_utils, rnn
class RNNDecoder(decoder.Decoder):
def __init__(self, hyperparame... |
# 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
# d... |
import json
from collections import OrderedDict
LENGTH_FIELD_LENGTH = 4
def serialize(json_obj):
'''
Turn a JSON object into bytes suitable for writing out to the network.
Includes a fixed-width length field to simplify reconstruction on the other
end of the wire.
Parameters
----------
j... |
import unittest
from test import support
from unittest.case import _ExpectedFailure
import errno
import io
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import... |
from __future__ import unicode_literals
import inspect
from six import add_metaclass
from django.contrib.auth.models import Group, Permission
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from rolepermissions.utils import camelToSnake, camel_or_snake_to_ti... |
#!/usr/bin/python
import os
import sys
import json
from subprocess import call
# path of directory containing all .json files
PATH_SOURCE = './data_arxiv_json/'
PATH_DEST = './sharded/'
def __write_json_files(path_source, path_dest, keyword):
'''
Create json chunks from a previous db dump (.json)
'''
... |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Elements in the object's info widget"""
from lib import base
from lib.page import modal
from lib.constants import locator
class DropdownSettings(base.Component):
"""A class for the button/dropdown se... |
#!/usr/bin/python
import sys
from klampt import *
from klampt import vis
from klampt.vis.glrobotprogram import GLSimulationPlugin
import robotiq
class MyGLViewer(GLSimulationPlugin):
def __init__(self,world):
GLSimulationPlugin.__init__(self,world)
#Put any controller modules or sensor / actuator... |
# -*- coding: utf-8 -*-
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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
#
# U... |
#! /usr/bin/env python
"""Admin scripting.
"""
import sys, inspect
from skytools.scripting import DBScript
from skytools.quoting import quote_statement
__all__ = ['AdminScript']
class AdminScript(DBScript):
"""Contains common admin script tools.
Second argument (first is .ini file) is takes as command
... |
#!/usr/bin/env python
from pybal import bal
from pylab import figure, plot, xlabel, ylabel, title, show, axis
# create a dynamical system and load the equations of the Hindmarsh-Rose neuron model
hr = bal.DynamicalSystem()
hr.create('HindmarshRose')
# create the parameters of the model
par = bal.Parameters(hr.npar)
... |
import logging
import threading
import time
from smqtk.representation import DescriptorElement
from smqtk.representation import DescriptorElementFactory
from smqtk.representation import get_descriptor_element_impls
__author__ = 'paul.tunison@kitware.com'
class CachingDescriptorElement (DescriptorElement):
@cl... |
# 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... |
# Copyright 2019 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, ... |
# -*- coding: utf-8 -*-
# © 2016 Elico Corp (https://www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, fields, models
from openerp.tools.translate import _
from openerp.exceptions import ValidationError
class Project(models.Model):
_inherit = "proje... |
from datetime import timedelta
import pytest
from furl import furl
from osf_tests.factories import (
AuthUserFactory,
PreprintFactory,
PreprintProviderFactory,
)
from reviews.permissions import GroupHelper
from reviews_tests.factories import ReviewLogFactory
from website.util import permissions as osf_per... |
import sys
import xbmcaddon
import xbmcgui
import xbmc
import telnetlib
Addon = xbmcaddon.Addon('script.shutdownvdr')
# Script constants
__scriptname__ = Addon.getAddonInfo('name')
__id__ = Addon.getAddonInfo('id')
__version__ = Addon.getAddonInfo('version')
class SVDRPClient(object):
def __init__(self, host, ... |
# ===============================================================================
# Copyright 2011 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... |
#!/usr/bin/env python
'''
Created on 2010-04-02
@author: Dominik
'''
about = "This module lets you download other modules from pastebin."
def main(server, initOnChannel, usrManager):
pass
def destroy(server):
pass
def cmd(server, word, word_eol, usrManager):
if word[3].startswith("|modules"):
if ... |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
from __future__ import ... |
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
from django_dynamic_fixture import G
from django_webtest import WebTest
from icekit.models import Layout
from icekit.page_types.layout_page.models import LayoutPage
fro... |
# 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... |
# Problem: 242 [Easy] Funny Plant
# https://www.reddit.com/r/dailyprogrammer/comments/3twuwf/20151123_challenge_242_easy_funny_plant/
# Author: ExcaliburZero
# License: MIT
import fileinput
def main():
# Iterate over each of the input lines
for line in fileinput.input():
# Get the input values
... |
# Author: Marc Finzi
# Last updated: 1/14/2016
# Contactable at mfinzi@hmc.edu
import globalV
import os,sys,time
import FileDialog
import Tkinter as tk
import ttk
import numpy as np
from matplotlib import use; use("TkAgg")
from matplotlib.pyplot import xkcd
from matplotlib.figure import Figure
#from matplotlib import ... |
# Copyright 2019 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, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.