text stringlengths 2 999k |
|---|
# Generated by Django 2.1 on 2018-09-05 22:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0009_auto_20180905_2331'),
]
operations = [
migrations.AddField(
model_name='student'... |
from flask import Flask, render_template, request, jsonify
from flask_bootstrap import Bootstrap
import matplotlib
from datetime import datetime
from api.plots import Plots
from api.data_loader import load_currency
from models.predictor import Predictor
matplotlib.use('Agg')
app = Flask(__name__)
Bootstrap(app)
CU... |
#!/usr/bin/env python
# Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... |
# -*- coding: utf-8 -*-
import os.path
from unittest import TestCase
import pdfrw
from pdf_annotate import Appearance
from pdf_annotate import Location
from pdf_annotate import PdfAnnotator
from pdf_annotate.annotations.image import Image
from pdf_annotate.annotations.rect import add_rounded_rectangle
from pdf_annota... |
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
from fast_rcnn.config import cfg
from utils.blob import im_list_to_bl... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
"""
Userbot module to help you manage a group
"""
from asyncio import sleep
from os import remove
from telethon.errors ... |
# This example requires the 'message_content' privileged intent to function.
import discord
class MyClient(discord.Client):
async def on_ready(self):
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
async def on_message(self, message):
# we do not want the bot t... |
#!/usr/bin/env python
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='django-dob-widget',
version="1.2.0",
url='https://github.com/matthewwilkes/django-dob-widget',
author="Matthew Wilkes",
author_email="django-dobwidget... |
from LogFile import Parameters
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib import cm
import numpy as np
class LogFileProcessing:
"""
Provide the filename of the log to be analyzed
example: '000039.log'
To instantiate the class, type something like:
A... |
################################################################################################
# this script will scrape information from all of the 400 franchises in www.franchisetimes.com #
################################################################################################
from selenium import webdriv... |
import os
import random
import string
from datetime import datetime
from evrythng import entities
# Set this to your Operator Key located at:
# https://dashboard.evrythng.com/settings/account
EVT_OPERATOR_KEY = '2qdmVjDDFk9VQif7FEyHS1kdUyYXEP4C6C2Pfm2J9fRg42YpyFiTeqZY29XlE278rHsHlKrY7riIxpxM'
os.environ['EVRYTHNG_API... |
import os
from flask import Flask
from flask_assets import Environment
from flask_compress import Compress
from flask_login import LoginManager
from flask_mail import Mail
from flask_rq import RQ
from flask_sqlalchemy import SQLAlchemy
from flask_wtf import CSRFProtect
from app.assets import app_css, app_js, vendor_c... |
from stuff import *
cases=loadcsv('SAcasecounts.csv')
cases['South Africa']=cases['Total']
del cases['Total']
provinces=['Eastern Cape','Free State','Gauteng','KwaZulu-Natal','Limpopo','Mpumalanga','North West','Northern Cape','Western Cape']
mindate='2021-10-01'
maxdate='3000-12-31'
if len(sys.argv)>1: mindate=sys.... |
def main():
# One interesting fact about data structures is that we can build
# them with comprehensions. Let's explain how the first one works:
# we just want to create zeros so our expression is set to `0`
# since no computing is required; because `0` is a constant value,
# we can set the item tha... |
#!/usr/bin/env python2
# Copyright 2016 Andy Chu. 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
"""
builtin_misc.py - Mis... |
import torch
from ...support.kernels import AbstractKernel
from ...core import default, GpuMode
from pykeops.torch import Genred
import logging
logger = logging.getLogger(__name__)
class KeopsKernel(AbstractKernel):
def __init__(self, gpu_mode=default.gpu_mode, kernel_width=None, cuda_type=None, freeze_DOFs=No... |
# focal loss with multi label
def focal_loss(classes_num, gamma=2., alpha=.25, e=0.1):
# classes_num contains sample number of each classes
def focal_loss_fixed(target_tensor, prediction_tensor):
'''
prediction_tensor is the output tensor with shape [None, 100], where 100 is the number of c... |
import os, sys, re, subprocess
import datetime
fn_log = 'log.txt'
touched = {}
data = {}
genomesize = {}
if os.path.exists(fn_log):
with open(fn_log) as fi:
for line in fi:
items = line.split('\t')
name = items[0]
data[name] = {}
for item in items[1:]:
... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
def test_200_success(petstore):
User = petstore.get_model('User')
user = User(
id=1,
username='bozo',
firstName='Bozo',
lastName='TheClown',
email='bozo@clown.com',
password='newpasswor... |
#-*- coding:utf-8 -*-
import os
import time
import pprint
import tensorflow as tf
from six.moves import range
from logging import getLogger
logger = getLogger(__name__)
pp = pprint.PrettyPrinter().pprint
def get_model_dir(config, exceptions=None):
"""根据设置的参数生成一个路径.
这个路径将会作为存放训练数据的目录地址,所以不同的参数的训练数据必须保证路径唯一。
"""... |
"""status.py"""
# Taken from werkzeug/http.py
HTTP_STATUS_CODES = {
100: 'Continue',
101: 'Switching Protocols',
102: 'Processing',
200: 'OK',
201: 'Created',
202: 'Accepted',
203: 'Non Authoritative Information',
204: 'No Content',
205: 'Reset Content',
206: 'Partial Content',
... |
import views
ROUTES = (
# url routes are defined using dictionaries that match
# add_url_rule parameters.
# http://flask.pocoo.org/docs/0.11/api/
# rule, endpoint=None, view_func=None, **options
{
'rule': '/', 'endpoint': 'index', 'view_func': views.index,
'methods': ['GET']
},... |
#%%
from kdg import kdf
from kdg.utils import get_ece
import openml
from joblib import Parallel, delayed
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier as rf
from sklearn.metrics import cohen_kappa_score
from kdg.utils import get_ece
import os
from os import listdir, getcwd
... |
from __future__ import division
import math
import warnings
from albumentations.core.utils import DataProcessor
__all__ = [
"check_keypoints",
"convert_keypoints_from_albumentations",
"convert_keypoints_to_albumentations",
"filter_keypoints",
"KeypointsProcessor",
]
keypoint_formats = {"xy", "yx"... |
from nose.tools import eq_
from ddtrace.contrib.util import func_name
from functools import partial
class SomethingCallable(object):
"""
A dummy class that implements __call__().
"""
value = 42
def __call__(self):
return 'something'
def me(self):
return self
@staticmetho... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('chunks', '0002_data'),
]
operations = [
migrations.AddField(
model_name='chunk',
name='content_de',
... |
import sys
import string
from os import utime
from os import unlink
if (sys.version_info >= (2,7)):
import unittest
else:
import unittest2 as unittest
from resource_suite import ResourceBase
from pydevtest_common import assertiCmd, assertiCmdFail, interruptiCmd, getiCmdOutput
import pydevtest_sessions as s
import c... |
# -*- coding: utf-8 -*-
#
from . import color
import matplotlib as mpl
def draw_text(data, obj):
'''Paints text on the graph.
'''
content = []
properties = []
style = []
if isinstance(obj, mpl.text.Annotation):
ann_xy = obj.xy
ann_xycoords = obj.xycoords
ann_xytext = o... |
"""This module contains the ``SeleniumMiddleware`` scrapy middleware"""
from importlib import import_module
from scrapy import signals
from scrapy.exceptions import NotConfigured
from scrapy.http import HtmlResponse
from selenium.webdriver.support.ui import WebDriverWait
from .http import SeleniumRequest
class Sel... |
# Copyright 2015 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... |
# MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2018
#
# 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
# r... |
import math
def rotateX(point, center, theta):
point = move(point, center, -1)
sin_t = math.sin(theta)
cos_t = math.cos(theta)
point = (
point[0],
point[1] * cos_t - point[2] * sin_t,
point[2] * cos_t + point[1] * sin_t
)
return move(point, center)
def rotateY(point, ce... |
from HARK.BayerLuetticke.Assets.One.FluctuationsOneAssetIOUs import *
from HARK.BayerLuetticke.Assets.One.SteadyStateOneAssetIOUs import *
from HARK.BayerLuetticke.Assets.One.FluctuationsOneAssetIOUsBond import *
from HARK.BayerLuetticke.Assets.One.SteadyStateOneAssetIOUsBond import *
from HARK.BayerLuetticke.Assets.Tw... |
class Room:
def __init__(self, user, name, password):
self.user = user
self.name = name
self.password = password
self.code = self._create_code()
def _create_code(self):
return self.name
def att_admin(self, admin_ip, admin_port):
self.admin_ip = admin_ip
... |
from collections import namedtuple
from datetime import datetime, timedelta
from functools import partial
from pathlib import Path
from typing import Generator, Union, Iterable
from dateutil.tz import tzlocal
from .casters import cast_date, cast_default, cast_recurrence, cast_int
class Calendar:
_key_map = {
... |
# -*- coding: utf-8 -*-
import time
from re import findall
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.supp... |
import requests
import time
from bs4 import BeautifulSoup
user = '' # username on hackernews
user_data = [] # stores user data
#user_data = [username, date created, karma, description]
submissions = [[],[],[]] # stores submissions; maximum is most recent page of submissions
# submissions = [[list of submission titles... |
# Created by Kelvin_Clark on 1/30/2022, 9:52 PM
from typing import Optional
from dotenv import load_dotenv
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
load_dotenv()
__app: Optional[FastAPI] = None
origins = [
"http://localhost:3000",
]
def create_app() -> FastAPI:
globa... |
import random
class Deck:
def __init__(self, domino_value):
self.dominos = []
for x in range(0, domino_value + 1):
for y in range(x, domino_value + 1):
self.dominos.append((x, y))
random.shuffle(self.dominos)
def draw(self, number):
drawnpi... |
#! /usr/bin/env python3
# -*-coding:utf-8 -*-
# @Time : 2019/06/15 20:29:38
# @Author : che
# @Email : ch1huizong@gmail.com
# bug
import os
from sqlalchemy import create_engine
from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
from sqlalchemy.orm import mapper, sessionmaker
path = "/... |
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
import glob
import os
import shutil
import sysconfig
from codegen.embedding_backward_code_generator import emb_cod... |
import io
import time
import keras
import numpy as np
from os.path import join
from PIL import Image
from base64 import encodebytes
from keras import backend as K
from keras.models import Model, Input
from keras.layers.merge import average
from flask import Flask, request, jsonify, send_from_directory
# The below prov... |
import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
install_requires = [
'pyramid',
]
tests_require = [
'djed.testing',
'... |
# 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.
{
'variables': {
'nacl_win64_target': 0,
'build_angle_deqp_tests%': 0,
},
'includes': [
'gpu_common.gypi',
],
'targets': [
{
... |
import copy
import random
class Hat:
def __init__(self, **kwarg):
contents = []
for key in kwarg.keys():
for n in range(kwarg[key]):
contents.append(key)
self.contents = contents
def draw(self, number):
contents = self.contents
if number >= ... |
# from dateutil import parser
# from pandas.lib import Timestamp
from time import sleep
import uuid
import numpy as np
from ib.client.Portfolio import AccountPacket, PortfolioPacket
from ib.ext.ExecutionFilter import ExecutionFilter
from ib.ext.EClientSocket import EClientSocket
from ib.client.sync_wrapper import ... |
# =================================================================
#
# Authors: Gregory Petrochenkov <gpetrochenkov@usgs.gov>
#
# Copyright (c) 2020 Gregory Petrochenkov
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Softwa... |
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
from jinja2 import Template, Environment, PackageLoader, select_autoescape
import json
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI']='sqlite:///site.db'
with open("./static/experience.json") as f:
XP=json.load(f)
env =... |
#!/usr/bin/env python3
#-*-coding: utf-8 -*-
# Эта программа осуществляет рассылку SMS-сообщений. Номера телефонов берутся из файла, задаваемого в
# командной строке.
# Рассылать сообщения будем в виде flash sms, для чего используется data_coding=24
# Другие значения можно найти на https://en.wikipedia.org/wiki/Data_C... |
import sys
import os
import argparse
import argcomplete
import json
import textwrap
from provisionpad.db.database import load_database
from provisionpad.runs.create_instance import create_instance
from provisionpad.runs.terminate_instance import terminate_instance
from provisionpad.runs.stop_instance import stop_instan... |
"""Utilities defining "Galaxy Flavored Markdown".
This is an extension of markdown designed to allow rendering Galaxy object
references.
The core "Galaxy Flavored Markdown" format should just reference objects
by encoded IDs - but preprocessing should allow for instance workflow objects
to be referenced relative to t... |
from api import free_dictionary_api, reverso_api, anki_connect_api
import config
def search_new_word(query):
wordcard = free_dictionary_api.search_a_word(query)
if not wordcard:
return False
else:
examples_from_reverso = reverso_api.get_examples(query, quantity_in_one_step=config.number_of... |
# -*- coding: utf-8 -*-
# Scrapy settings for user_pull_requests project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.or... |
from typing import List
from dispatch.config import INCIDENT_PLUGIN_CONTACT_SLUG
from dispatch.decorators import background_task
from dispatch.incident import flows as incident_flows
from dispatch.participant import service as participant_service
from dispatch.participant_role import service as participant_role_servi... |
#!/usr/bin/env python
u"""
load_nodal_corrections.py (12/2020)
Calculates the nodal corrections for tidal constituents
Modification of ARGUMENTS fortran subroutine by Richard Ray 03/1999
CALLING SEQUENCE:
pu,pf,G = load_nodal_corrections(MJD,constituents)
INPUTS:
MJD: Modified Julian Day of input date
con... |
'''OpenGL extension SGI.make_current_read
This module customises the behaviour of the
OpenGL.raw.GLX.SGI.make_current_read to provide a more
Python-friendly API
Overview (from the spec)
The association of the current context with a drawable is extended to allow
separate write and read drawables. This paves the... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import pathlib
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints", # Must come *after* sphinx.ext.napoleon.
"sphinx.ext.autosummary",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
... |
# Copyright 2019 FMR LLC <opensource@fidelity.com>
# SPDX-License-Identifer: Apache-2.0
import numpy as np
import torch
from textwiser.base import BaseFeaturizer
from textwiser.utils import convert, OutputType
class _BaseTransformation(BaseFeaturizer):
def __init__(self, wrap_list_input=True):
"""Initia... |
"""
## lambda_detach_blanket_permissions
What it does: For lambda that failed, it check all the policies that grant blanket permissions ('*') to resources and
detach it from the lambda role
Usage: AUTO: lambda_detach_blanket_permissions
Note: The bot will detach the policies that have admin privileges fro... |
"""
DOCSTRING
The models store information on the players and their individual games.
"""
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
Base = declarative_base()
class Player(Base):
"""
A t... |
from django.conf.urls import include, url
from django.contrib import admin
from django.core.exceptions import ImproperlyConfigured
from django_rq.tests import views
from django_rq.urls import urlpatterns
urlpatterns = [
# url(r'^django-rq/', (urlpatterns, '', 'django_rq')),
url(r'^admin/', admin.site.urls),
... |
from django.core.management.base import BaseCommand
from sorl.thumbnail import default
from sorl.thumbnail.images import delete_all_thumbnails
VALID_LABELS = ['cleanup', 'clear', 'clear_delete_referenced', 'clear_delete_all']
class Command(BaseCommand):
help = "Handles thumbnails and key-value store"
missi... |
w=input()
s=0
for c in w:
o=ord(c)
if o%2:
s+=o
print(s) |
# If you dont have requests installed or BeautifulSoup, install them first
# sudo pip install requests
# pip install bs4
import sys
import os
import stdio
import requests
from bs4 import BeautifulSoup
url = str(sys.argv[1])
# Name of directory to store content in.
directory_name = str(sys.argv[2])
# Path to where dir... |
import os
import shutil
import itertools
import configparser
from conans import ConanFile, tools, __version__ as conan_version, RunEnvironment
from conans.errors import ConanInvalidConfiguration
from conans.model import Generator
from conans.tools import Version
class qt(Generator):
@property
def filename(se... |
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Copyright Commvault 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
#
# ... |
# terrascript/provider/null.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:22:59 UTC)
#
# For imports without namespace, e.g.
#
# >>> import terrascript.provider.null
#
# instead of
#
# >>> import terrascript.provider.hashicorp.null
#
# This is only available for 'official' and 'partner' provider... |
### Save this file back as problem_set0.py when you are done
'''
Part 1: Write a function that returns the string "hello, world"
'''
def hello_world():
# Your code here ---
return "hello, world"
# ------------------
|
#!/usr/bin/python3
import requests
import inquirer
import json
import re
def run(token, username):
url = f"https://api.github.com/user/repos?type=owner&per_page=100&sort=full_name"
authorization = f"token {token}"
headers = {
"Accept": "application/vnd.github.v3+json",
"Authorization" : a... |
import numpy as np
import pytest
import torch
from ignite.contrib.handlers.param_scheduler import (
ConcatScheduler,
CosineAnnealingScheduler,
LinearCyclicalScheduler,
LRScheduler,
ParamGroupScheduler,
PiecewiseLinear,
create_lr_scheduler_with_warmup,
)
from ignite.engine import Engine, Eve... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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 witho... |
import os, os.path
from pebl import data, network
from pebl.learner import greedy
def benchmark_datafiles(dir=None):
benchdata_dir = dir or os.path.join(os.path.dirname(__file__), "benchdata")
for filename in (f for f in os.listdir(benchdata_dir) if f.startswith('benchdata.')):
yield os.path.join(bench... |
from typing import Collection, List, Optional, Set, Tuple, Union
from django.db.models.query import QuerySet
from django.utils.timezone import now as timezone_now
from django.utils.translation import gettext as _
from typing_extensions import TypedDict
from zerver.lib.exceptions import (
JsonableError,
Organi... |
import os
import logging
import ast
from env_helper import GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID
from report import ReportColorTheme, create_test_html_report
def process_logs(
s3_client, additional_logs, s3_path_prefix, test_results, with_raw_logs
):
processed_logs = {}
# Firstly convert pa... |
#Import classes from cards
from scrython.cards import Autocomplete
from scrython.cards import Collector
from scrython.cards import Id
from scrython.cards import Mtgo
from scrython.cards import Multiverse
from scrython.cards import Named
from scrython.cards import Random
from scrython.cards import Search
from scrython.c... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
AVClass Generic detect
'''
import sys
import argparse
import subprocess
import os
def main(args):
# Set input switch
itype = '-vt' if args.vt else '-lb'
ifile = args.vt if args.vt else args.lb
# Run avclass_labeler
sys.stderr.write('[-] Running a... |
# 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... |
# This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from datetime import datetime, timedelta
from io import BytesIO
import pytest
from pytz import utc
from ... |
import nltk
from nltk.tokenize import word_tokenize
with open('tmp.txt', 'r') as f:
for textline in f:
sentences = textline.split('. ')
for s in sentences:
poslist = nltk.pos_tag(word_tokenize(s))
print "____________________________"
print s
print "p... |
# Copyright 2022 Sony Semiconductors Israel, 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... |
from params import *
import dbg, util
class DetMapInfo2:
def __init__(self, config, hspace, replica, version):
self.config = config
self.replica = replica
self.hspace = hspace
self.version = version
self._load(config)
def _load(self, config):
nspace = []
... |
# -*- coding: utf-8 -*-
#
# Test documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 7 20:09:23 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... |
from visualization.inputs import Input
class MolproInput(Input):
"""
Input from molpro
"""
input_name = 'Molpro'
output = None
F_BAS = None
def get_output(self):
if self.output is not None:
return self.output
else:
with open(self.input_nam... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@project: AutoXue
@file: __main__.py
@author: kessil
@contact: https://github.com/kessil/AutoXue/
@time: 2019-10-26(星期六) 10:22
@Copyright © 2019. All rights reserved.
"""
import subprocess
from argparse import ArgumentParser
import time
from . import App
from .unit impor... |
from corehq import toggles
from corehq.apps.app_manager.app_schemas.case_properties import (
ParentCasePropertyBuilder,
get_usercase_properties,
)
from corehq.apps.app_manager.const import USERCASE_TYPE
from corehq.apps.app_manager.util import is_usercase_in_use
from corehq.apps.data_dictionary.util import get_... |
a = 'xyzwd'
list_a = list(a)
b = []
for i in range(len(a)):
if i % 2 == 0:
b.append(list_a[i])
print(''.join(b))
|
import unittest
from twelve_step.find_classes.find_classes import find_classes
FILE_BASE_PATH = "./twelve_step/find_classes/test/resources"
IMPORTED_CLASSES = ["C", "D"]
class FindClassesTest(unittest.TestCase):
def test_whenFindingClassesInFile_thenAllClassesAreFound(self):
classes = find_classes(f"{F... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-20 14:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nfn_contests', '0001_initial'),
]
operations = [
migrations.AddField(
... |
import cPickle
import json
import logging
import re
def config():
'''
Get the default configuration.
'''
config = {}
config['model'] = 'RNNsearch' # the NMT model. Only change to "BiRNNsearch" on semi-supervised training
# data
config['src_text'] = '' # source corpus path
config['trg_text'] = '' # target c... |
from math import dist
import requests, json, time
import tkinter as tk
root=tk.Tk()
root.geometry("425x300")
root.title('Tamil Nadu COVID-19 Tracker App')
root['bg']='yellow'
day = str(time.localtime().tm_mday) + '.' + str(time.localtime().tm_mon) + '.' + str(time.localtime().tm_year)
district = tk.StringVar()... |
"""@file parent_class.py
CLMModeling abstract class
"""
import numpy as np
# functions for the 2h term
from scipy.integrate import simps
from scipy.special import jv
from scipy.interpolate import interp1d
from .generic import compute_reduced_shear_from_convergence
import warnings
from .generic import compute_reduced_... |
matches = True
if mat<caret> |
# Copyright 2019,2020,2021 Sony 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-2.0
#
# Unless required by applicable law or agreed... |
import logging
import pandas
import pymysql
from classes.file_query_loader import FileQueryLoader
class MySqlFetcher:
def __init__(self, query_loader=FileQueryLoader()):
self.__db_connection = self.open_connection()
self.data_set = pandas.DataFrame()
self.query_loader = query_loader
... |
from sklearn.ensemble import RandomForestClassifier
import pickle
import base64
import pandas as pd
import numpy as np
import json
from singa_auto.model import BaseModel, IntegerKnob, CategoricalKnob, logger
from singa_auto.model.dev import test_model_class
from singa_auto.constants import ModelDependency
class Rando... |
#!/usr/bin/env python
#
# Copyright 2016 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 requir... |
# Copyright 2014-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2017 Gabbasov Dinar <https://it-projects.info/team/GabbasovDinar>
# Copyright 2018-2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2018 Ildar Nasyrov <https://it-projects.info/team/iledarn>
#... |
import re
import ctypes
import math
from optparse import OptionParser
from Bytewriter import Bytewriter
class Label:
def __init__(self, name):
self.name = name
self.raw_lines = []
def push_line(self, line):
# print(self.name)
tokens = line.split()
# print(tokens)
parser = OptionParser()
(options, args) = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.