text
string
size
int64
token_count
int64
from discord.ext import commands import discord import random import datetime import sqlite3 class Welcomer(commands.Cog): def __init__(self, client): self.client = client @commands.Cog.listener() async def on_member_join(self, member): db = sqlite3.connect("main.sqlite") cursor =...
3,718
1,075
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.minigame.BlendActor from direct.interval.MetaInterval import Sequence from direct.interval.MetaInterval import Parallel from dir...
4,995
1,406
#!/usr/bin/env """ Plots multiple lag-energy spectra (from different observations, simulations, etc.) on the same plot. Change lag_dir and sim_dir to suit your machine and setup. Example call: python overplot_lag-energy.py cygx1 """ import argparse import subprocess import numpy as np from astropy.io import fits from...
10,872
4,123
import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Conv2D, BatchNormalization, Add, Lambda from tensorflow.python.keras.layers import PReLU from utils.normalization import normalize_01, denormalize_m11 upsamples_per_scale = { 2: 1, 4: 2, 8: 3 } ...
1,986
809
from .domain import Domain from .tcpml import Tcpml from .useragent import UserAgent
85
24
"""remove Revision ID: 8d599d025605 Revises: 8effd1c19c35 Create Date: 2020-11-30 15:53:56.451886 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '8d599d025605' down_revision = '8effd1c19c35' branch_labels = None depends_on...
14,914
5,617
from django.http import HttpResponse from django.shortcuts import render from App.models import Categary, Item, Students def test(request): return render(request, "test.html") def cate_view(request): # cates = Categary.objects.filter(name="饮料") cates = Item.objects.all() return render(request, "t...
1,569
546
""" Base settings to build other settings files upon. """ from pathlib import Path import environ ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent # oxigen_api/ APPS_DIR = ROOT_DIR / "oxigen_api" env = environ.Env() READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False) if READ_D...
21,338
6,915
# Generated by Django 2.0.13 on 2019-08-05 21:50 from django.conf import settings import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True ...
44,526
14,626
"""Interface with HDF5 file containing PLINK data. The convention used in the container Each probe is a row in the genotype array. Each individual is a column in the genotype array. import tables raw_data = tables.openFile('test.h5', 'r') raw_data.root.probes[1:10]['ID'] raw_data.root.individuals[3:6] raw_data.root.g...
10,212
3,346
from typing import Tuple, Any from .base import VideoReader class DummyVideoReader(VideoReader): def __init__(self): self.frame_id = 0 def read_frame(self) -> Tuple[int, Any]: frame_id = self.frame_id self.frame_id += 1 return frame_id, None def seek(self, frame_id: int)...
355
119
from lv_colors import lv_colors from imagetools import get_png_info, open_png # Register PNG image decoder decoder = lv.img.decoder_create() decoder.info_cb = get_png_info decoder.open_cb = open_png # Create an image with open('img_hand.png','rb') as f: png_data = f.read() img_hand_dsc = lv.img_dsc_t({ 'data_...
837
401
#-*- coding:utf-8 -*- """ VoiExtractionManager Copyright (c) 2016 Tetsuya Shinaji This software is released under the MIT License. http://opensource.org/licenses/mit-license.phps Date: 2016/02/10 """ import pydicom as dicom try: from pydicom.contrib import pydicom_serie...
23,108
7,863
#!/bin/python3 # Required: ROM_NAME = "DSCDP_CRUJN6_00" IGNORE_MD5 = False # Custom Rules Begin Here # This example one just excludes control characters (except 0x0A) # Required: this method must exist, and return true / false on if a byte array # is to be considred valid characters def check_valid(obytes): for b...
416
165
import email, smtplib, ssl from email import encoders from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from typing import Dict, List class MailHandler(object): def __init__(self, mail_host:str, mail_port:int, sender_email:str=None, sender_pa...
3,660
1,077
from koi.config.vae_config import VAEConfig class MNISTVAEConfig(VAEConfig): def __init__(self, **kwargs): super().__init__(**kwargs) self.x_dim = 784 self.latent_size = 2 self.encoder_layer_sizes = [784, 300, 100] # todo remove first self.decoder_layer_sizes = [100, 300, ...
422
171
import numpy as np import reciprocalspaceship as rs import tensorflow as tf from tensorflow import keras as tfk from IPython import embed class SelfAttentionBlock(tfk.layers.Layer): def __init__(self, attention_dims, num_heads, ff_dims=None): super().__init__() attention_dims = attention_dims ...
2,464
819
from keras.layers.core import Dense, Permute, Reshape from keras.layers.convolutional import Convolution2D from keras.layers.normalization import BatchNormalization from keras.layers.pooling import MaxPooling2D from keras.layers.wrappers import Bidirectional from keras.layers.recurrent import LSTM from keras.models imp...
2,157
844
import sys sys.path.append("..") from sympy import sqrt, symbols, eye w, x, y, z = symbols("wxyz") L = [x,y,z] V = eye(len(L)) for i in range(len(L)): for j in range(len(L)): V[i,j] = L[i]**j det = 1 for i in range(len(L)): det *= L[i]-L[i-1] print "matrix" print V print "det:" print V.det().expand() ...
372
162
import os import sys import logging import subprocess as sp import click from . import buildkite logger = logging.getLogger(__name__) BURN_IN_DEFAULT = 50 # Iterations @click.group() def cli(): """ CLI tool for running Buildkite jobs """ @click.command() def calibrate(): """Run a calibration jo...
7,679
2,446
from ophyd import EpicsMotor, PVPositioner, PVPositionerPC, EpicsSignal, EpicsSignalRO, Device from ophyd import Component as Cpt, FormattedComponent as FmCpt # Undulator class GapMotor1(PVPositionerPC): readback = Cpt(EpicsSignalRO, 'Pos-I') setpoint = Cpt(EpicsSignal, 'Pos-SP') stop_signal = FmCpt(Epics...
3,385
1,516
import os import dj_database_url import environ import sentry_sdk from celery.schedules import crontab from sentry_sdk.integrations.celery import CeleryIntegration from sentry_sdk.integrations.django import DjangoIntegration # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.d...
7,407
2,850
# ############################################################################# # test_ffs.py # =========== # Author : # Sepand KASHANI [kashani.sepand@gmail.com] # Eric BEZZAM [ebezzam@gmail.com] # ############################################################################# import math from pyffs import ( ffs, ...
4,688
1,850
from dnnsvg import layers from dnnsvg.svg_builder import SVGBuilder from dnnsvg.svgeables.variables.tensor_2d import Tensor2D from dnnsvg.svgeables.variables.tensor_3d import Tensor3D from dnnsvg.svgeables.captions.caption import Caption
237
89
#!/usr/bin/env python # -*- coding: utf-8 -*- # --------------------------------------------------------------------------------------------- # Copyright (c) 2013-2016, Ryan Galloway (ryan@rsgalloway.com) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
13,362
4,112
from django.contrib import admin from .models import CustomUser from django.contrib.auth.admin import UserAdmin class CustomUserAdmin(UserAdmin): model = CustomUser fieldsets = ( *UserAdmin.fieldsets, ) list_display = ('email', 'first_name', 'last_name', 'is_staff', 'is_active',) search_...
449
143
import sqlite3 import schedule from selenium import webdriver from selenium.webdriver.chrome.options import Options #import chromedriver_autoinstaller from bs4 import BeautifulSoup import pandas as pd import time class Bigkinds: def __init__(self): self.options = Options() # headless는 화면이나 페이지 이동을 ...
5,586
2,333
import random import time from displayBanner import displayBanner, choice TARGET = "genetic algorithm" INDIVIDUAL_SIZE = len(TARGET) POPULATION_SIZE = 100 MUTATION_RATE = 0.1 TOURNAMENT_SELECTION_SIZE = 40 KEYS = 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ' class Individual: def __init__(self): self._d...
3,157
1,225
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from exifreader import __version__, __doc__ readme_file = open("README.md", "rt").read() setup( name="ExifReader", version=__version__, author="Cyb3r Jak3", author_email="jake@jwhite.network", license="BSD", python_requires="...
1,517
515
from PyQt5.QtGui import QColor, QIcon from PyQt5.QtWidgets import QMainWindow from ..storage import Storage from .panel import SideBar from .colors import get_color class Window(QMainWindow): def __init__(self): super().__init__() Storage.load() self.setFixedSize(600, 478) se...
696
224
# Generated by Django 3.0.3 on 2020-05-03 09:33 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0004_auto_20200502_1946'), ] operations = [ migrations.AlterModelOptions( name='course', options={'ordering': ('-id',)...
458
161
#import this # delete the first hashtag to see the truth import pygame, sys, json from time import sleep #my folders from settings import Settings from ship import Ship from bullet import Bullet from game_stats import GameStats from alien import Alien from button import Button from scoreboard import Scoreboard #from ch...
9,458
3,261
from copy import deepcopy from random import randint, uniform, choice class EAConfig: """ This class sets up the parameters for EA """ def __init__(self, mut = 0.30, cross = 0.30, cand_size = 10, max_cand_value = 8, # for real and ...
21,319
6,398
_PROMETHEUS_CLIENT_MODEL_BUILD_FILE = """ licenses(["notice"]) # BSD license load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library") cc_proto_library( name = "prometheus_client_model", srcs = ["metrics.proto"], default_runtime = "@com_google_protobuf//:protobuf", protoc = "@com_google_protobu...
3,374
1,357
# Copyright (c) 2018-2022, NVIDIA Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
9,867
3,399
# User params EMAIL = 'A.N.Other@example.com' DEFAULT_YEAR_MIN = 1970 DEFAULT_YEAR_MAX = 2021 # Basic setup from Bio import Entrez from tqdm import tqdm from typing import Tuple from typing import List Entrez.email = EMAIL def _number_by_year(query: str, year: int) -> int: '''Internal helper functions. Return...
1,159
392
from .classification import * from .conll import * from .metric import * from .transform import * from .workspace import * from .pattern import *
146
40
# imports from flask import request from flask import render_template from flask import Blueprint from flask import redirect from flask import url_for from flask.ext.login import current_user from project import db from project.models import Person from .forms import PersonForm # config people_blueprint = Blueprin...
1,127
314
from django.db import models from simple_history.models import HistoricalRecords class Language(models.Model): language_id = models.CharField(max_length=2, blank=True, null=True, unique=True) description_en = models.CharField(max_length=16, blank=True, null=True, unique=True) description_fr = models.CharF...
7,152
2,180
from advent.common import utils from .day import part1, part2 from .number import SnailInt, SnailNumber, SnailPair def test_parse1(): input = "[1,2]" expected = SnailPair(SnailInt(1), SnailInt(2)) result = SnailNumber.from_str(input) assert result == expected def test_parse1a(): input = "[10,12...
3,445
1,372
"""Custom states for MetalK8s.""" import logging import time import traceback import re from salt.exceptions import CommandExecutionError from salt.ext import six __virtualname__ = "metalk8s" log = logging.getLogger(__name__) def __virtual__(): return __virtualname__ def _error(ret, err_msg): ret["resul...
6,415
1,934
import numpy as np # from scipy import stats, optimize def PolyBaseFunction(x, dims): return np.array([x**d for d in range(dims+1)]).T class LinearRegression: def __init__(self, y, Phi): self.y = np.array(y).reshape((-1, 1)) self.Phi = np.array(Phi) self.N, self.D = self.Phi.shape ...
2,419
929
import unittest import pandas as pd from statsmodels.stats import proportion from meerkat_analysis import univariate, util class UnivariateTest(unittest.TestCase): """ Testing univariate""" def test_breakdown_by_cateogry(self): data = pd.read_csv("meerkat_analysis/test/test_data/univariate.csv") ...
1,745
577
import cv2 image = cv2.imread("noisy.png") cv2.imshow("Original", image) smooth = cv2.GaussianBlur(image, (11,11), 1) #cv2.GaussianBlur(input, kernel size, sigma) cv2.imshow("De-noised", smooth) cv2.waitKey(0)
214
98
import pytest from classification_model.config.core import config from classification_model.processing.data_manager import load_dataset @pytest.fixture() def sample_input_data(): return load_dataset(file_name=config.app_config.test_data_file)
250
73
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
15,165
4,951
class Solution(object): def rob(self, nums): """ :type nums: List[int] :rtype: int """ prevMax = 0 # the max not robbing the previous house currMax = 0 # the max for n in nums: temp = currMax currMax = max(currMax, prevMax+n) ...
361
109
# from sklearn.decomposition import PCA import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.decomposition import PCA def prepro_data(data, isCenter=True, dimPCA=6,isPlot=True,method='minmax'): if isCenter: dataPREPRO = data - data.mean().mean() else: dataPREPRO...
1,907
730
from .models import Image, Profile, Comment from django import forms class EditProfileForm(forms.ModelForm): class Meta: model = Profile exclude = ['user'] class UploadForm(forms.ModelForm): class Meta: model = Image exclude = ['user','likes','upload_date','profile']
308
81
""" This example is based on keras's mnist_mlp.py and mnist_cnn.py Trains a simple deep NN on the MNIST dataset. """ import argparse import json import os import keras from webdnn.backend import generate_descriptor, backend_names from webdnn.frontend.keras import KerasConverter batch_size = 128 num_classes = 10 ep...
7,535
2,712
# -*- coding:utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. 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...
1,793
577
""" Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. License at https://github.com/cisco/mercury/blob/master/LICENSE """ import os import sys import base64 # TLS helper classes sys.path.append(os.path.dirname(os.path.abspath(__file__))) sys.path.append(os.path.dirname(os.path.abspath(__file__))+'/../') f...
11,290
3,633
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2021 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance...
3,182
939
import numpy as np import scipy.stats as st # for pearsonr, has to be imported explicitly import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes # to use the inset in subplot from mpl_toolkits.axes_grid1 import make_axes_locatable # to scale the colorbar from .quarters ...
4,077
1,693
from gazette.spiders.base import FecamGazetteSpider class ScTangaraSpider(FecamGazetteSpider): name = "sc_tangara" FECAM_QUERY = "cod_entidade:268" TERRITORY_ID = "4217907"
187
87
from django.urls import path from django.conf.urls import url from . import views urlpatterns = [ path("", views.index, name="index"), path("login", views.login_view, name="login"), path("logout", views.logout_view, name="logout"), path("register", views.register, name="register"), path("profile/<...
774
245
import os import pytest import pandas as pd from nnaps.mesa import compress_mesa, fileio from pathlib import Path base_path = Path(__file__).parent class Test2H5: def test_read_mesa_output(self): filename = base_path / 'test_data/M1.013_M0.331_P32.85_Z0.00155/LOGS/history1.data' _, data = co...
2,476
924
import lol_dto.classes.game as dto from lol_dto.classes.sources.riot_lol_api import RiotGameSource, RiotPlayerSource from riot_transmute.common.iso_date_from_ms import get_iso_date_from_ms_timestamp role_trigrams = { "TOP": "TOP", "JUNGLE": "JGL", "MIDDLE": "MID", "BOTTOM": "BOT", "UTILITY": "SUP"...
10,588
3,464
# 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...
1,946
580
import re from bs4 import BeautifulSoup from common import cache_request BASE_URL = 'https://www.sos.state.mn.us/elections-voting/find-county-election-office/' re_lines = re.compile(r'(?<=Absentee voting contact)\s*(.*?)\s*' + r'Phone:\s*([0-9\-]+)(?:\s*ext\s*\d+)?\s*Fax:\s*([0-9\-]+)\s*Email:\s...
999
400
import xs.nn import xs.nn.functional import xs.optim from xs.layers import Conv2D, ReLU, BatchNormalization import numpy as np import torch.nn import torch.nn.functional import torch.optim import os import matplotlib.pyplot as plt os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" def xs_network(weight1, bias1, bn_weight1, ...
3,788
1,628
import pandas as pd from astropy.table import Table import pdb,os import matplotlib.pyplot as plt import threedhst.eazyPy as eazy import numpy as np from astropy.stats.funcs import biweight_location as bl from astropy.stats.funcs import biweight_midvariance as bs flux={'cB':'fB1','kB':'fB1','V':'fV1','R':'fR1','I':'fI...
7,897
3,442
import pytest from bitcaster.security import APP_ROLES @pytest.mark.django_db def test_application_admin(django_app, application1, user1): application1.add_member(user1, APP_ROLES.ADMIN) url = application1.urls.edit res = django_app.get(url, user=user1.email) assert res
290
103
import random from individual import Individual import settings class Population: def __init__(self, size, mutation): self.pool = [] self.mutation = mutation self.size = size self.reset_pool() self.max_score = 0 self.count_max = 0 self.all_fit = False ...
3,421
982
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
1,151
353
# terrascript/github/d.py import terrascript class github_collaborators(terrascript.Data): pass class github_ip_ranges(terrascript.Data): pass class github_repositories(terrascript.Data): pass class github_repository(terrascript.Data): pass class github_team(terrascript.Data): pass class gi...
358
123
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout from PyQt5.QtGui import QPainter from PyQt5.QtCore import Qt class MyWidget(QWidget): def __init__(self): super(QWidget, self).__init__() self.title = 'PyQt5 pixels example' self.left = 100 self.top = 100 self...
1,273
443
# # Autogenerated by Thrift Compiler (0.5.0-en-262021) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import * EDAM_ATTRIBUTE_LEN_MIN = 1 EDAM_ATTRIBUTE_LEN_MAX = 4096...
5,401
3,183
#!/bin/sh ''''exec python3 -u -- "$0" ${1+"$@"} # ''' # Copyright 2016 Euclidean Technologies Management LLC 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...
3,423
1,116
from twoInts import add_two_ints import typing firstInt = 5 secondInt = 2 additionOutput = add_two_ints(firstInt, secondInt) print(f"firstInt: {firstInt}, secondInt: {secondInt}") print(f"additionOutput: {additionOutput}") print("addTwoInts.__doc__", add_two_ints.__doc__) add_two_ints(1, 2) add_two_ints(1, "a")
317
125
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # # FreeType high-level python API - Copyright 2011-2012 Nicolas P. Rougier # Distributed under the terms of the new BSD license. # # ----------------------------------------------------------...
1,966
651
from django.views.generic.base import TemplateView from django.views.generic.edit import UpdateView, DeleteView, FormView from django.urls import reverse_lazy from django.http import HttpResponseRedirect from ..models import Event from ..forms import EventForm class EventView(TemplateView): template_name = "bpmn...
1,349
405
import asyncio import os from math import ceil from pprint import pprint from typing import Any, AsyncIterator, Optional import aiohttp from foss_library.books.models import Book FRAPPE_API_URL = os.getenv( "FRAPPE_API_URL", "https://frappe.io/api/method/frappe-library" ) async def get_n_books_from_api( c...
3,912
1,246
import requests import json class AzulAgent: def __init__(self, deployment): self.deployment = deployment if self.deployment == 'prod': self.azul_service_url = 'https://service.explore.data.humancellatlas.org' else: self.azul_service_url = f'https://service.{deploym...
1,712
474
#from flask_wtf import Form from flask_wtf import FlaskForm from wtforms import IntegerField, SubmitField, TextAreaField, SelectField, StringField, TextField, DecimalField, HiddenField, BooleanField from wtforms import validators, ValidationError import GetPatientInfo from WeightUtil import * class BabyForm(FlaskForm...
3,764
1,197
from collections import Counter inputs = [] with open('day01.input') as f: inputs = [int(x) for x in f.readlines()] def most_common(xs): return Counter(xs).most_common(1)[0][0] def part1(ns): return most_common([n * (2020-n) for n in ns]) def part2(ns): return most_common([a*b*c for a in ns for b in ns for c i...
388
168
#!/usr/bin/env python import logging import signal import time import linphone class SecurityCamera: def __init__(self, username='', password='', whitelist=[], camera='', snd_capture='', snd_playback=''): self.quit = False self.whitelist = whitelist callbacks = linphone.Factory.get().creat...
2,989
943
import re class AfStructureBrowser(object): def __init__(self, assets_query, assets_field="name", attributes_query=".*", attributes_field="name"): self.assets_query = assets_query.replace("\\", "\\\\") if assets_field == 'path' else assets_query self.assets_field = assets_field self.attrib...
2,984
775
import json import scrapy HARCON_HEADER = ("index", "name", "amplitude", "phase", "speed") class Station(scrapy.Item): constituents = scrapy.Field() latitude = scrapy.Field() longitude = scrapy.Field() MLLW = scrapy.Field() MTL = scrapy.Field() noaa_id = scrapy.Field() noaa_name = scra...
3,492
1,143
from turtle import forward import torch.nn as nn import torch class VGG3D(nn.Module): def __init__(self, type, pretrained=False): super(VGG3D, self).__init__() assert type in ['vgg11', 'vgg13', 'vgg16', 'vgg19', 'vgg11_bn', 'vgg13_bn', 'vgg16_bn', 'vgg19_bn'], 'type only support for vgg11, vgg13, v...
3,079
1,061
"""Feature class""" import anytree import cityhash import numpy as np from mihifepe import constants # pylint: disable = too-many-instance-attributes class Feature(anytree.Node): """Class representing feature/feature group""" def __init__(self, name, **kwargs): super().__init__(name) self.par...
1,820
583
# -*- coding: utf-8 -*- # # django-codenerix # # Copyright 2017 Centrologic Computational Logistic Center S.L. # # Project URL : http://www.codenerix.com # # 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 ...
25,193
7,024
"""empty message Revision ID: a75e5cbedaad Revises: 520f9f05e787 Create Date: 2021-05-21 10:36:28.752323 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a75e5cbedaad' down_revision = '520f9f05e787' branch_labels = None depends_on = None def upgrade(): # ...
858
327
########## 1.1.7 Regressão do Ângulo Mínimo (LARs) ########## # Regressão do Ângulo Mínimo (LARS, em inglês) é um algoritmo de regressão para dados de alto-dimencionamento. desenvolvido por Bradley Efron, Trevor Hastie, Iain Johnstone e Robert Tibshirani. RAM é semelhante à regressão progressiva passo-a-passo. Em ...
1,741
547
""" An X-ray illuminator is the bright plate that doctors put filters over in order to view x-ray images. In our problem, we are going to place various sizes of red and blue tinted cellophane randomly on top of a finite x-ray illuminator. If a given part of the illuminator is covered by only red filters, then the lig...
2,542
905
from typing import Optional import numpy as np from ... import BaseTask from assembly_gym.environment.generic import RobotComponent from .. import Reward class EndEffectorAccelerationReward(Reward[BaseTask]): """ A reward for punishing high (linear and angular) end-effector accelerations. """ def _...
2,410
709
# -*- coding: utf-8 -*- """Graphics cut line module containing :class:`~nodedge.graphics_cut_line.GraphicsCutLine` class. """ import logging from enum import IntEnum from typing import List, Optional from PySide2.QtCore import QEvent, QPointF, QRectF, Qt from PySide2.QtGui import QMouseEvent, QPainter, QPainterPath, Q...
6,525
1,862
import utils from utils import rf def countLines(inString): # split on newlines lines = inString.split("\n") # return the number of lines, as a string return str(len(lines))
192
61
from app import db from app.common.mixin import * class Profiles(TableMixin, db.Model): """Model Class""" __tablename__ = 'profiles' uid = db.Column(db.Integer, unique=True, index=True, nullable=False) career = db.Column(db.String(50), nullable=True) education = db.Column(db.String(255), nullable=...
1,359
510
def merge(): s = set() for i in range(10): filename = 'table'+str(i)+".txt" file_object = open('table'+str(i)+".txt",'r').read() table = file_object.split() for c in table: s.add(c) print(len(s)) file_object = open("merge_table3.txt",'w') file_text = "" for i in s: file_text += i + " " file_object....
367
165
# Distance is measured in Angstroms # Class represents a single grid point in a 3D window class grid_point: def __init__(gp, occupancy = 0, atom = None, coords = None, aa = None, diangle = None, distance_to_nearest_atom = None, nearest_atom = None,threshold = 3, atoms_within_threshold = None, dm = None): # Logical...
922
320
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^index$', views.index, name='index'), url(r'^peticion_ackley/$', views.peticion_ackley, name='peticion_ackley'), # para hacer peticion mediante el algoritmo Ackley url(r'^peticion_rastrigin/$', views...
426
161
""" Codemonk link: https://www.hackerearth.com/problem/algorithm/monk-being-monitor-709e0fd3/ Monk being the monitor of the class needs to have all the information about the class students. He is very busy with many tasks related to the same, so he asked his friend Mishki for her help in one task. She will be give...
2,898
826
# -*- coding: utf-8 -*- from django.core import serializers from django.db import models from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from homedisplay.utils import publish_ws import datetime import json def get_birthdays(selected_date): if selected_date == "all...
1,983
673
#!/usr/bin/env python2.7 # # This file is part of peakAnalysis, http://github.com/alexjgriffith/peaks/, # and is Copyright (C) University of Ottawa, 2014. It is Licensed under # the three-clause BSD License; see doc/LICENSE.txt. # Contact: griffitaj@gmail.com # # Created : AU1862014 # File : peak_functions # Autho...
10,531
3,480
import tensorflow as tf from TransformerNet.layers import Encoder, Decoder class Transformer(tf.keras.Model): def __init__(self, num_layers, d_model, num_heads, d_ff, input_vocab_size, target_vocab_size, pe_input, pe_target, drop_rate=0.1): super().__init__() self.encoder = Encoder(num_laye...
1,183
425
from Arknights.shell_next import _create_helper helper, context = _create_helper(use_status_line=False) helper.get_building()
126
40
# What to do upon calling "import skopje" from .skop import skop
65
22
from django.utils.translation import ugettext_lazy as _ from . import _callback class Command(_callback.Command): help = str(_('Deletes the callback from the target connectwise system.')) ACTION = 'delete'
216
62
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def mergeKLists(self, lists): head = pre = ListNode(None) nodeVals = [] for l in lists: while l: nodeVals.append(l.val) ...
470
144