text
string
size
int64
token_count
int64
import os from typing import Union import tensorflow as tf import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split, KFold import utility as ut from variables import * # Read the data. train_data = pd.read_csv(os.path.join(DATA_PATH, ".".join([DATA...
5,852
2,363
import base64 import random import string import netbyte import numpy as np try: import simplejson as json except ImportError: import json kinds = {} class PDObject(object): def __init__(self, game, kind, id, pos, properties): self.game = game self.kind = kind self.id = ...
1,971
606
import unittest from players import Player, Quarterback from possible_values import * from game import Game from random import randint, uniform, sample from season import * # TODO - some things you can add... class FootballGameTest(unittest.TestCase): '''test the class''' def test_field_goal_made(self): ...
1,859
633
import os import logging import numpy as np from tqdm import tqdm from functools import partial from multiprocessing.pool import ThreadPool import pyworld as pw from util.dsp import Dsp logger = logging.getLogger(__name__) def preprocess_one(input_items, module, output_path=''): input_path, basename = input_item...
2,486
863
#!/usr/bin/python import sys from subprocess import call print "divsum_count.py ListOfDivsumFiles\n" try: files = sys.argv[1] except: files = raw_input("Introduce RepeatMasker's list of Divsum files with library size (tab separated): ") files = open(files).readlines() to_join = [] header = "Coverage for ea...
3,025
1,139
#!/usr/bin/env python from agatecharts.charts.bars import Bars from agatecharts.charts.columns import Columns from agatecharts.charts.lines import Lines from agatecharts.charts.scatter import Scatter
201
59
from django.contrib.auth import update_session_auth_hash from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.contrib.auth.views import (LoginView, PasswordResetConfirmView, PasswordResetView) from django.http import Htt...
1,930
533
import os from test.core.emr_system_unit_test_base import EMRSystemUnitTestBase from test.core.tconx_helper import TconxHelper class S3TableTestBase(EMRSystemUnitTestBase): default_tconx = \ "test/resources/s3_table_test_base/tconx-bdp-emr_test-dev-bi_test101.json" multi_partition_tconx = \ ...
2,970
901
from rest_framework import serializers from metrics.models import Metrics_Cpu, Metrics_PingServer, Metrics_MountPoint, \ Metrics_CpuLoad, Metrics_PingDb class Metrics_CpuSerializer(serializers.ModelSerializer): class Meta: model = Metrics_Cpu fields = '__all__' depth = 0 class Metrics...
939
281
# Copyright 2020 Plezentek, 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...
2,911
900
root = { "general" : { "display_viewer" : False, #The visible GPUS will be restricted to the numbers listed here. The pytorch (cuda:0) numeration will start at 0 #This is a trick to get everything onto the wanted gpus because just setting cuda:4 in the function calls will #not work...
4,041
1,541
from ..utils import TranspileTestCase class GeneratorTests(TranspileTestCase): def test_simple_generator(self): self.assertCodeExecution(""" def multiplier(first, second): y = first * second yield y y *= second yield y ...
1,010
254
''' ------------------------------------------------------------------------ Functions for taxes in the steady state and along the transition path. ------------------------------------------------------------------------ ''' # Packages import numpy as np from ogusa import utils ''' -----------------------------------...
22,057
7,727
"""Module containing the taxonomy items API endpoints of the v1 API.""" from datetime import datetime from sqlalchemy.sql.schema import Sequence from muse_for_anything.db.models.taxonomies import ( Taxonomy, TaxonomyItem, TaxonomyItemRelation, TaxonomyItemVersion, ) from marshmallow.utils import INCL...
35,293
9,407
import matplotlib.pyplot as plt import numpy as np import pandas as pd df = pd.read_csv('transcount.csv') df = df.groupby('year').aggregate(np.mean) gpu = pd.read_csv('gpu_transcount.csv') gpu = gpu.groupby('year').aggregate(np.mean) df = pd.merge(df, gpu, how='outer', left_index=True, right_index=True) df = df.rep...
478
195
# Generated by Django 2.0.5 on 2018-07-02 19:46 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '0003_blogpost_author'), ] operations = [ migrations.CreateModel( name='Po...
742
252
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n = int(readline()) h = int(readline()) w = int(readline()) print((n - h + 1) * (n - w + 1))
241
100
import pygame from NetworkBroadcast import Broadcast, AnimatedSprite, DeleteSpriteCommand from Textures import HALO_SPRITE12, HALO_SPRITE14, HALO_SPRITE13 __author__ = "Yoann Berenguer" __credits__ = ["Yoann Berenguer"] __version__ = "1.0.0" __maintainer__ = "Yoann Berenguer" __email__ = "yoyoberenguer@hotma...
5,106
1,711
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import logging import os.path import subprocess from collections import OrderedDict from itertools import izip import numpy as np import pandas as pd from django.conf import settings from django.core.cache import cache from django.db impo...
29,965
8,791
from typing import Any, Dict, KeysView import attr from config.auth import OAuth2 from config.cfenv import CFenv from config.spring import ConfigClient @attr.s(slots=True) class CF: cfenv = attr.ib( type=CFenv, factory=CFenv, validator=attr.validators.instance_of(CFenv), ) oauth2 = attr.ib(type=...
1,579
492
# Copyright 2015 Confluent Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
3,881
991
i=input("Enter a string: ") list = i.split() list.sort() for i in list: print(i,end=' ')
93
38
"""Config repositories use case.""" from __future__ import annotations import git_portfolio.config_manager as cm import git_portfolio.domain.gh_connection_settings as cs import git_portfolio.responses as res class ConfigReposUseCase: """Gitp config repositories use case.""" def __init__(self, config_manager...
948
252
import pytest from ..logic import Board, empty_board, example_board, solved_board class TestBoard: def test_create_board(self): board = Board(example_board) assert board.tiles == example_board def test_solve_board(self): board = Board(example_board) board.solve() asse...
943
300
from __future__ import print_function from __future__ import absolute_import from __future__ import division import ast import rhinoscriptsyntax as rs __all__ = [ 'mesh_select_vertex', 'mesh_select_vertices', 'mesh_select_face', 'mesh_select_faces', 'mesh_select_edge', 'mesh_select_edges', ...
8,111
2,414
from telegram import Update from telegram.ext import Updater, CallbackContext, ConversationHandler, CommandHandler, MessageHandler, Filters from db import DBConnector import re str_matcher = r"\"(?P<name>.+)\"\s*(?P<fat>\d+)\s*/\s*(?P<protein>\d+)\s*/\s*(?P<carbohydrates>\d+)\s*(?P<kcal>\d+)" ADD_1 = 0 def add_0(...
1,258
420
from mock import patch import numpy as np def test_dataset_simple(): from ..dataset import Dataset data = object() target = object() dataset = Dataset(data, target) assert dataset.data is data assert dataset.target is target @patch('nolearn.dataset.np.load') def test_dataset_with_filenames(...
1,298
472
import Cipher.tk from Cipher.tk import EncryptDecryptCoord, GetChiSquared, Mode def MultiDecrypt (message, alphabet, usables = 3, lan = "English", transformations = [], lowestchi = 9999, ogMessage = ""): msg = "" prev = (9999, (0, 0)) # (chi, key) for i in range (len(message)): ...
1,345
475
#!/usr/bin/env python import sys import argparse import pkg_resources import vcf from vcf.parser import _Filter parser = argparse.ArgumentParser(description='Filter a VCF file', formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('input', metavar='input', type=str, nargs=1, ...
2,234
674
import os from flask import Blueprint, render_template def create_bp(): bp_red = Blueprint('red', __name__, url_prefix='/red') @bp_red.route('/index/') @bp_red.route('/') def index(): return render_template('red/index.html') return bp_red
273
93
# from aiohttp.client_exceptions import ClientError from lxml import html from pathlib import Path from asyncio import create_task from functools import wraps def start_immediately(task): @wraps(task) def wrapper(*args, **kwargs): return create_task(task(*args, **kwargs)) return wrapper @start...
4,125
1,224
# SQL output is imported as a pandas dataframe variable called "df" # Source: https://stackoverflow.com/questions/19441730/trimmed-mean-with-percentage-limit-in-python import pandas as pd import matplotlib.pyplot as plt from scipy.stats import tmean, scoreatpercentile import numpy as np def trimmean(arr, percent): ...
553
176
import os import cv2 import random import numpy as np from tensorflow.keras.utils import to_categorical from scripts.consts import class_dict def get_data(path, split=0.2): X, y = [], [] for directory in os.listdir(path): dirpath = os.path.join(path, directory) print(directory, len(os.listd...
1,298
507
# Copyright 2014 Cisco Systems, 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 requi...
33,478
9,951
import pytest from opentimesheet.core.tests import TenantTestCase @pytest.mark.usefixtures("profile") class TestProfile(TenantTestCase): def test__str__(self): assert ( self.profile.first_name + " " + self.profile.last_name == self.profile.__str__() )
299
93
from ami.flowchart.library.DisplayWidgets import ScalarWidget, ScatterWidget, WaveformWidget, \ ImageWidget, ObjectWidget, LineWidget, TimeWidget, HistogramWidget, \ Histogram2DWidget from ami.flowchart.library.common import CtrlNode from amitypes import Array1d, Array2d from typing import Any import ami.graph_...
10,434
3,185
'''OpenGL extension ARB.transform_feedback_instanced This module customises the behaviour of the OpenGL.raw.GL.ARB.transform_feedback_instanced to provide a more Python-friendly API Overview (from the spec) Multiple instances of geometry may be specified to the GL by calling functions such as DrawArraysInstance...
1,435
372
from regression_tests import * class TestBase(Test): def test_for_main(self): assert self.out_c.has_funcs('main') or self.out_c.has_funcs('entry_point') def test_check_main_is_not_ctor_or_dtor(self): for c in self.out_config.classes: assert "main" not in c.constructors ...
2,681
938
from .lib.DownloadData import DownloadData
44
12
__author__ = 'Mandar Patil (mandarons@pm.me)' import warnings warnings.filterwarnings('ignore', category=DeprecationWarning)
127
44
def test_one_plus_one_is_two(): assert 1 + 1 == 2 #o assert espera que algo seja verdadeiro, se for falso o teste quebrou def test_negative_1_plus_1_is_3(): assert 1 + 1 == 3
189
83
import setuptools long_description = """ # Coldtype ### Programmatic display typography More info available at: [coldtype.goodhertz.com](https://coldtype.goodhertz.com) """ setuptools.setup( name="coldtype", version="0.6.6", author="Rob Stenson / Goodhertz", author_email="rob@goodhertz.com", des...
3,210
1,089
# -*- coding: utf-8 -*- # GFOLD_static_p3p4 min_=min from cvxpy import * import cvxpy_codegen as cpg from time import time import numpy as np import sys import GFOLD_params ''' As defined in the paper... PROBLEM 3: Minimum Landing Error (tf roughly solved) MINIMIZE : norm of landing error vector SUBJ TO : ...
5,064
2,042
import io import hashlib import logging import os import struct import random from HintList import getHint, getHintGroup, Hint from Utils import local_path #builds out general hints based on location and whether an item is required or not def buildGossipHints(world, rom): stoneAddresses = [0x938e4c, 0...
6,154
2,144
# -*- coding: utf-8 -*- """ Created on Thu Feb 17 09:10:05 2022 @author: JHOSS """ from tkinter import * def contador(accion, contador): if accion == 'countUp': contador == contador + 1 elif accion == 'coundDown': contador == contador -1 elif accion == 'reset': contador == 0 return contador
304
133
from pytest import raises from bokeh.models import CustomJS, Slider def test_js_callback(): slider = Slider() cb = CustomJS(code="foo();", args=dict(x=slider)) assert 'foo()' in cb.code assert cb.args['x'] is slider cb = CustomJS(code="foo();", args=dict(x=3)) assert 'foo()' in cb.code a...
786
287
# BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE from __future__ import absolute_import import sys import pytest import numpy import awkward1 class Dummy(awkward1.Record): @property def broken(self): raise AttributeError("I'm broken!") def test(): behavi...
639
225
#!/user/bin/env python3 # -*- coding: utf8 -*- #===================================================# # cleanup.py # # Joshua Westgard # # 2015-08-13 # # # #...
1,838
569
from django.apps import AppConfig from ievv_opensource import ievv_batchframework from ievv_opensource.ievv_batchframework import batchregistry class HelloWorldAction(ievv_batchframework.Action): def execute(self): self.logger.info('Hello world! %r', self.kwargs) class HelloWorldAsyncAction(ievv_batchf...
1,262
362
r""" Utilities that may be used in the gates """ import torch from fmoe.functions import count_by_gate import fmoe_cuda as fmoe_native def limit_by_capacity(topk_idx, num_expert, world_size, capacity): capacity = torch.ones(num_expert, dtype=torch.int32, device=topk_idx.device) * capacity pos, le...
783
308
import os import torch import numpy as np from PIL import Image import torch.nn as nn from torch.utils import data from network import * from dataset.zurich_night_dataset import zurich_night_DataSet from configs.test_config import get_arguments palette = [128, 64, 128, 244, 35, 232, 70, 70, 70, 102, 102, 156, 190, ...
4,438
1,891
#decorator def now(): print "2015-11-18" f=now f() print now.__name__ print f.__name__ def log(func): def wrapper(*args,**kw): print 'begin call %s():' %func.__name__ func(*args,**kw) print 'end call %s():' %func.__name__ return wrapper @log def now1(): print now1.__name__ now1() now1=log(now1) now1() def...
1,581
688
# Author: Will Rodman # wrodman@tulane.edu # # Command line to run program: # python3 pyfrechet_visualize.py import sys, os, unittest sys.path.insert(0, "../") from pyfrechet.distance import StrongDistance from pyfrechet.visualize import FreeSpaceDiagram, Trajectories TEST_DATA = "sp500" if TEST_DATA == "sp500": ...
2,090
820
#!/usr/bin/env python3 # vim:fileencoding=UTF-8 # -*- coding: UTF-8 -*- """ Created on 15 juny 2019 y. @author: Vlsdimir Nekrasov nww2007@mail.ru """ import sys import struct import numpy as np from progress.bar import Bar import logging logging.basicConfig(format = u'%(filename)s:%(lineno)d: %(levelname)-8s [%(asc...
6,403
2,847
#!/usr/bin/env python # -*- coding: utf-8 -*- __all__ = ["FormattedCheckpointFile"] # # Imports import numpy as np import scipy.linalg as sla from collections import OrderedDict import re import logging # # Local Imports from sgdml_dataset_generation import units from sgdml_dataset_generation.units import hbar # # L...
10,915
3,088
values = [] for i in range(9): values.append(int(input(''))) max_value = 0 location = 0 for i in range(9): if values[i] > max_value: max_value = values[i] location = i+1 print(max_value) print(location)
227
86
#!/usr/bin/env python # encoding: utf-8 """ process.py Copyright (c) 2011 Adam Cohen 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 t...
3,097
925
from __future__ import print_function, division, absolute_import import numpy as np INPUT = 265149 def part1(number): skip = 2 d = 1 row = None col = None for shell_idx in range(1, 10000): size = shell_idx * 2 + 1 a = d + skip b = a + skip c = b + skip d ...
2,063
724
# Generated by Django 3.2.7 on 2021-09-29 23:54 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_20210929_2353'), ] operations = [ migrations.AlterField( model_name='order', ...
916
307
begin_unit comment|'# Copyright 2013 Cloudbase Solutions Srl' nl|'\n' comment|'# All Rights Reserved.' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with the License. You may obtain' nl|'\n'...
5,249
2,458
# -*- coding: utf-8 -*- """ Geometrical functions --------------------- References ---------- .. [W1] Wikipedia: https://de.wikipedia.org/wiki/Ellipse#Ellipsengleichung_(Parameterform) .. [WAE] Wolfram Alpha: Ellipse. (http://mathworld.wolfram.com/Ellipse.html) """ import numpy as np from typing import Union def ci...
1,801
645
"""Monthly HDD/CDD Totals.""" import datetime from pandas.io.sql import read_sql from pyiem.plot.use_agg import plt from pyiem.util import get_dbconn, get_autoplot_context from pyiem.exceptions import NoDataFound PDICT = {'cdd': 'Cooling Degree Days', 'hdd': 'Heating Degree Days'} def get_description(): ...
4,435
1,669
import os import pickle import time import timeit import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np import torch import tempfile import horovod.torch as hvd from horovod.ray import RayExecutor from ray_shuffling_data_loader.torch_dataset import (TorchShufflingDatase...
12,502
4,323
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from django.conf import settings from django.db import connection, DatabaseError from django.db.models import F, DateField, DateTimeField, IntegerField, TimeField, CASCADE from django.db.models.fields.related import ForeignKey from django.db.models.func...
13,051
4,201
import pytest import numpy as np import eqtk def test_promiscuous_binding_failure(): A = np.array( [ [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, ...
7,200
3,409
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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 from .. import _utilitie...
13,314
3,724
# MIT License # # Copyright (c) 2017 Satellogic SA # # 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, merge...
21,377
6,457
from .rouge import ROUGEScorer from .bleu.bleu import BLEUScorer from .meteor.meteor import METEORScorer from .cider.cider import Cider from .ciderd.ciderd import CiderD
170
67
import numpy as np import torch import torch.nn as nn from mmcv.runner import obj_from_dict from mmcv.utils.config import Config from mmedit.models import build_model from mmedit.models.losses import L1Loss from mmedit.models.registry import COMPONENTS @COMPONENTS.register_module() class BP(nn.Module): """A simp...
3,993
1,380
from django.utils import timezone from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from database.study_models import DeviceSettings, Study, Survey, SurveyArchive @receiver(post_save, sender=Study) def popula...
3,739
1,062
import npyscreen class NotifyBaseExample(npyscreen.Form): def create(self): key_of_choice = 'p' what_to_display = 'Press {} for popup \n Press escape key to quit'.format(key_of_choice) self.how_exited_handers[npyscreen.wgwidget.EXITED_ESCAPE] = self.exit_application self.add(npysc...
673
223
# -*- coding: utf-8 -*- """Implementation of MiniGoogLeNet architecture. This implementation is based on the original implemetation of GoogLeNet. The authors of the net used BN before Activation layer. This should be switched. """ from keras.layers.normalization import BatchNormalization from keras.layers.convolutiona...
5,656
1,803
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
7,702
2,715
"""Test whether putative triangles, specified as triples of side lengths, in fact are possible.""" def load_triangles(filename): """Load triangles from filename.""" triangles = [] with open(filename) as f: for line in f: if line.strip(): triangles.append(tuple([int(side) ...
1,475
485
num = int(input('Digite um número para ver sua tabuada: ')) for i in range(1, 11): print('{} x {:2} = {}'.format(num, i, num * i))
135
55
"""Print ebmeta version number.""" import sys import ebmeta def run(): print "{} {}".format(ebmeta.PROGRAM_NAME, ebmeta.VERSION) sys.exit(0)
151
57
# -*- coding: utf-8 -*- # pylint: disable=no-member,invalid-name,duplicate-code """ REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the ...
9,594
2,648
import os SERVER_NAME = os.getenv('DOMAIN_SUPERSET') PUBLIC_ROLE_LIKE_GAMMA = True SESSION_COOKIE_SAMESITE = None # One of [None, 'Lax', 'Strict'] SESSION_COOKIE_HTTPONLY = False MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '') POSTGRES_DB=os.getenv('POSTGRES_DB') POSTGRES_PASSWORD=os.getenv('POSTGRES_PASSWORD') POSTG...
946
436
import discord import json import random import os from discord.ext import commands TOKEN = "" client = commands.Bot(command_prefix = '--') os.chdir(r'D:\Programming\Projects\Discord bot\jsonFiles') SoloCounter = 30 SolominCounter = 10 Queueiter = 1 T_Queueiter = 1 TeamCounter = 50 TeamminCounter = 20 ...
14,345
5,075
import database as d import numpy as np import random from transitions import Machine #Conversations are markov chains. Works as follows: a column vector for each CURRENT state j, a row vector for each TARGET state i. #Each entry i,j = the probability of moving to state i from state j. #target state D = end of convers...
18,547
5,897
from __init__ import ExtractUnlabeledData, SampleUnlabeledData, ExtractLabeledData E = ExtractLabeledData(data_dir='../labeldata/') E.get_pathways() E.get_pathway_names() E.get_classes_dict() E.create_df_all_labels()
218
82
from django.shortcuts import render, redirect from .forms import AuthorForm, BlogForm, NewUserForm from .models import Author, Blog from django.contrib.auth import login, authenticate, logout from django.contrib import messages from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.decorator...
3,812
1,180
# here we make fixtures of toy data # real parameters are stored and accessed from config import pytest import librosa import os import numpy as np from hydra.experimental import compose, initialize @pytest.fixture(scope="session") def cfg(): with initialize(config_path="../", job_name="test_app"): config = ...
1,759
639
import dataclasses import inspect from dataclasses import dataclass, field from pprint import pprint import attr class ManualComment: def __init__(self, id: int, text: str): self.id: int = id self.text: str = text def __repr__(self): return "{}(id={}, text={})".format(self.__class__....
2,189
697
from enum import Enum import requests class MusicAPP(Enum): qq = "qq" wy = "netease" PRE_URL = "http://www.musictool.top/" headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"} def get_music_list(name, app, pag...
574
237
from rest_framework import serializers from projects.models import Project, Tag, Review from users.models import Profile class ReviewSerializer(serializers.ModelSerializer): class Meta: model = Review fields = '__all__' class ProfileSerializer(serializers.ModelSerializer): class Meta: ...
892
235
import copy import datetime from decimal import Decimal import logging import uuid import json import cStringIO from couchdbkit import ResourceNotFound import dateutil from django.core.paginator import Paginator from django.views.generic import View from django.db.models import Sum from django.conf import settings fro...
108,927
31,023
from sympy import simplify, zeros from sympy import Matrix as mat import numpy as np from ..genericas import print_verbose, matriz_inversa def criterio_radio_espectral(H, verbose=True): eigs = [simplify(i) for i in list(H.eigenvals().keys())] print_verbose("||Criterio de radio espectral||", verbose) try...
5,668
1,969
"""{{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }}""" __version__ = "{{ cookiecutter.project_version }}" __author__ = """{{ cookiecutter.author_name }}""" __email__ = "{{ cookiecutter.author_email }}" prog_name = "{{ cookiecutter.project_hyphen }}"
282
94
from typing import NamedTuple from dask_gateway_server.app import DaskGateway class DaskGatewayServer(NamedTuple): address: str proxy_address: str password: str server: DaskGateway
200
68
# # Copyright (C) 2001,2002,2003 greg Landrum and Rational Discovery LLC # """ Functionality for ranking bits using info gains **Definitions used in this module** - *sequence*: an object capable of containing other objects which supports __getitem__() and __len__(). Examples of these include lists, tupl...
5,487
1,913
import tensorflow as tf import os import pickle import numpy as np from constant_params import input_feature_dim, window_size def build_dataset(input_tfrecord_files, batch_size): drop_remainder = False feature_description = { 'label': tf.io.FixedLenFeature([], tf.int64), 'ref_aa': tf.io.Fixe...
5,766
1,975
import copy import math import logging from typing import Dict, List, Optional, Tuple, Union import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.jit as jit import torch.autograd import contextlib import glob from eight_mile.utils import listify, Offsets, is_seque...
209,857
70,047
from setuptools import setup setup( name='espdf', version='0.1.0-dev', url='https://github.com/flother/pdf-search', py_modules=( 'espdf', ), install_requires=( 'certifi', 'elasticsearch-dsl', ), entry_points={ 'console_scripts': ( 'espdf=espd...
348
123
class BitcoinGoldMainNet(object): """Bitcoin Gold MainNet version bytes. """ NAME = "Bitcoin Gold Main Net" COIN = "BTG" SCRIPT_ADDRESS = 0x17 # int(0x17) = 23 PUBKEY_ADDRESS = 0x26 # int(0x26) = 38 # Used to create payment addresses SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF fo...
10,376
4,753
#!/usr/bin/env python # -*- coding: utf-8 -*- from conans import ConanFile, CMake, tools import shutil class ClapackConan(ConanFile): name = "clapack" version = "3.2.1" license = "BSD 3-Clause" # BSD-3-Clause-Clear url = "https://github.com/sintef-ocean/conan-clapack" author = "SINTEF Ocean" ...
2,776
949
""" Copyright 2021 Anderson Faustino da Silva. 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,...
20,078
4,700
import tkinter as tk from scipy.stats import chi2, chisquare COLOR = '#dddddd' COLUMNS_COLOR = '#ffffff' MAX_SIZE = 10 WIDGET_WIDTH = 25 class LinearCongruent: m = 2**32 a = 1664525 c = 1013904223 _cur = 1 def next(self): self._cur = (self.a * self._cur + self.c) % self.m return s...
8,924
3,488
# OpenWeatherMap API Key weather_api_key = "MyOpenWeatherMapAPIKey" # Google API Key g_key = "MyGoogleKey"
107
41
"""Represents a request for an action menu.""" from .....messaging.agent_message import AgentMessage, AgentMessageSchema from ..message_types import MENU_REQUEST, PROTOCOL_PACKAGE HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.menu_request_handler.MenuRequestHandler" class MenuRequest(AgentMessage): """Class re...
843
240