text stringlengths 2 999k |
|---|
#%%
# Solution for Qualification, Problem 1, Epigenomic Marks 2
# https://stepik.org/lesson/541851/step/1?unit=535312
#%%
import numpy as np
file = '1'
#file = '2'
with open(file + '.txt', 'rt') as f:
lines = f.readlines()
t = int(lines[0])
i = 1
with open(file + '_result.txt', 'wt') as f:
... |
# Copyright 2018 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
# --------------------------------------------------------------------------
# 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 ... |
########################################
#
# @file rrm2010.py
# @author: Melvin Wong
# @date: Tue Jun 05 10:23:00 2018
#
#######################################
from biogeme import *
from headers import *
from loglikelihood import *
from statistics import *
import numpy as np
#Parameters to be estimat... |
from functools import wraps
import gunicorn.http.wsgi
chdir = "/htdocs/www/src"
bind = "0.0.0.0:8000"
# user = "www-data"
# group = "www-data"
workers = 1
worker_class = "gevent"
graceful_timeout = 60
def wrap_default_headers(func):
@wraps(func)
def default_headers(*args, **kwargs):
return [heade... |
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager, Server
from app import create_app, db
from app.models import User,Pitch,Category,Comment
# instances for the create_app
app = create_app('production')
manager = Manager(app)
manager.add_command('server', Server)
migrate = Migrate(a... |
from PyQt5.Qt import QMainWindow, QAction, QFileDialog, QIcon, QProgressBar, QPushButton, QTabWidget, QTableView
from util.mm_base import MMBase
from .mm_mainwidget import MMMainWidget
from .mm_dialogs import MMAddNewAccountTypeDialog
class MMMainWindow(QMainWindow, MMBase):
"""
Main Window
"""
def __... |
from django.urls import path
from . import views
urlpatterns = [
path('categories/', views.ListCategoryView.as_view(), name="course_categories"),
path('<int:pk>/', views.CourseDetailView.as_view(), name="detail_course"),
path('', views.CourseView.as_view())
]
|
# !/usr/bin/python3
# coding: utf_8
""" API client to fetch data using Cryptocompare endpoints """
import urllib.parse
from datetime import datetime
from pyhodl.api.models import TorApiClient
from pyhodl.api.price.models import PricesApiClient
from pyhodl.config import NAN, SECONDS_IN_MIN
from pyhodl.data.coins imp... |
import torch
import kornia
import torch.nn as nn
import torchvision.models as models
vgg_model = models.vgg16(pretrained=True)
for param in vgg_model.features.parameters():
param.requires_grad = False
if torch.cuda.is_available():
vgg_model.cuda()
class LossModel(nn.Module):
def __init__(self):
s... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-10-10 16:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('applications', '0024_auto_20190720_0127'),
]
operations = [
migrations.Alt... |
# -------------------------------------------------------
# CSCI 561, Spring 2021
# Homework 3
# Author: Joseph Ko
# Unification algorithm from AIMA textbook
# -------------------------------------------------------
def unify(x, y, theta):
"""
Input:
x = variable, constant, or list of parameters
y ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=C0321,C0103,C0301,E1101,C0303,E1004,C0330,R0915,R0914,W0703,C0326
# Disable many annoying pylint messages, warning me about variable naming for example.
# yes, in my Solr code I'm caught between two worlds of snake_case and camelCase.
"""
OPAS - opasSolr... |
# Copyright (c) 2016-2018, Neil Booth
# Copyright (c) 2021-2022, Oleksandr
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Classes for local RPC server and remote client TCP/SSL servers.'''
import asyncio
import codecs
import datetime
im... |
'''
.d8888b. 888 888 888 8888888 888
d88P Y88b 888 888 888 888 888
888 888 888 888 888 888 ... |
import json
import os
import requests
from FIREX.utils import admin_cmd, edit_or_reply, sudo_cmd
from userbot.cmdhelp import CmdHelp
def ocr_space_file(
filename, overlay=False, api_key=Config.OCR_SPACE_API_KEY, language="eng"
):
"""OCR.space API request with local file.
Python3.5 - not tested on 2.... |
import pandas as pd
import numpy as np
import pickle
from math import *
from scipy.optimize import fsolve
import multiprocessing as mp
from joblib import Parallel, delayed
import proplot as pplt
import random
import itertools
from itertools import product
import scipy.integrate as integrate
import scipy.special as spec... |
import pytest
import sys
import os
os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../test_sentinel.conf'))
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../../lib')))
import cadexlib
import gobject_json
# old format proposal hex w/multi-dimensiona... |
import sys
import h5py
import numpy as np
w = h5py.File(sys.argv[-1], 'w')
freq_tot = np.zeros((512 * 512, 1024), dtype='uint32')
for idx, filename in enumerate(sys.argv[1:-1]):
f = h5py.File(filename, 'r')
freq_chunk = f['freq_tot'][()]
freq_tot += freq_chunk
f.close()
w.create_dataset('freq_tot'... |
# coding=utf-8
# Copyright 2019 The Authors of RL Reliability Metrics.
#
# 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 django.conf.urls import url
from django.urls import path,include
from profile_api import views
from rest_framework.routers import DefaultRouter
router=DefaultRouter()
router.register('hello-viewset',views.HelloViewSet,base_name='hello-viewset')
router.register('profile',views.UserProfileViewSet)
router.register(... |
from typing import Callable, List, Union, Set, Tuple, Any
class DecisionTreeTable:
"""An table-like object created from a parsed collection of sklearn decision trees,
which has first been exported as text to a file, and then transformed to
a list of lines consisting of discrete elements."""
source: Li... |
from pandana.core.tables import Tables
class Loader:
"""A class for accessing data in h5py files."""
def __init__(self, files, idcol, main_table_name, indices):
self._files = files
self._idcol = idcol
self._main_table_name = main_table_name
self._indices = indices
sel... |
# document_grid.py
#
# MIT License
#
# Copyright (c) 2020-2021 Andrey Maksimov <meamka@ya.ru>
#
# 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 limitati... |
# coding=utf-8
import json
import urllib
import urllib2
fit_url = 'http://127.0.0.1:8000/fit/'
fit_trend_url = 'http://127.0.0.1:8000/fit/trend/'
better_hp_trend_url = 'http://127.0.0.1:8000/fit/trend/'
hp2trend_url = 'http://127.0.0.1:8000/hp2trend/'
half_trend_url = 'http://127.0.0.1:8000/half_trend/'
fit2_url = 'h... |
# -*- coding: utf-8 -*-
import os
import sys
import logging
from . import find_infected, remove_infected
if __name__ == '__main__':
args = sys.argv
if (len(args) < 3):
raise ValueError('Please supply the action (find or remove) and the directory ex: python -m eval_scrubber find /home/username')
a... |
from . import convert
from . import label
from . import otoini
from . import table
from . import ust
|
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/9/12
# @Author : MashiroF
# @File : DailyCash.py
# @Software: PyCharm
'''
cron: 30 5,12 * * * DailyCash.py
new Env('欢太每日现金');
'''
import os
import re
import sys
import time
import random
import logging
# 日志模块
logger = logging.... |
# -*- coding: utf-8 -*-
#
from __future__ import print_function
import codecs
import re
import pybtex
import pybtex.database
import requests
import requests_cache
from .__about__ import __version__, __website__, __author_email__
from .errors import NotFoundError, HttpError
from .tools import pybtex_to_dict, heuristi... |
# -*- coding: utf-8 -*-
"""Predicate functions that return boolean evaluations of objects.
.. versionadded:: 2.0.0
"""
from __future__ import absolute_import
import datetime
from itertools import islice
import json
import operator
import re
from types import BuiltinFunctionType
import pydash as pyd
from .helpers im... |
from typing import List
# dfs,会超时
class Solution:
def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:
map = {}
for i in prerequisites:
res = map.get(i[0])
if res is None:
temp = set()
temp.add(i[1])
... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
"""3. 将列表中的数字累减
list02 = [5, 1, 4, 6, 7, 4, 6, 8, 5]
提示:初始为第一个元素"""
list02 = [5, 1, 4, 6, 7, 4, 6, 8, 5]
start=list02[0]
for i in list02[1:len(list02)]:
start-=int(i)
print(start)
|
# Copyright 2015 Red Hat, 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 ... |
import logging
import os
from datetime import datetime
import pytest
from funcy import first
from dvc.exceptions import InvalidArgumentError
from dvc.main import main
from dvc.repo.experiments.base import ExpRefInfo
from dvc.utils.serialize import dump_yaml
from tests.func.test_repro_multistage import COPY_SCRIPT
d... |
from .codec import Codec
from .jadn import jadn_check, jadn_load, jadn_loads, jadn_dump, jadn_analyze
__all__ = [
'Codec',
'jadn_check',
'jadn_load',
'jadn_loads',
'jadn_dump',
'jadn_analyze'
]
|
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... |
from COVID_DataProcessor.datatype import Country, PreprocessInfo, PreType
from COVID_DataProcessor.io import load_links, load_population, load_origin_data
from COVID_DataProcessor.io import save_preprocessed_dict, save_setting, save_sird_dict
from COVID_DataProcessor.util import get_period, generate_dataframe
from date... |
import numpy as np
from .element_counts import element_counts
def nominal_oxidation_state(msTuple):
"""
Docstring for function pyKrev.nominal_oxidation_state
====================
This function takes an msTuple and returns the nominal oxidatate state of C.
Use
----
nominal_oxidation_state(Y)
Return... |
#
# This is an extension to the Nautilus file manager to allow better
# integration with the Subversion source control system.
#
# Copyright (C) 2006-2008 by Jason Field <jason@jasonfield.com>
# Copyright (C) 2007-2008 by Bruce van der Kooij <brucevdkooij@gmail.com>
# Copyright (C) 2008-2010 by Adam Plumb <adamplumb@gm... |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... |
import numpy as np
import os, logging
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
logging.getLogger("tensorflow").setLevel(logging.CRITICAL)
logging.getLogger("tensorflow_hub").setLevel(logging.CRITICAL)
import keras as K
import copy
class AttentionLSTM_keras(object):
""" Attention LSTM implementation using keras """... |
#### Servers that can't get Nuked ####
565606530230124589 #Gamingstübchen
681137719287742531 #Gaming Crew Pc |
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.core.files import File
from django.core.files.base import ContentFile
from django.db import transaction
from django.template import Context, Template
from django.test import TestCase, TransactionTestCase, override_se... |
import re
from bs4 import BeautifulSoup
from .path import iGEM_URL
# process HTML files
def HTMLparser(config: dict, path, contents: str, upload_map: dict) -> str:
"""
Parses a given HTML string using bs4 and
converts relative paths to absolute iGEM URLs.
Arguments:
config: dictionary cont... |
"""
mock webhook payload and send it to an existing packit service
"""
import pytest
import requests
@pytest.mark.skip
def test_prop_update_on_packit_020():
url = "http://localhost:5000/webhooks/github/release"
payload = {
"repository": {
"name": "packit",
"html_url": "https://... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Timothy Vandenbrande <timothy.vandenbrande@gmail.com>
# Copyright: (c) 2017, Artem Zinenko <zinenkoartem@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r'''
---
module: win_firewal... |
# 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... |
import pandas as pd
import numpy as np
list_values = np.random.rand(6)
list_index = [[1,1,1,2,2,2], ['a', 'b', 'c', 'a', 'b', 'c']]
series = pd.Series(list_values, index=list_index)
first = series[1]
dataframe = series.unstack()
print(dataframe)
list_values = np.arange(16).reshape(4,4)
print(list_values)... |
# Copyright (C) 2017 Nippon Telegraph and Telephone 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 appli... |
def eightqueen(data):
print(data)
pass
|
# Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft 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 b... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import sys
import time
import numpy as np
import tensorflow as tf
from google.protobuf import text_format
from tensorflow.python.platform import app
from delf import aggregation_conf... |
# coding: utf8
from unittest import mock
import zeit.cms.browser.interfaces
import zeit.cms.repository.browser.repository
import zeit.cms.testing
import zope.publisher.browser
class TestTree(zeit.cms.testing.SeleniumTestCase):
layer = zeit.cms.testing.WEBDRIVER_LAYER
def test_tree_keeps_state(self):
... |
import sconlite
res = sconlite.loads(open('test.sco','r').read())
print(res.data,res.comments) |
# Copyright 2012 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 by applicable law or ... |
"""Folder which holds framework scripts.
When uploading pywikibot to pypi the pwb.py (wrapper script) and
pywikibot i18n package are copied here.
.. versionadded:: 7.0
"""
from os import environ, getenv
def _import_with_no_user_config(*import_args: str):
"""Return __import__(*import_args) without loading user-c... |
# -*- coding: utf-8 -*-
import heapq # used for the so colled "open list" that stores known nodes
from pathfinding.core.heuristic import manhattan, octile
from pathfinding.core.util import backtrace, bi_backtrace
from pathfinding.core.diagonal_movement import DiagonalMovement
from .finder import Finder, TIME_LIMIT, MA... |
#!/bin/python3
import sys
from collections import Counter
def lonelyinteger(a):
# Complete this function
counts = Counter(a)
for element, count in counts.items():
if count == 1:
return element
n = int(input().strip())
a = list(map(int, input().strip().split(' ')))
result = lonelyinteg... |
from setuptools import find_packages, setup
setup(
name='ems-cli',
version='0.1.0b1',
packages=find_packages(),
url='https://github.com/tomi77/ems-cli',
license='MIT',
author='Tomasz Jakub Rup',
author_email='tomasz.rup@gmail.com',
install_requires=[
'pyems >= 0.1.2',
],
... |
import data_feeder
import trainer4
import net
import dcgan2
import tensorflow as tf
import os
#mnist_config = {'data_shape':[28, 28, 1],
# 'noise_shape':[1, 1, 100],
# 'data_path':os.path.normpath('D:/dataset/mnist/train-images.idx3-ubyte'),
# 'epoch':100,
# ... |
# 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... |
import xml.etree.ElementTree
from pyrevolve.revolve_bot.brain import Brain
class FixedAngleBrain(Brain):
TYPE = 'fixed-angle'
def __init__(self, angle: float):
self._angle = angle
@staticmethod
def from_yaml(yaml_object):
return FixedAngleBrain(float(yaml_object['angle']))
def t... |
import concurrent.futures
import os
import pickle
import sys
from functools import partial
from pathlib import Path
from typing import Callable, List, Tuple
import librosa
import librosa.display
import numpy as np
from omegaconf import OmegaConf, DictConfig
from tqdm.auto import tqdm
def parallel(func: Callable, arr... |
from app.tasks.highlight import syntax_highlight
from re import findall
from app.tasks.markdown import render_markdown as markdown_renderer
def highlight_answer(answer):
lang = answer.get_language()
return syntax_highlight.delay(answer.code, lang.get_hljs_id(), lang.get_id()).wait()
def render_markdown(markd... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2020 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This soft... |
import re
import numpy as nm
from base import Struct, IndexedStruct, dict_to_struct, pause, output, copy,\
import_file, assert_, get_default
from reader import Reader
_required = ['filename_mesh', 'field_[0-9]+|fields',
'ebc_[0-9]+|ebcs', 'equations',
'region_[0-9]+|regions', 'variable_... |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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 rights to use, copy, modify, merg... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v6/services/campaign_shared_set_service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'annotation_tool.settings')
try:
from django.core.management import execute_from_command_line
exc... |
# coding=utf-8
# Copyright 2020 The Facebook AI Research Team Authors and The HuggingFace Inc. team.
#
# 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/LIC... |
"""
This module implements WSGI related helpers adapted from ``werkzeug.wsgi``
:copyright: (c) 2010 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from elasticapm.utils import compat
try:
from urllib import quote
except ImportError:
from urllib.parse impor... |
import inspect
from importlib import import_module
from typing import Callable
from django.apps import apps
from django.utils.module_loading import module_has_submodule
def get_app_modules():
"""
Generator function that yields a module object for each installed app
yields tuples of (app_name, module)
... |
# 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... |
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
# SPDX-License-Identifier: Apache-2.0
# Copyright © 2021 Intel Corporation
"""Helpers for strict type checking."""
import typing as T
from .. import compilers
from ..build import EnvironmentVariables, CustomTarget, BuildTarget, CustomTargetIndex, ExtractedObjects, GeneratedList
from ..coredata import UserFeatureOpti... |
# flake8: noqa
# DEV: Skip linting, we lint with Python 2, we'll get SyntaxErrors from `async`
# stdlib
import asyncio
# 3p
import aiopg
# project
from ddtrace.contrib.aiopg.patch import patch, unpatch
from ddtrace import Pin
# testing
from tests.contrib.config import POSTGRES_CONFIG
from tests.contrib.asyncio.utils... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from rest_framework.response import Response
from sentry.api.serializers import serialize
from sentry.exceptions import PluginError
from sentry.models import Repository
from sentry.plugins.config import ConfigValidator
from .base imp... |
from operator_api import crypto
from operator_api.crypto import hex_value
from operator_api.merkle_tree import normalize_size, calculate_merkle_proof
from operator_api.util import ZERO_CHECKSUM
class TokenMerkleTree:
def __init__(self, token_commitments):
self.tokens = normalize_tokens(token_commitments)
... |
# Copyright (c) 2016 Red Hat, 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 a... |
# -*- coding: utf-8 -*-
import time
import os
import math
import argparse
from glob import glob
from collections import OrderedDict
import random
import warnings
from datetime import datetime
import numpy as np
from tqdm import tqdm
from sklearn.model_selection import train_test_split
from skimage.io import imread
... |
# -*- coding: utf-8 -*-
# coding: utf-8
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
from shutil import rmtree
from tempfile import mkdtemp
from nipype.testing import (assert_equal, assert_raises, skipif,
assert... |
import datetime
import json
import os
from datetime import timedelta
from decimal import Decimal
from unittest import mock
from bs4 import BeautifulSoup
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from django.utils.timezone import now
... |
class Cell:
def __init__(self, arg):
self.arg = arg
def to_string(self):
if isinstance(self.arg, list):
v = "\n".join([f"'{el}'" for el in self.arg])
else:
v = self.arg
return v
class NestedCell(Cell):
def __str__(self):
return "{{%s}}" % se... |
"""
Functions for plotting polyhedra
"""
########################################################################
# Copyright (C) 2008 Marshall Hampton <hamptonio@gmail.com>
# Copyright (C) 2011 Volker Braun <vbraun.name@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
#
... |
import pyperclip, sys, pageReader, pdfConverter
if len(sys.argv) > 1:
term = ' '.join(sys.argv[1:])
else:
term = pyperclip.paste()
cha = input("And the chapter?")
c = cha.split()
url = 'http://mangakakalot.com/search/' + "_".join(term.split()) # starting url
#print(url)
sell2 = '.item... |
from django.contrib import admin
from especialidade.models import Especialidade
class EspecialidadeAdmin(admin.ModelAdmin):
list_display = ('nome',)
search_fields = ['nome']
fields = ['nome']
admin.site.register(Especialidade, EspecialidadeAdmin)
|
# -*- coding: utf-8 -*-
"""
Created on 14 Apr 2020 01:00:52
@author: jiahuei
"""
import os
import pandas as pd
pjoin = os.path.join
data_root = pjoin('/mol_data', 'DeepAffinity')
pair_files = ['EC50_protein_compound_pair.tsv',
'IC50_protein_compound_pair.tsv',
'Kd_protein_compound_pair.ts... |
class Member():
@property
def game(self):
game = str(self.activities[0])
game = game.lower()
check = game
if 'minecraft' in game:
game = '<:Minecraft:516401572755013639> Minecraft'
if 'hyperium' in game:
game = '<:Hyperium:516401570741485573> Hype... |
from itertools import combinations, groupby
import csv
import os
import time
import optparse
import logging
import dedupe
import exampleIO
def canonicalImport(filename):
preProcess = exampleIO.preProcess
data_d = {}
with open(filename) as f:
reader = csv.DictReader(f)
for (i, row) in e... |
class Node:
def __init__(self, value):
self.value = value
self.next = None
class Queue:
def __init__(self, value):
new_node = Node(value)
self.first = new_node
self.last = new_node
self.length = 1
def enqueue(self, value):
new_node = Node(valu... |
# -*- coding: utf-8 -*-
import json
import re
import datetime
import os
from io import open
import urllib2
import cPickle
from bs4 import BeautifulSoup, UnicodeDammit
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
import glob
from scipy import uni... |
#!/usr/bin/env python
# coding=utf-8
"""
This is a script for downloading and converting the microsoft coco dataset
from mscoco.org. This can be run as an independent executable to download
the dataset or be imported by scripts used for larger experiments.
"""
from __future__ import division, print_function, unicode_li... |
"""
Tests that TSan and LLDB have correct thread numbers.
"""
import os
import time
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
import lldbsuite.test.lldbutil as lldbutil
import json
class TsanThreadNumbersTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)... |
#!/usr/bin/env python
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
# db_populate_departments.py
"""load data for departments table"""
from db_test import create_connection, execute_query
# departments data
load_departments = """
INSERT INTO departments (department_number, department_name)
VALUES
(250, "Sales - APAC - Australia"),
(200, "Sales - North America"),
(300, "... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/framework/formats/location_data.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.pr... |
"""Resume URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... |
from discord.ext import commands
class SubscriberCommands:
"""Handles Subscriber commands for live updates"""
def __init__(self, cmd_function):
self.cmd_function = cmd_function
@commands.command(name='sub', pass_context=True)
async def subscribe(self, ctx, fiat='USD'):
"""
Su... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.