text
string
size
int64
token_count
int64
'''This module implements the Zawinksi threading algorithm. https://www.jwz.org/doc/threading.html The main function is process(), which takes a queryset, ie. all messages in a list, and returns the root_node of a container tree representing the thread. Use root_node.walk() to walk the container tree. NOTE: There ar...
20,940
5,479
from flask import Flask app = Flask(__name__) @app.route('/') def index(): i = 0 return str(i)
105
42
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Manuel Francisco Naranjo <manuel at aircable dot net> # # 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....
2,942
1,009
# coding: utf-8 from flask import Flask from flask_babel import Babel from flask_bootstrap import Bootstrap app = Flask(__name__) app.config.from_pyfile('application.cfg') app.secret_key = '_\xeb\xaa9\xea\xb9&\xe8\xdfx\xd4oKu\x01\xf3\x94d\x08\xdeGs\x11<' #TODO get if from config babel = Babel(app) Bootstrap(app) ...
370
154
from __future__ import annotations from unittest import TestCase from enum import Enum from typing import Dict, Iterable, Optional, Set, List from jsonschema import validate as validate_json from nrf5_cmake.property import Access, Property from nrf5_cmake.version import Version class LibraryProperty(Enum): DEPE...
10,039
2,813
# Generated by Django 2.0.7 on 2018-08-26 13:28 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0006_parametros'), ] operations = [ migrations.CreateModel( name='MovRotativo', ...
1,149
350
import dataclasses import json import dataclasses_json def get_encode_config(): return dataclasses.field( metadata=dataclasses_json.config( encoder=lambda lst: sorted(lst, key=json.dumps, reverse=False) ) )
246
73
# Copyright 2008-2018 Univa 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 to in...
2,069
659
"""Reject observations based on PDOP, which is based on estimated covariance matrix of unknowns Description: ------------ Identifies observations from the dataset with PDOP greater than a configured limit. """ # External library imports import numpy as np # Midgard imports from midgard.dev import plugins # Where i...
1,022
319
import pygame, time from pygame.constants import QUIT, WINDOWCLOSE #from src import * win = pygame.display.set_mode([800,600], 16) pygame.init() quitcount = 0 while True: win.fill([200, 200, 200]) for event in pygame.event.get(): if event.type in ( #pygame.QUIT, #pygame.WINDOWCL...
1,248
491
# Generated by Django 3.1.7 on 2021-03-16 20:08 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('homepage', '0008_auto_20210316_0229'), ] operations = [ migrations.AlterField( model_name='insulin', name='dosage', ...
376
140
# # Copyright (C) 2016-2020 by Ihor E. Novikov # Copyright (C) 2020 by Krzysztof Broński # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License # as published by the Free Software Foundation, either version 3 # of the License, or (at ...
4,838
1,744
#!/usr/bin/python # -*- coding: utf-8 -*- import os import logging from threading import Thread from pogom import config from pogom.app import Pogom from pogom.utils import get_args, insert_mock_data, load_credentials from pogom.search import search_loop from pogom.models import create_tables, Pokemon from pogom.pgo...
2,137
763
import re from multiprocessing.pool import Pool from pathlib import Path from typing import Union import numpy as np import pandas as pd from google.cloud import storage from feature.plot.to_images import PlotWriter from utils.data.eegdataloader import EegDataLoader gs_client = storage.Client() LABEL_FILE_NAME = "ev...
3,695
1,223
# Volatility # # Authors: # Mike Auty <mike.auty@gmail.com> # # This file is part of Volatility. # # Volatility 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 op...
1,244
376
from thundra.application.application_info_provider import ApplicationInfoProvider from thundra.config import config_names from thundra.config.config_provider import ConfigProvider def test_if_can_get_integer_tag(): tag_name = 'integerField' (env_key, env_val) = (config_names.THUNDRA_APPLICATION_TAG_PREFIX + t...
1,471
504
corner_tuples = ( (1, 26, 105), (5, 101, 80), (21, 51, 30), (25, 76, 55), (126, 50, 71), (130, 75, 96), (146, 125, 46), (150, 100, 121), ) edge_orbit_id = { 2: 0, 3: 1, 4: 0, 6: 0, 11: 1, 16: 0, 10: 0, 15: 1, 20: 0, 22: 0, 23: 1, 24: 0, #...
54,161
37,141
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import colorful.fields class Migration(migrations.Migration): dependencies = [ ('icekit_events', '0017_eventtype_color'), ] operations = [ migrations.AlterField( model_na...
697
331
from odoo import api, fields, models class SalaryInfo(models.Model): _name = 'salary.info' _rec_name = 'salary' name = fields.Many2one(comodel_name='staff.info') staff_type = fields.Selection([('std_1', 'teaching'), ('std_2', 'account'), ...
566
174
from django.db import models class Account(models.Model): """ Account for or """ name = models.CharField(pgettext_lazy( "Name of Account", "Name"), max_length=64) email = models.EmailField() phone = PhoneNumberField(null=True) industry = models.CharField( _("Industry Type"), ...
1,217
393
from pypge.benchmarks import explicit import numpy as np # visualization libraries import matplotlib.pyplot as plt # Set your output directories img_dir = "../img/explicit/" data_dir = "../benchmarks/explicit/" names = [ "koza_01", "koza_02", "koza_03", "lipson_01", "lipson_02", "lipson_03", "nguyen_01", ...
2,318
1,081
from os import mkdir from pathlib import Path from shutil import rmtree from zipfile import ZipFile, ZIP_DEFLATED # Get the root path to this repo repo_dir = Path(__file__).parent # Get the kit directory kit_dir = repo_dir / "test_kit" # Get the build directory build_dir = repo_dir / "build" # Get the license file lic...
1,193
412
########################################################################### # # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/l...
4,557
1,291
import uuid from django.db import models from cortaswamp import enums from django.contrib.auth.models import AbstractBaseUser, UserManager from django.contrib.postgres.fields import JSONField class UserAccountManager(UserManager): def get_by_natural_key(self, username): """ To match against case i...
1,965
595
import os, json CONFIG_PATH = os.path.expanduser('~') + os.sep + '.tweetsender_config.json' def load_config(path): if not os.path.exists(path): return {} with open(path, 'r') as f: config = json.load(f) return config def update_config(config, path): with open(path, 'w') as f: ...
341
122
def start_message(): return f"* Welcome to Funboy Joker bot! *\n" \ f"\n" \ f"*DISCLAIMER:*\n" \ f"This is a research experiment aiming to improve computer-generated humour. \n" \ f"It may contain offensive language! \n" \ f"This bot will ask you to rate autom...
619
185
from .Cache import * from .Utils import *
42
13
from utils.http import HTTP class YuShuBook: isbn_url = 'http://t.yushu.im/v2/book/isbn/{}' keyword_url = 'http://t.yushu.im/v2/book/search?q={}&count={}&start={}' @classmethod def search_by_isbn(cls, isbn): url = YuShuBook.isbn_url.format(isbn) result = HTTP.get(url) # dict j...
539
201
#------------------------------------------------------------------------------ # Copyright 2013 Esri # 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/LICENS...
2,724
828
import datetime import math import django from py3njection import inject from learn.infrastructure.configuration import LearnConfiguration from learn.learn_base_settings import available_settings @inject def compute_next_repetition(successes, conf: LearnConfiguration): next_repetition_delta = float(conf.get_con...
623
171
# Generated by Django 3.1.8 on 2021-06-15 08:51 from django.db import migrations def fix_unknown_pub_types(apps, schema_editor): Title = apps.get_model('publications', 'Title') Title.objects.filter(pub_type='U', issn='', eissn='').exclude(isbn='').update(pub_type='B') Title.objects.filter(pub_type='U', i...
632
235
from .core import * __all__ = ["Operator", "LambdaOperator", "TransformerOperator", "Normalize", "FillMissing", "Vocab", "Categorize", "ToTensor", "UnknownCategoryError", ]
196
59
from tensorflow.python.keras.layers import Lambda, Convolution2D, BatchNormalization, Flatten, Dense, Cropping2D from tensorflow.python.keras.models import Sequential from tensorflow.python.keras.optimizers import Adam from trainer.util import normalize, resize def model(): m = Sequential() m.add(Convolutio...
1,358
521
import functools import logging import time from typing import Optional from django.conf import settings from django.db import transaction from pymongo.errors import DuplicateKeyError from node.core.database import get_database from node.core.exceptions import BlockchainIsNotLockedError, BlockchainLockingError, Block...
3,292
926
def GeneralPattern(args): args.path = "~/Downloads/dataset/ocr" # this will create a folder named "_text_detection" under "~/Pictures/dataset/ocr" args.code_name = "_text_detection" # Set it to True to make experiment result reproducible args.deterministic_train = False args.cudnn_benchmark = Fa...
1,272
465
# coding=utf-8 # Copyright 2020 George Mihaila. # # 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...
5,243
1,439
#!/usr/bin/env python # -*- coding: utf-8 -*- import timeit import ssl from urllib.request import Request, urlopen class Timer(object): def __init__(self, verbose=False): self.verbose = verbose self.timer = timeit.default_timer def __enter__(self): self.start = timeit.default_timer()...
1,027
349
def up(cursor, bot): cursor.execute( """ CREATE MATERIALIZED VIEW user_rank AS ( SELECT id as user_id, RANK() OVER (ORDER BY points DESC) points_rank, RANK() OVER (ORDER BY num_lines DESC) num_lines_rank FROM "user" ) """ ) cursor.execu...
368
121
from lib.external.PluginManager import PluginInterface, Manager from prettytable import PrettyTable from aayudh import utils, fileutils import sys import os current_dir = os.path.abspath(os.path.dirname(__file__)) root_dir = os.path.normpath(os.path.join(current_dir, "..")) sys.path.insert(0, root_dir) class pcaps...
9,594
3,299
"""Provides basis translators for SMEFT and and WET that can be used with the `wcxf` Python package.""" from . import smeft, smeft_higgs from . import wet from wilson import wcxf @wcxf.translator('SMEFT', 'Higgs-Warsaw up', 'Warsaw up') def higgs_up_to_warsaw_up(C, scale, parameters, sectors=None): return smeft...
5,321
2,357
# -*- coding: UTF-8 -*- # # copyright: 2020-2022, Frederico Martins # author: Frederico Martins <http://github.com/fscm> # license: SPDX-License-Identifier: MIT """Tests for the Nakfa currency representation(s).""" from decimal import Context from pytest import raises from multicurrency import Currency from multicurr...
7,928
2,449
# vim:fileencoding=utf-8 # License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net> from __python__ import hash_literals from ast import ( AST_Definitions, AST_Scope, AST_Method, AST_Except, AST_EmptyStatement, AST_Statement, AST_Seq, AST_BaseCall, AST_Dot, AST_Sub, AST_ItemAccess, AST_Condition...
6,314
1,962
import logging import os from dotenv import load_dotenv import sentry_sdk from sentry_sdk.integrations.asgi import SentryAsgiMiddleware from sentry_sdk.integrations.logging import ignore_logger from typing import Optional import helpers import helpers.content as content import helpers.entities as entities from helpers...
3,443
995
from bs4 import BeautifulSoup import requests def songs_info(res): soup = BeautifulSoup(res.text, 'lxml') data = soup.find('ol', {'class': 'content-list'}) return data def get_songs(data, limit=10): song_list = [] count = 0 for i, count in zip(data.find_all('div', {'class': 'details'}), ran...
1,319
526
################################################################################ # # MRC FGU Computational Genomics Group # # $Id$ # # Copyright (C) 2009 Andreas Heger # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as publish...
17,457
5,272
#coding:utf-8 from django.db import models from django.contrib.auth.models import User class ActivateCode(models.Model): owner = models.ForeignKey(User, verbose_name="用户") code = models.CharField(verbose_name="激活码", max_length=100) expire_timestamp = models.DateTimeField() create_time = models.DateTimeField(auto...
386
133
#! /usr/bin/env python # Copyright (c) 2016 Zielezinski A, combio.pl import argparse import sys from alfpy import word_distance from alfpy import word_pattern from alfpy import word_vector from alfpy.utils import distmatrix from alfpy.utils import seqrecords from alfpy.version import __version__ def get_parser(): ...
6,735
2,061
# Fazer com que o interpretador leia duas notas de um aluno, calcule e mostre a sua média. n1 = float(input('\nDigite a primeira nota: ')) n2 = float(input('Digite a segunda nota: ')) media = (n1 + n2) / 2 print('\nA primeira nota é: {:.1f}.'.format(n1)) print('A segunda nota é: {:.1f}.'.format(n2)) print('Portanto, s...
357
143
# coding: utf-8 # TODO: check full mapping of one enum to another (is every value of mapped enum has pair and vice versa) # TODO: pep8 # TODO: pylint # TODO: generate docs # TODO: rewrite exceptions texts & rename exception classes import random from rels import exceptions class Column(object): __slots__ = ('_cr...
9,712
2,623
import numpy as np import zipfile from io import StringIO import os import json import pandas as pd import transformations as tr from multiprocess import Pool import plotly import plotly.graph_objs as go from dd_pose.dataset_item import DatasetItem, StampedTransforms # a coordinate frame which allows for identity tr...
18,770
6,467
import os import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import tensorflow.keras.backend as K from models import load_model, load_adfmodel from PIL import Image # GENERAL PARAMETERS MODE = 'diag' # 'diag', 'half', or 'full' # LOAD MODEL print(os.getcwd()) adfmodel = load...
1,376
649
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 29 20:03:22 2018 @author: gauravpant """ import numpy as np import pandas as pd df=pd.read_csv('data/responses.csv', sep=',',header=0) #f = open('data/responses.csv') #csv_f = csv.reader(f) # #headers = [] #data = [] # # #for i, row in enumerate(...
2,210
891
from src.switchbox import * from src.point import * from src.netcrackerformat import * from src.sbhelper import * from src.direction import * from src.logger import * from src.analysis.posBasedFilter import * from src.analysis.analysispass import * from src.analysis.directionAnalysis import * # =====================...
3,388
1,045
from lib.base import BaseJiraAction from lib.formatters import to_project_dict __all__ = [ 'GetJiraProjectComponentsAction' ] class GetJiraProjectComponentsAction(BaseJiraAction): def run(self, project_key): projects = self._client.project_components(project_key) print(projects) results = [] for project...
422
143
#included from https://github.com/sysopfb/brieflz import os from ctypes import * import binascii import zlib import struct CURR_DIR = os.path.abspath(os.path.dirname(__file__)) LIB_PATH = os.path.join(CURR_DIR, 'blzpack_lib.so') brieflz = cdll.LoadLibrary(LIB_PATH) DEFAULT_BLOCK_SIZE = 1024 * 1024 def compress_dat...
2,773
1,000
#!/usr/bin/env python3 # Copyright 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """DrQA Document Reader model""" import math import random import ipdb import torch import torch.optim as opt...
27,897
8,193
# Generated by Django 4.0.1 on 2022-01-10 09:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('firstApp', '0005_alter_registration_firstname'), ] operations = [ migrations.AlterField( model_name='registration', ...
414
140
from pathlib import Path import pandas as pd import numpy as np import logging #patching import unittest try: # python 3.4+ should use builtin unittest.mock not mock package from unittest.mock import patch except ImportError: from mock import patch #app import methylcheck import methylprep TESTPATH = 'te...
10,385
5,263
""" The Yahoo finance component. https://github.com/iprak/yahoofinance """ from datetime import timedelta import logging from typing import Union import async_timeout from homeassistant.const import CONF_SCAN_INTERVAL from homeassistant.helpers import discovery from homeassistant.helpers.aiohttp_client import async_...
8,261
2,500
# Desafio 109: Modifique as funções que form criadas no desafio 107 para que # elas aceitem um parâmetro a mais, informando se o valor retornado por elas # vai ser ou não formatado pela função moeda(), desenvolvida no desafio 108. from rotinas import titulo from modulos.ex109 import moeda as m valor = int(input('Dig...
651
279
import json import tempfile from acrcloud.recognizer import ACRCloudRecognizeType from acrcloud.recognizer import ACRCloudRecognizer from mod_track_search.bean import get_track_id from model.Track import Track def get_tracks_from_audio(file): response = ({}, 404) if file is None or file == '': print...
2,485
774
from freezegun import freeze_time from salesforce_timecard.core import TimecardEntry import pytest import json @freeze_time("2020-9-18") @pytest.mark.vcr() @pytest.mark.block_network def test_delete_timecard(): te = TimecardEntry("tests/fixtures/cfg_user_password.json") rs = te.list_timecard(False, "2020-09-1...
460
202
__author__ = 'Ahmed Hani Ibrahim' import abc class LearningAlgorithm(object): # __metaclass__ = abc.ABCMeta @abc.abstractmethod def learn(self, learningRate, input, output, network): """ :param learningRate: double :param input: list :param output: list :param netwo...
390
117
from datetime import datetime, timedelta, timezone from typing import Optional from fastapi import (APIRouter, Depends, HTTPException, Request, Response, status) from jose import JWTError, jwt from sqlalchemy.orm import Session from app.api.deps import get_current_user, get_db from app.api.utils ...
4,359
1,403
""" 58. Length of Last Word """ class Solution: def lengthOfLastWord(self, s): """ :type s: str :rtype: int """ li = s.split() return len(li[-1]) if li else 0
222
82
import torch from torch_geometric.data import Data from torch_geometric.transforms import BaseTransform from torch_geometric.utils import to_networkx, from_networkx import networkx as nx import numpy as np from federatedscope.core.configs.config import global_cfg class HideGraph(BaseTransform): r""" Genera...
5,201
1,625
#!/usr/bin/env python # William Lam # www.virtuallyghetto.com """ vSphere Python SDK program for updating ESXi Advanced Settings Usage: python update_esxi_advanced_settings.py -s 192.168.1.200 \ -u 'administrator@vsphere.local' \ -p VMware1! -c VSAN-Cluster -k VSAN.ClomRepairDelay -v 120 """ import argpa...
4,259
1,130
from adversarials.adversarial_utils import * from adversarials import attacker from src.utils.logging import * from src.utils.common_utils import * from src.data.dataset import TextLineDataset from src.data.data_iterator import DataIterator from src.models import build_model from src.decoding import beam_search import...
15,516
4,780
import numpy as np import matplotlib.pyplot as plt n = [0,10,20,40,80,160,320,640] error_rate_knn = [0.352873876328,0.387737617135,0.453305017255,0.458524980174,0.474808757584,0.470144927536,0.473847774559,0.467094872065] error_rate_svm = [0.357722691365,0.355341365462,0.355402176799,0.352894528152,0.352941176471,0....
1,373
855
from flask import Blueprint, request, jsonify import json import yaml import app_conf from tools.db_connector import DBConnector as mysql from service import service_mesh as sm_service service_mesh = Blueprint('service_mesh', __name__) # set logger logger = app_conf.Log.get_logger(__name__) conn = my...
1,845
628
# Copyright 2016 by MPI-SWS and Data-Ken Research. # Licensed under the Apache 2.0 License. """ Build a filter that takes an input stream and dispatches to one of several output topics based on the input value. """ import asyncio import unittest from antevents.base import Publisher, DefaultSubscriber, Scheduler from ...
2,363
707
""" Packrat Parsing """ # NOTE: attempting to use exceptions instead of FAIL codes resulted in # almost a 2x slowdown, so it's probably not a good idea from typing import (Union, List, Dict, Callable, Iterable, Any) from collections import defaultdict import re import inspect from pe._constants import ( FAIL, ...
12,515
3,637
import aiohttp from aiohttp import web import aiohttp_rpc async def make_client(aiohttp_client, rpc_server: aiohttp_rpc.JsonRpcServer) -> aiohttp.ClientSession: app = web.Application() app.router.add_post('/rpc', rpc_server.handle_http_request) return await aiohttp_client(app) async def make_ws_client(...
582
217
#!/usr/bin/env python3 """ usage: put under source folder, required files: evolving_state.txt, calib_state.txt, state.txt After first run, integration_states.txt, vio_states.txt are generated and figures are saved in current dir You can move the figures and state.txt, integration_states.txt, vio_states.txt into a fold...
14,346
5,209
import os import shutil def get_root(): root_dir = os.path.dirname(os.path.abspath(__file__)) return os.path.split(root_dir)[0] def absolute_path(relative_path): return os.path.join(get_root(), relative_path) def append_path(module, relative_path): return os.path.join(get_dir(module), relative_pat...
767
288
from random import randint from time import sleep itens = ('Pedra', 'Papel', 'Tesoura') computador = randint(0, 2) print('''Suas opções: [ 0 ] PEDRA [ 1 ] PAPEL [ 2 ] TESOURA''') jogador = int(input('Qual é a sua jogada? ')) print('JO') sleep(1) print('KEN') sleep(1) print('POOO') print('#x#' * 13) print('O computador ...
1,204
509
""" 5) Faça um programa que peça ao usuário para digitar 10 valores e some-os. """ soma = 0 for n in range(10): num = float(input(f'Digite o valor {n + 1} de 10 para ser somado \n')) soma = soma + num print(f'{soma}')
227
99
# 243 - Shortest Word Distance (Easy) # https://leetcode.com/problems/shortest-word-distance/ class Solution(object): def shortestDistance(self, words, word1, word2): """ :type words: List[str] :type word1: str :type word2: str :rtype: int """ # Find the short...
852
251
from __future__ import print_function import numpy as np import cv2 import sys import imutils from imutils.video import VideoStream import argparse import time def main(): ap = argparse.ArgumentParser() ap.add_argument("-p", "--picamera", type=int, default=-1, help="whether or not the Raspberry Pi cam...
2,539
920
__author__ = 'thorwhalen' """ functions that work on soup, soup tags, etc. """ import bs4 from ut.pgenerator.get import last_element from tempfile import mkdtemp import os import ut.pstr.to as strto import ut.parse.util as parse_util import ut.pstr.trans as pstr_trans def root_parent(s): return last_element(s.p...
2,106
693
from faker import Faker from sqlalchemy import Column, Date, ForeignKey, Integer, String, Table, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm.session import sessionmaker from sqlalchemy_utils import create_database, database_exists connection_string = "mysql+mysqlconnector:...
1,130
367
""" Return the 3rd longest string in an array of strings """ def ThirdGreatest(strArr): #have to reverse because timsort is stable strArr = sorted(strArr, key = len, reverse = True) return strArr[2] print ThirdGreatest(raw_input())
254
82
# -*- coding: utf-8 -*- """rackio/workers/__init__.py This module implements all Rackio Workers. """ from .alarms import AlarmWorker from .api import APIWorker from .continuos import _ContinuosWorker from .controls import ControlWorker from .functions import FunctionWorker from .logger import LoggerWorker from .state...
347
100
# coding: utf-8 # 爬取leetcode刷题记录 import os import json import requests import time def parse_submissions(leetcode_session): url = "https://leetcode.cn/api/submissions/" headers = { "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/...
2,319
776
""" File: Milestone1.py Name: ----------------------- This file tests the milestone 1 for our babyname.py project """ import sys def add_data_for_name(name_data, year, rank, name): # Compare the rank of certain name which already exists in the name_data dictionary. final_rank = int(rank) #print(name_dat...
3,179
1,124
from typing import List, Set from CandidateScore import CandidateScore from Candidate import Candidate from Voter import Voter from ElectionConfig import ElectionConfig class Ballot: def __init__(self, voter: Voter, candidates: List[Candidate], config: ElectionConfig): self.voter = voter scores =...
1,003
324
import os import time from tqdm import tqdm import trimesh import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import _init_path from config import cfg from RASF import RASF from pointclouds.datasets.shapenetpart import ShapenetPartDataset, to...
5,853
2,244
from django.utils.translation import ugettext as _ from slugify import slugify from .base import models class Timezone(models.Model): """ Timezone Model Class. """ created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) country = models.ForeignK...
1,697
579
import os import sys import cv2 import numpy as np import matplotlib.pyplot as plt sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) from lib.utils import utils_inference from lib.utils import utils_landmarks from lib.ransac import ransac ### Eye Landmarks Detection method = 'unityeyes_angle' ckpt = 13...
1,905
836
#!/usr/bin/python from common import * import atexit atexit.register(cleanup) subs = [ sub('1.1.#'), sub('1.1.#'), sub('1.1.#') ] for i in range(100): pub('1.1.{}'.format(i)) expect_pub_received(subs, ['1.1.\d+'] * 100)
241
119
from typing import List from neural_network import NeuralNetwork class Population(object): _individuals: list _layers: int _neurons: int population: list def __init__(self, layers: int, neurons: int, max_individuals: int): self._layers = layers self._neurons = neurons self...
1,103
343
import wisardpkg as wp import random import numpy as np import time from astropy.stats import bootstrap from astropy.utils import NumpyRNGContext LOW_N = 5 HIGH_N = 31 MIN_SCORE = 0.1 GROW_INTERVAL = 100 MAX_DISCRIMINATOR_LIMIT = 10 class BordaBagging(object): def __init__(self, train_dataset, learners, part...
4,601
1,423
""" Copyright 2013 Rackspace 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 dist...
21,116
5,946
from PyQt5.QtGui import QImage, QPixmap # review class ExperimentalContent(): def __init__(self, mainWindow): print("Loading Experimental content") self.mainWindow = mainWindow self.mainWindow.expLabel.setText("hello world")
254
70
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2013, Nigel Small # # 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...
3,683
1,043
import pybithumb df = pybithumb.get_ohlcv("BTC", interval="day") df["변동성"] = (df['high'] - df['low']) * 0.5 df["목표가"] = df["open"] + df["변동성"].shift(1) print(df)
163
87
"""Common dependencies for rules_proto_grpc.""" load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") load("//internal:common.bzl", "check_bazel_minimum_version") # Versions MINIMUM_BAZEL_VERSION = "3.0.0" ENABLE_VERSION_NAGS = False PROTOBUF_VERSION = "3.19.1" # When updating, also updat...
23,105
9,854
from fastapi import APIRouter from ws_assets.routes import ui from ws_assets.routes.api.v1 import websocket from ws_assets.settings import Settings settings = Settings() # /api/v1 api_v1_router = APIRouter(tags=["v1"]) for endpoints in (websocket,): api_v1_router.include_router(endpoints.router, prefix="/api/v1...
437
152
#!/usr/bin/env python # -*- coding: utf-8 -*- """AdventureDocs Choose Your Own Adventure style software documentation from markdown. Use markdown files to represent a section of instructions, and options to skip to a section, or just go to the next section. Load a directory of markdown files, which also includes a ...
5,279
1,522
# This example runs the examples from figure 5 of the manuscript from synbioweaver import * class BBa_B0030(RBS): def __init__(self): super(BBa_B0030, self).__init__() self.type = "biobrick" self.sequence = "attaaagaggagaaa" declareNewMolecule('GFP') declareNewMolecule('TetR') declareNew...
3,095
1,087