src stringlengths 721 1.04M |
|---|
# 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... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import web, bcrypt, redis, json, requests, dns.resolver, re, M2Crypto, cgi
from urlparse import urlsplit
from zbase62 import zbase62
web.config.debug = False
r_server = redis.Redis('localhost')
urls = (
'/', 'index',
'/check', 'check',
'/logout', 'logout',
'/registe... |
import time
import socket
from termcolor import colored
from rolit.protocol import Protocol
class Helpers(object):
@staticmethod
def log(message):
message = "[%s] %s" % (time.strftime("%H:%M:%S"), message)
print(message)
@staticmethod
def notice(message):
print(colored(messag... |
import pytest
from rpython.rtyper.test.tool import BaseRtypingTest
from rpython.rlib.rstruct.runpack import runpack
from rpython.rlib.rstruct import standardfmttable
from rpython.rlib.rstruct.error import StructError
from rpython.rlib.rarithmetic import LONG_BIT
import struct
class TestRStruct(BaseRtypingTest):
de... |
# 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: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from flask import json
from sqlalchemy import or_, and_
from ggrc.models import... |
# -*- coding: utf-8 -*-
import sys
import json
import argparse
import nicfit
from .. import Identity, IdentityChain
from .utils import prompt
from ..common import thumbprint, newJwk, jwkIsPrivate
@nicfit.command.register
class identity(nicfit.Command):
HELP = "Identity and stuffs"
def _initArgParser(self, ... |
import tensorflow as tf
import numpy as np
import hyperchamber as hc
import inspect
from hypergan.trainers.base_trainer import BaseTrainer
TINY = 1e-12
class MultiStepTrainer(BaseTrainer):
def __init__(self, gan, config, losses=[], var_lists=[], metrics=None):
self.losses = losses
self.var_lists ... |
# -*- coding: utf8 -*-
from .jogadores import Jogador
class MeuJogador(Jogador):
def percent(self,data,percentil):
data = sorted(data)
n = len(data)
if n == 0:
pass
#print ("Lista vazia")
else:
return int(round(percentil*n+1))
... |
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
# Copyright (C) Zing contributors.
#
# This file is a part of the Zing project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
"""Test set... |
"""Lukes Algorithm for exact optimal weighted tree partitioning."""
from copy import deepcopy
from functools import lru_cache
from random import choice
import networkx as nx
from networkx.utils import not_implemented_for
__all__ = ["lukes_partitioning"]
D_EDGE_W = "weight"
D_EDGE_VALUE = 1.0
D_NODE_W = "weight"
D_N... |
import os
import uuid
import pytest
from weakref import WeakKeyDictionary
from nameko.testing.services import entrypoint_hook, dummy
from nameko.testing.utils import get_extension
from mock import Mock
import rethinkdb as r
from rethinkdb.errors import RqlRuntimeError
from nameko_rethinkdb import RDB, RDB_KEY
RDB_... |
#!/usr/bin/python
#
# Copyright 2014 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... |
import logging
import argparse
import os
__version__ = '0.1-dev'
#Usage: python Main.py --write --sprite zelda.spr --rom lttpromtobepatched.sfc #generates zelda_lttpromtobepatched.sfc
# python Main.py --read --sprite zelda.spr --rom lttpromtobescanned.sfc #generates zelda.spr
#General rom patching logic copied ... |
# -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 your option) any ... |
"""
Created on Sun Sep 17 07:26:03 2017
@author: dariocorral
"""
from datetime import datetime, date, timedelta
import pytz
class Hour(object):
"""
Auxiliary class for converting GMT - NY - local time hours
"""
#Local time hour property
@property
def current_local(self):
"""
... |
# pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103
from __future__ import absolute_import, division, print_function
import numpy as np
from mock import MagicMock
from ..image_widget import ImageWidget
from .... import core
from ....core.tests.test_state import TestApplication
from ...glue_application import Glue... |
# Copyright 2013 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 os
import unittest
from telemetry import value
from telemetry.page import page_set
from telemetry.value import scalar
class TestBase(unittest.TestCas... |
# Based on: https://github.com/caglar/autoencoders.git
# http://www-etud.iro.umontreal.ca/~gulcehrc/
import theano
import theano.tensor as T
from theano.tensor.shared_randomstreams import RandomStreams
from layer import AEHiddenLayer, AEOutputLayer
# from tools import NonLinearity, CostType, relu
from sop_embed.extra ... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: test_platform/steps/execute/build.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... |
import random
import socket
import struct
from random import randint
def port_generator():
lim=1000
port_src_start = []
port_src_end = []
port_dst_start = []
port_dst_end = []
for i in range (0,lim):
m = random.randint(1, 200)
n = random.randint(1, 200)
i... |
# coding: utf-8
"""
This file defines:
- WriteMesh
"""
from __future__ import (nested_scopes, generators, division, absolute_import,
print_function, unicode_literals)
import sys
import io
from codecs import open
from six import string_types, iteritems, itervalues, PY2, StringIO
#from pyNastra... |
import tornado.web
import logging
import json
try:
from urllib.parse import unquote
from urllib.parse import quote
except ImportError:
from urllib import unquote
from urllib import quote
from .base import BaseHandler
from ..base import EnsureUser
from lib.db.tomorrow import Article, User
class EditHa... |
#!/usr/bin/env python
"""
Maintains a stable view of / access to state:
- Combines multiple underlying blockchain sources,
- Temporally tracks degrees of confidence based on age, with chain reorg support.
"""
##
## Note: BUG1 refers to,
##
## When you have nested manager.dict()'s, instead of:
## h['a']['b'] = 'c... |
import glob
import gzip
import os
import subprocess
from find_intersecting_snps import *
def read_bam(bam):
"""
Read a bam file into a list where each element of the list is a line from
the bam file (with the newline stripped). The header is discarded.
"""
res = subprocess.check_output('samtools v... |
"""tests/test_input_format.py.
Tests the input format handlers included with Hug
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, in... |
#!/bin/env python3
import csv
import sys
from datetime import datetime
rows = []
with open(sys.argv[1]) as f:
fc = csv.reader(f)
headers = next(fc)
for r in fc:
di = datetime.strptime(r[0], '%Y-%m-%d')
r_date = datetime.strftime(di, '%m/%d/%y')
r_account = '现金'
r_cate = r[3... |
import os
import random
import string
from flask_transfer.transfer import Transfer
from flask_transfer.validators import AllowedExts
from flask_wtf.file import FileField
from flask_wtf.file import FileRequired, FileAllowed
from flask_wtf.form import Form
from werkzeug.utils import secure_filename
from wtforms.fields.s... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""TODO"""
# This file is part of Linshare cli.
#
# LinShare cli 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 ... |
# 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 ... |
import pandas as pd
import fcsparser
import os
#####
def make_dir(path):
'''
Checks if the provided path exists and if it doesn't creates it
Arguments
--
path: (string) path - pointing to the desired folder in memory
'''
if not os.path.exists(path):
os.makedirs(path)
def listF... |
from numpy import matrix, asarray, apply_along_axis
from numpy.linalg import norm
import simplejson
def get_top_items(user_index, items, Theta, X, item_mean=None, R_filter=None):
if R_filter == None:
R_filter = set([])
scores = X[user_index,:] * Theta
if(item_mean != None):
scores = mat... |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... |
# Copyright 2015 Technische Universitaet Berlin
# 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
#
# Unle... |
#!/usr/bin/env python
import urllib.request
import urllib.parse
import http.cookiejar
import re
import time
import json
caller_url = "http://caller.ap01.aws.af.cm"
tieba_url = "http://tieba.baidu.com"
token_url = "https://passport.baidu.com/v2/api/?getapi&tpl=mn&apiver=v3&tt=1385610373352&class=login&loginty... |
# Copyright 2021 The ML Collections 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 or agreed... |
import random
import lilypond
import matplotlib.pyplot as plt
VALID_INTERVALS = [2, 4, 5, 7, 9, 11] # Intervals between notes that are allowed (fourth sepcies counterpoint)
CONSONANCES, DISSONANCES = [2, 4, 5, 7, 9, 11], [3, 6, 8, 10] # Intervals between notes that are allowed (third species counterpoint)
VALID_ODD_... |
from bearded_octo_wookie.lbm import *
from sympy import *
from fractions import Fraction
from bearded_octo_wookie.MRT import genFeq, getMRT
from sympy.utilities.codegen import codegen
#W = np.array([Rational(_W) / Rational(36) for _W in W[:] * 36.])
U = [var('U_0'), var('U_1')]
rho = var('rho')
D = 2
Q = 9
def g... |
###############################################################################
##
## Copyright 2011-2013 Tavendo GmbH
##
## 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
##
## ... |
import json
# This assumes that only list responses are split across pages. I don't like it, but
# it gets me started quickly, punting the question about handling response formats to
# the future.
def coalesce_response(response, n):
collection = []
for page in response:
list_response = json.loads(page... |
# -*- coding: utf-8 -*-
import time as _time
from datetime import datetime as _dt
from datetime import tzinfo as _tzinfo
from datetime import timedelta as _timedelta
import llbc
class _pyllbcGMT(_tzinfo):
"""llbc library GMT tzinfo class encapsulation"""
_delta = _timedelta(0)
def utcoffset(self, dt):
... |
#!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
"""
This example script runs the Mandelbrot fractal generator sequentially.
In this example, we run the Mandelbrot generator for a 2048x2048 pixel
Mandelbrot fractal. We split it up in 4x4 tiles which we run sequentially, one
after another o... |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.txt')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
'pyramid',
'pyramid_jinja2',
'pyramid_debu... |
# pylint: disable=unicode-format-string
"""
Classes used for defining and running pytest test suites
"""
import os
from glob import glob
from pavelib.utils.envs import Env
from pavelib.utils.test import utils as test_utils
from pavelib.utils.test.suites.suite import TestSuite
from pavelib.utils.test.utils import COV... |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Red... |
'''
Created on 27 lip 2014
@author: Krzysztof Langner
'''
from mewa.client import Connection
HOST_URL = "ws://mewa.cc:9001/ws"
# HOST_URL = "ws://localhost:9000/ws"
connection = Connection(HOST_URL)
def onConnected():
connection.getDevices()
connection.sendEvent("serviceA.event2", "78", True)
params =... |
from math import cos, sin, pi
import numpy as np
def to_rad(angle):
return angle * 0.0174532925
def to_deg(angle):
return angle * 57.2957795
def add(a, b):
return tuple(x+y for x, y in zip(a, b))
def sub(a, b):
return tuple(x-y for x,y in zip(a,b))
def scale(scalar, v):
return t... |
"""
kombu.pools
===========
Public resource pools.
"""
from __future__ import absolute_import
import os
from itertools import chain
from .connection import Resource
from .five import range, values
from .messaging import Producer
from .utils import EqualityDict, register_after_fork
from .utils.functional import laz... |
# -*- encoding: utf-8 -*-
##
## Copyright (C) 2011 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
##
## 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; version 3 only.
##
## This program is distri... |
import struct
from bytecode import (
OPCODES, unsigned_int_s, signed_int_s, double_s, signed_long_int_s,
unsigned_long_int_s, signed_char_s, positional_instructions
)
from strquot import quote
DECODE_OPCODES = {}
for k in OPCODES:
DECODE_OPCODES[OPCODES[k] / 0x1000000] = k
WORD_ARG = set('GET SET GET_GLOBAL SET_GL... |
"""
A setuptools based setup module.
"""
import platform
import warnings
from __init__ import VERSION
# Always prefer setuptools over distutils
from codecs import open
from os import path
from setuptools import setup
# To use a consistent encoding
here = path.abspath(path.dirname(__file__))
# Get the long descript... |
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'BatchProcessing.ui'
#
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_BatchProcessing(object):
def setupUi(self, BatchProcessin... |
"""
Written by Erdong Hu at the Postlethwait lab of the University of Oregon
Last updated August 16, 2015
"""
import re
import operator
import collections
import sys
import timeit
###Note###
# There is a large chunk of commented out code that is remnant from old version
"""Reads in a GTF file and organizes it by tr... |
from waterspout.app import Waterspout
from waterspout.web import RequestHandler
from waterspout.auth import login_required, permission_required
class LoginHandler(RequestHandler):
def get(self):
if not self.session["id"]:
self.session["id"] = 1
else:
self.session["id"] = 2... |
# 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, ... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
AlgorithmExecutor.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************... |
# vim: fileencoding=utf-8 et ts=4 sts=4 sw=4 tw=0
"""
An RPC client class using ZeroMQ as a transport and
the standard Python threading API for concurrency.
Authors
-------
* Alexander Glyzov
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2012-2014. Brian Granger,... |
#########################################'
# Environment Variables - public
#########################################
#Debug Level
#1 for debug, mod python will reload import each time
DEBUG = 1
#USER privilege
USERDICT = {'guest':1,'user':2, 'admin':3, 'root':4}
#minimum number of informative strains
KMININFOR... |
"""ILSVRC 2017 Classicifation Dataset.
DEPRECATED version. For the purpose of keeping history only.
Use ilsvrc2017_cls_multithread.py instead.
"""
import os
import cv2
import numpy as np
import random
import config as cfg
class ilsvrc_cls:
def __init__(self, image_set, rebuild=False, data_aug=True):
se... |
# -*- coding: utf-8 -*-
"""
################################################
Plataforma ActivUFRJ
################################################
:Author: *Núcleo de Computação Eletrônica (NCE/UFRJ)*
:Contact: carlo@nce.ufrj.br
:Date: $Date: 2009-2010 $
:Status: This is a "work in progress"
:Revision: $Revision: 0.0... |
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.base.ui import ZoneAddView
from cfme.exceptions import ItemNotFound
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.update import update
pytestmark = [test_requirements.configuration]
NAME_LEN = 5
DESC_LEN ... |
# 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 your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... |
import subprocess
import time
import pytest
import testinfra
@pytest.fixture(scope="session")
def host(request):
test_image = "docker-centos7-slurm:spec-test"
subprocess.check_call(["docker", "build", "-t", test_image, "."])
docker_id = subprocess.check_output(
["docker", "run", "-d", "-it", "-h"... |
# -*- coding: utf-8 -*-
#
# Genomics Tutorial documentation build configuration file, created by
# sphinx-quickstart on Sat Nov 19 11:28:35 2016.
#
# 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 f... |
# Copyright 2012 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 by applicable law or agreed t... |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the right... |
# coding=utf-8
# 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.
"""Collection of subprocess wrapper functions.
In theory you shouldn't need anything else in subprocess, or this module failed.
"""
impor... |
###
# Copyright (c) 2011, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... |
#
# 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 us... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright (c) 2011 Sergey Gulyaev <astraway@gmail.com>
#
# This file is part of Vertaler.
#
# Vertaler is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... |
#!/opt/local/bin/python
import os
import sys
import re
import fnmatch
PROJECT_NAME = "KExperiment"
source_reg = re.compile(".*\.(cpp|h)$")
task_reg = re.compile("^\s*/+\s*(TODO|FIXME|BUG|NOTE|HACK):?\s*(.*)$", re.I)
source_match = source_reg.match
task_match = task_reg.match
def main():
output = os.path.join(os.... |
from __future__ import division, print_function, absolute_import
import os
import argparse
def day_counts(keys_file, rounding_days=None):
"""
keys_file: input file with float of date (normalized so first
journals begin at zero) in the 4th column.
rounding_days: number of days to round the d... |
# -*- 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):
for obj in orm['accounts.SshPublicKey'].objects.all():
obj.save()
def backwards(self, orm):
"Wri... |
"""
Discovery-based test loader.
This plugin implements nose2's automatic test module discovery. It
looks for test modules in packages and directories whose names start
with 'test', then fires the :func:`loadTestsFromModule` hook for each
one to allow other plugins to load the actual tests.
It also fires :func:`handl... |
import email
import imaplib
import json
from input.imap.connection import open_connection
from input.imap.header import get_mail_header
from util.read_utils import lines_per_n
def get_unavailable_uid():
"""
This function returns a list of UIDs that are not available in the IMAP server
:retu... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostMultipathInfoLogicalUnitPolicy(vim, *args, **kwargs):
'''The HostMultipathInfoLog... |
# -*- coding: utf-8 -*-
"""
@author: aeidelman
"""
import os
import pandas as pd
path = '/home/sgmap/data/SIRENE'
path_extract = os.path.join(path, 'sirene_NJ_4_et_7.csv')
tab = pd.read_csv(path_extract,
sep=';',
encoding='cp1252'
)
print(tab.SIREN.value_counts... |
#!/usr/bin/env python3
"""TCP echo server example."""
import argparse
import asyncio
import sys
import os
try:
import signal
except ImportError:
signal = None
from msg_log import Message
from game_log import log
ARGS = argparse.ArgumentParser(description="PyPh test fixtures.")
ARGS.add_argument(
'--se... |
"""Unit tests for the module assess_assessment."""
import typing
import unittest
from unittest import mock
import mongomock
from bob_emploi.frontend.api import project_pb2
from bob_emploi.frontend.api import stats_pb2
from bob_emploi.frontend.server import proto
from bob_emploi.frontend.server.asynchronous import co... |
from setuptools import setup, find_packages
version = '1.0.5'
setup(
name = 'tabula',
version = version,
description = "Ascii table",
url = "https://github.com/ronniedada/tabula",
long_description = open("README.md").read(),
classifiers = [
"Intended Audience :: Developers",
'D... |
# Copyright (c) 2001-2016, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public t... |
# ===========================================================================
# eXe
# Copyright 2004-2005, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... |
# This file is part of OtfBot.
#
# OtfBot is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# OtfBot is distributed in the hope that it... |
import os
from datetime import datetime
from urlparse import urlsplit
from django import forms
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.forms.formsets import BaseFormSet, formset_factory
from django.utils.translation import ugettext, ugettext_lazy a... |
#!/usr/bin/env python
# ----------------------------------------------------------------------- #
# Copyright 2008-2010, Gregor von Laszewski #
# Copyright 2010-2013, Indiana University #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); ... |
# -*- coding: utf-8 -*-
# Copyright 2007-2011 The Hyperspy developers
#
# This file is part of Hyperspy.
#
# Hyperspy 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... |
import os.path
import json
import re
from gspread.models import Cell
from gspread_dataframe import _cellrepr
def contents_of_file(filename, et_parse=True):
with open(os.path.join(os.path.dirname(__file__), filename), "r") as f:
return json.load(f)
SHEET_CONTENTS_FORMULAS = contents_of_file("sheet_conten... |
#!/usr/bin/env python2.5
#
# Copyright 2008 the Melange 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 applic... |
import embed_token_seq
import image_preprocessing
import embed_image
import mix_and_gen_q_values
import embed_previous_action as epa
import tensorflow as tf
import numpy as np
class ActionValueFunctionNetwork:
""" Creates policy Q(s,a) that approximates Q values
over actions for a given observed state s. """
... |
#!/usr/bin/env python3
#
# Copyright (c) 2020, The OpenThread Authors.
# 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 copyright
# ... |
# Задача 8. Вариант 8
'''
Доработайте игру "Анаграммы" (см. М.Доусон
Программируем на Python. Гл.4) так, чтобы к
каждому слову полагалась подсказка. Игрок должен
получать право на подсказку в том случае, если
у него нет никаких предположений. Разработайте
систему начисления очков, по которой бы игроки,
отгадавшие слово... |
# 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 ... |
from eve import Eve
from flask import request
from flask.ext.cors import CORS
import plano_utils
def after_insert_application(documents):
for doc in documents:
plano_utils.add_application(doc)
def after_insert_component(documents):
for doc in documents:
plano_utils.add_component(doc)
app =... |
import json
import sys
from pathlib import Path
from .finder import Finder
from .parser import Parser
class JsonNotListError(Exception):
pass
class IncorrectNumberOfArguments(Exception):
pass
class Standalone:
def __init__(self, html_path, json_path=None):
self.parser = Parser()
self.... |
import os
import json
import tempfile
import shutil
from flask import request, redirect, url_for
from werkzeug.utils import secure_filename
from findex_gui.web import app, themes, db
from findex_gui.bin.misc import version
from findex_gui.controllers.admin.status.status import AdminStatusController
from findex_gui.co... |
import logging
import requests
from requests import RequestException
from torrt.base_notifier import BaseNotifier
from torrt.utils import NotifierClassesRegistry
LOGGER = logging.getLogger(__name__)
class TelegramNotifier(BaseNotifier):
"""Telegram bot notifier. See instructions how to create bot at https://cor... |
# astronomy.py 12.10.3
from math import *
G = 6.673e-11
c = 2.998e8
H = 80 # km/s/Mpc
v = 0
relg = 1/(sqrt(1-((v/c)**2)))
def gforce(m1, m2, r):
''' (int, int, int) -> int
Calculates gravitational force between masses m1 and m2 (kg) at a separation of r (m).
'''
global G
return str((G*m1*m2)/(r**2)) + ' N'
... |
# -*- coding: utf-8 -*-
#
# File : corpus/IQLACorpus.py
# Description : .
# Date : 16/08/2017
#
# Copyright Nils Schaetti, University of Neuchâtel <nils.schaetti@unine.ch>
# Imports
from Sample import Sample
import codecs
# Class to access to a text
class Text(Sample):
"""
Class to access to a text
"""
... |
# -*- coding: utf-8 -*-
"""Word cloud is ungraded xblock used by students to
generate and view word cloud.
On the client side we show:
If student does not yet answered - `num_inputs` numbers of text inputs.
If student have answered - words he entered and cloud.
"""
import json
import logging
import datetime
import cs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.