text
string
size
int64
token_count
int64
import numpy as np import librosa import os from pytorch_sound.data.meta.ljspeech import LJSpeechMeta from torch.utils.data import Dataset, DataLoader from typing import Tuple class AudioDataset(Dataset): def __init__(self, meta_frame, crop_length: int, seed: int = 1234): self.meta_frame = meta_frame ...
2,250
783
"""Get the parsed query from the driver and apply transformation and action based on the query template """ import time import pyspark.sql.functions as f from pyspark.sql import SparkSession from pyspark.sql.types import IntegerType, StringType, StructField, StructType import yaml from schema import schema with ...
3,830
1,110
class Emote: smile = u"๐Ÿ˜„" satisfied = u"๐Ÿ˜†" blush = u"๐Ÿ˜Š" smiley = u"๐Ÿ˜ƒ" relaxed = u"โ˜บ๏ธ" smirk = u"๐Ÿ˜" heart_eyes = u"๐Ÿ˜" kissing_heart = u"๐Ÿ˜˜" kissing_closed_eyes = u"๐Ÿ˜š" flushed = u"๐Ÿ˜ณ" relieved = u"๐Ÿ˜Œ" grin = u"๐Ÿ˜" wink = u"๐Ÿ˜‰" stuck_out_tongue_winking_eye = u...
17,456
10,767
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'main_gui.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): ...
8,412
2,687
import os import yaml class Config(dict): def __init__(self, config_path): with open(config_path, 'r') as f: self._yaml = f.read() self._dict = yaml.load(self._yaml, Loader=yaml.FullLoader) self._dict['PATH'] = os.path.dirname(config_path) def __getattr__(self, na...
1,522
440
# # Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, # Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, # Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, # Jonas Koenemann, Yutao Chen, Tobias Schรถls, Jonas Schlagenhauf, Moritz Diehl # # This file is part of acado...
8,786
3,675
import httplib # Used only for handling httplib.HTTPException (case #26701) import os import sys import platform import re import urllib import urllib2 import traceback import time from StringIO import StringIO from multiprocessing import subprocess from kunai.log import logger from kunai.collector import Collector ...
2,820
733
#!/usr/bin/python3 # -*- coding: utf-8 -*- ''' 2017 ICPC at UCSY Problem-H: Sum Square ''' import sys class TestCase(): pass def parse_tc(tc): ''' Input: Test Case Update: Return: None ''' x = list(map(int,tc.infile.readline().split())) tc.dataset = x[0] tc...
1,560
647
""" Author: Peng Wu License: MIT """ # Initialize Spark Context: local multi-threads from pyspark import SparkConf, SparkContext output_folder = './csv/' def main(): # Initialize Spark Context: local multi-threads conf = SparkConf().setAppName("BTC-InputMapper") sc = SparkContext(conf=conf) # Load...
2,357
807
import torch from torch import nn as nn import numpy as np from .base import Readout class FullFactorized2d(Readout): """ Factorized fully connected layer. Weights are a sum of outer products between a spatial filter and a feature vector. """ def __init__( self, in_shape, out...
6,819
2,061
from flask import render_template,request, redirect, url_for from . import main from ..requests import get_articles, get_news_sources,get_top_headlines, get_news_category @main.route('/') def index(): ''' view root function that returns the idex page and its data ''' title="Welcome to your favorite new...
1,186
347
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2020 FABRIC Testbed # # 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 ...
6,904
1,893
from .node_view import NodeView from .node import Node from .nodes_view import NodesView from .nodes import Nodes
114
33
#!/usr/bin/env python # Author: Christian Vallentin <mail@vallentinsource.com> # Website: http://vallentinsource.com # Repository: https://github.com/MrVallentin/http_request # # Date Created: February 28, 2016 # Last Modified: February 29, 2016 # # Developed and tested using Python 3.5.1 import http.client, urllib....
1,927
715
import PyPDF2 merger = PyPDF2.PdfFileMerger() merger.append('data/src/pdf/sample1.pdf', pages=(0, 1)) merger.append('data/src/pdf/sample2.pdf', pages=(2, 4)) merger.merge(2, 'data/src/pdf/sample3.pdf', pages=(0, 3, 2)) merger.write('data/temp/sample_merge_page.pdf') merger.close() merger = PyPDF2.PdfFileMerger() m...
937
394
from transformers.data.processors.squad import SquadV1Processor, SquadV2Processor from transformers import squad_convert_examples_to_features import urllib.request import os def load_and_cache_examples(data_dir: str, tokenizer, task, max_seq_length, doc_stride, max_query_length, evaluate=False): if (task == "SQuAD...
1,983
641
import random import numpy as np import pandas as pd import trading_env # np.set_printoptions(threshold=np.nan) #df = pd.read_hdf('dataset/SGXTW.h5', 'STW') #df = pd.read_hdf('dataset/SGXTWsample.h5', 'STW') df = pd.read_csv('dataset/btc_indexed2.csv') print(df.describe()) env = trading_env.make(env_id='training_v1'...
898
301
#!/usr/bin/python3.4 # -*-coding:utf-8 -* """ https://openclassrooms.com/courses/apprenez-a-programmer-en-python/le-reseau ร€ LA FIN LE TERMINAL QUITTE PYTHON : DONC CE PROGRAMME NE MARCHE PAS !! """ # Les deux lignes prรฉcรฉdentes serviraient si je rendais ce fichier # directement exรฉcutable import socket # Construi...
1,253
481
import os import sys import time from tqdm import tqdm as print_progress import csv import json import logging import numpy as np import pandas as pd import random import cv2 from PIL import Image from matplotlib import pyplot as plt import re import requests from io import BytesIO from bs4 impo...
10,030
3,149
# -*- coding: utf-8 -*- import numpy as np import tensorflow as tf from inferbeddings.regularizers import TransEEquivalentPredicateRegularizer from inferbeddings.regularizers import DistMultEquivalentPredicateRegularizer from inferbeddings.regularizers import ComplExEquivalentPredicateRegularizer from inferbeddings.r...
6,584
2,628
""" Code illustration: 8.11 Chaos Game Tkinter GUI Application Development Blueprints """ import random from tkinter import Tk, Canvas import math WIDTH = 800 HEIGHT = 500 v1 = (float(WIDTH/2), 0.0) v2 = (0.00, float(HEIGHT)) v3 = (float(WIDTH), float(HEIGHT)) last_point = None root = Tk() canvas = Canvas(roo...
1,360
593
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import wagtail.wagtailcore.fields import wagtail.wagtailcore.blocks import datetime import wagtail.wagtailimages.blocks class Migration(migrations.Migration): dependencies = [ ('home', '0009_subscrib...
1,129
368
""" 17.17 Multi Search: Given a string b and an array of smaller strings T, design a method to search b for each small string in T. In - text: str, words: List[str] Out - List[str] lgget`s go to the party tonight? ['go', 'test', 'jump'] return ['go'] O(k^2 + n*t) time complexity, where k is the size of text, n is ...
2,083
676
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="replacefs", version="1.2.0", python_requires='>=3', author="yoarch", author_email="yo.managements@gmail.com", description="Search and replace CLI tool for strings on the all system", ...
793
254
""" modulegraph tests """
26
7
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys if __name__ == '__main__': A = list(map(int, input().split())) if len(A) != 10: print("ะะตะฒะตั€ะฝั‹ะน ั€ะฐะทะผะตั€ ัะฟะธัะบะฐ", file=sys.stderr) exit(1) s = 0 for item in A: if not ((item % 2) == 0): s += item x...
774
329
import requests import re import sys xml = re.compile(r'<.+>|\n') # queries using closed intervals [x,y], 1-based def get_segment(url, chrom, coords): r = requests.get(url, params={'segment': "{}:{},{}".format(chrom, *coords)}) if r.status_code == requests.codes.ok: return re.sub(xml, '', r.text).uppe...
687
244
import cmath import math import logging import random import plotly import pandas
82
21
# coding=utf-8 # Copyright 2018 The TF-Agents Authors. # # 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...
6,916
2,073
from invenio_oarepo_oai_pmh_harvester.register import Decorators from invenio_oarepo_oai_pmh_harvester.rules.utils import iter_array from invenio_oarepo_oai_pmh_harvester.transformer import OAITransformer @Decorators.rule("xoai") @Decorators.pre_rule("/dc/creator") def transform_creator(paths, el, results, phase, **k...
477
182
import unittest import queries class QueriesTestCase(unittest.TestCase): def test_get_rangevote_query(self): uuid = 1 get_rangevote_query = queries.GetRangeVoteQuery(uuid) self.assertEqual(uuid, get_rangevote_query.uuid) def test_get_rangevote_results_query(self): uuid = 1 ...
639
210
from MedipReport import ProjectTracker from CGATReport.Tracker import SingleTableTrackerRows, \ SingleTableTrackerEdgeList class ContextSummary(ProjectTracker, SingleTableTrackerRows): table = "context_stats" class GatFold(ProjectTracker, SingleTableTrackerEdgeList): '''fold change matrix.''' row =...
1,490
513
from tkinter import * from interfaces.functions import centralize from tkinter import messagebox from interfaces.functions import update_session_data_csv, update_clients_csv, get_current_balance class WithdrawalGUI: def __init__(self, frame, label): """ This __init__ method initializes the sub wi...
6,852
1,958
''' cardcollectordb URL Configuration ''' from django.contrib import admin from django.urls import include, path from account.views import SignUp urlpatterns = [ path('admin/', admin.site.urls), path('account/', include('account.urls'), name='account'), path('signup/', SignUp.as_view(), name='signup'), ]...
321
97
# Copyright 2021 The Kubeflow Authors # # 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...
1,829
560
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from datetime import datetime, date from decimal import Decimal from base import GAETestCase from notification_app.notification_model import Notification from routes.notifications import rest from gaegraph.model import Node from mock impor...
3,068
889
#!/usr/bin/env python ''' yamlcfg Bring in Configs into namespace ''' from yamlcfg.conf import Config as BaseConfig from yamlcfg.yml import YAMLConfig YMLConfig = YAMLConfig YamlConfig = YAMLConfig from yamlcfg.util import normalize, validate_ext from yamlcfg.env import check_env
285
92
# -*- coding: utf-8 -*- from scrapy.item import Item, Field class BigghostheadItem(Item): # ็”ตๅ•†็ฝ‘็ซ™็š„fields productId = Field() title = Field()# ๅ•†ๅ“ store = Field()# ๅบ—้“บ #ๆ–ฐ้—ปๅšๅฎข็š„fields text = Field()# ๆ–‡ๆœฌ keywords = Field()# ๅ…ณ้”ฎ่ฏ comment = Field() productId = Field()
294
122
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from ..modeldb import Lineage_pb2 as modeldb_dot_Lineage__pb2 class LineageServiceStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: cha...
5,008
1,603
import numpy import logging import theano import theano.tensor as TT from theano.gradient import grad_clip from sparnn.utils import * from sparnn.layers import Layer logger = logging.getLogger(__name__) class ConvLSTMLayer(Layer): def __init__(self, layer_param): super(ConvLSTMLayer, self).__init__(lay...
10,709
3,493
import base64 import glob import gzip def build_script(submission_name): script_template = open('script_template.tmpl') script = open('script/script_{name}.py'.format(name=submission_name), 'wt') file_data = {} for fn in glob.glob('mercari/*.py') + glob.glob('mercari/*.pyx'): content = open(f...
779
262
""" DOCSTRING """ import dash import dash.dependencies as dependencies import dash_core_components.Graph as Graph import dash_core_components.Input as Input import dash_html_components.Div as Div import dash_html_components.H1 as H1 app = dash.Dash() app.layout = Div(children=[Input(id='input', value='blank', type='te...
596
177
# My script to process the generated data # The temperature we want to aim for aimTemperature = float(30 + 273) # To halt the script import sys # Numpy matrices import numpy as np #Used to get the epoch time to calculate the time difference dt import datetime import time #Regular expressions import re # Generate rando...
18,106
5,864
""" graphjson module pull an event from neo4j and creates graphjson formated file to be used with AlchemyJS Written by Ray Bernard ray@suprfanz.com """ import json from neo4j.v1 import GraphDatabase, basic_auth from config import neo4j_dbip, neo4j_admin, neo4j_password session = GraphDatabase.driver("bolt://{}:7687"...
2,188
769
""" dataset.py defines a container for a training dataset. """ import os import torch from torchvision import datasets, transforms class Dataset: """ Dataset encapsulations training, validation, and testing datasets from a single top-level directory. """ def __init__(self, data_dir, batchsize): ...
2,507
795
# Copyright (C) 2012 - 2014 EMC Corporation. # # 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 # # Un...
3,659
1,277
# -*- coding: utf-8 -*- # Author : Manki Baek # e-mail : bmg8551@seculayer.co.kr # Powered by Seculayer ยฉ 2021 Service Model Team from mlps.core.data.cnvrtr.ConvertAbstract import ConvertAbstract class IPTransferDivide(ConvertAbstract): def __init__(self, **kwargs): super().__init__(**kwargs) sel...
710
277
import DBScrape import calendar import datetime import time import csv import sys import os days = 30 class roomAnalytics: energyDictionary = {} energyCounts = {} def backspace(self): print '\r', def roomData(self): databaseScrape = DBScrape.DBScrape() t = (2017, 5, 1, 0, 0, 0, 0, 0, 0) beginTime = calend...
2,327
1,057
import pytest from unittest import mock from reactive import kubernetes_master from charms.reactive import endpoint_from_flag, remove_state from charmhelpers.core import hookenv def patch_fixture(patch_target): @pytest.fixture() def _fixture(): with mock.patch(patch_target) as m: yield m ...
778
252
# # PySNMP MIB module HH3C-DOT3-EFM-EPON-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-DOT3-EFM-EPON-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:26:25 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (d...
57,058
25,875
import argparse from module_a.fun_1 import fun_1 from module_c.fun_4 import fun_4 from external_a.extra_fun import extra_fun def main(): parser = argparse.ArgumentParser() parser.add_argument( 'input_txt_file', help = 'Some input file', ) args = parser.parse_args() print('Run...
576
207
class Solution: def destCity(self, paths: List[List[str]]) -> str: dic = collections.defaultdict(list) for [x,y] in paths: dic[x].append(y) res = set() stack = [] stack.append(paths[0][0]) while stack: while dic[stack[-1]]: ...
395
118
from .Proxy import Proxy from robot.libraries.BuiltIn import BuiltIn import sys from robot.libraries.Screenshot import Screenshot from robot.api import logger import I18nListener as i18n import ManyTranslations as ui from robot.utils import unic class ListShouldContainSubListProxy(Proxy): def __init__(self, arg_fo...
3,039
943
# coding=utf-8 # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
3,218
1,089
import json class Config: def __init__(self, configPath): with open(configPath) as configFile: configFileContent = json.load(configFile) self.imageHeight = configFileContent['imageHeight'] self.imageWidth = configFileContent['imageWidth']
279
72
from time import sleep colors = {"clean": "\033[m", "red": "\033[31m", "green": "\033[32m", "yellow": "\033[33m", "blue": "\033[34m", "purple": "\033[35m", "cian": "\033[36m"} v = float(input("Enter the car speed was: ")) tic = (v - 80) * 7 print("{}Loading......
699
259
# # @lc app=leetcode id=687 lang=python3 # # [687] Longest Univalue Path # # https://leetcode.com/problems/longest-univalue-path/description/ # # algorithms # Easy (34.69%) # Likes: 1312 # Dislikes: 351 # Total Accepted: 76.5K # Total Submissions: 218.3K # Testcase Example: '[5,4,5,1,1,5]' # # Given a binary tre...
1,913
711
#!/usr/bin/env python2.7 # -*- coding: utf-8; mode: python; -*- """ Module for reading and processing GemaNet files. Constants: POS - list of parts-of-speech present in GermaNet RELTYPES - types of GermaNet relations Classes: Germanet - main class for processing GermaNet files """ #################################...
6,085
1,951
import sys sys.path.append('./python') import skyhook.common as lib import io import json import math import numpy import os import os.path import skimage.io import struct user_func = None # user_func will be defined by the exec call in meta_func def callback(*args): return user_func(*args) def meta_func(meta):...
493
159
# model eval def roc_curve(): pass
36
16
import ply.lex # # Lexer setup # instructions = ( 'NOP', 'INT', 'IPI', 'RETINT', 'CALL', 'RET', 'CLI', 'STI', 'HLT', 'RST', 'IDLE', 'PUSH', 'POP', 'INC', 'DEC', 'ADD', 'SUB', 'CMP', 'J', 'AND', 'OR', 'XOR', 'NOT', 'SHL', 'SHR', 'SHRS', 'LW', 'LS', 'LB', 'LI', 'LIU', 'LA', 'STW', 'STS', 'STB', 'MOV', 'SWP', 'MU...
2,836
1,337
from django.test import TestCase, override_settings from django.urls import reverse from rest_framework.test import APIClient from MyUser.models import User @override_settings(ACCOUNT_EMAIL_VERIFICATION='none') class TestAllAuthLogin(TestCase): def setUp(self): self.client = APIClient() self.user...
3,965
1,355
""" flashcards.commands.sets ~~~~~~~~~~~~~~~~~~~ Contains the commands and subcommands related to the sets resource. """ import os import click from flashcards import sets from flashcards import storage @click.group('sets') def sets_group(): """Command related to the StudySet object """ pass @click.comma...
1,478
453
"""Module containing imports for user entity feature set pipelines.""" from legiti_challenge.feature_store_pipelines.user.user_chargebacks import ( UserChargebacksPipeline, ) from legiti_challenge.feature_store_pipelines.user.user_orders import UserOrdersPipeline __all__ = ["UserChargebacksPipeline", "UserOrdersPi...
329
99
import numpy as np import struct import getpass import struct from datetime import datetime edge_curve = {} def _make_edge_curve(i,a,b,fp,v0,v1,s01): a_str = struct.pack('<fff',a[0],a[1],a[2]) b_str = struct.pack('<fff',b[0],b[1],b[2]) f_val = a_str+b_str r_val = b_str+a_str if f_val in edge_curve...
5,908
2,864
from django.apps import AppConfig class DjMailConfig(AppConfig): name = 'djmail' verbose_name = "DjMail" def ready(self): from . import signals super(DjMailConfig, self).ready()
209
66
from marshmallow import Schema, fields, validate class ChangePasswordSchema(Schema): id = fields.Number(attribute="id") oldPassword = fields.String(attribute="old_password", validate=validate.Length(min=8, max=256), required=True) password = fields.String(attribute="password", validate=validate.Length(min...
349
103
from styx_msgs.msg import TrafficLight import tensorflow as tf import numpy as np import rospy import cv2 import os MAX_IMAGE_WIDTH = 300 MAX_IMAGE_HEIGHT = 300 class TLClassifier(object): """Traffic light classifier based on a tensorflow model.""" def __init__(self, is_site=True): """Build, load a...
6,100
1,768
import os import serial import time import binascii import textwrap import re from wifi import WIFI_SSID, WIFI_PASS def ctrl(key): # Thank you https://github.com/zeevro/esp_file_sender/ return chr(ord(key.upper()) - ord('A') + 1) class Esp: def __init__(self, port, baudrate): super().__init__()...
3,554
1,293
from extension_native_helpers import * Dtool_PreloadDLL('libpandaode') from libpandaode import * from extension_native_helpers import * Dtool_PreloadDLL('libpanda') from libpanda import * def convert(self): if self.getClass() == OdeGeom.GCSphere: return self.convertToSphere() elif self.getClass() == Od...
3,909
1,369
import gi import json gi.require_version('Gtk', '3.0') from gi.repository import Gtk class NewNoteWindow(Gtk.Window): def __init__(self, nid): Gtk.Window.__init__(self, title="Note") with open('notes.json') as data_file: data = json.load(data_file) notes = data["notes"] ...
1,087
351
from homeserver.voice_control.google_speech import GoogleVoiceRecognition from homeserver.voice_control.snowboy.snowboydecoder import HotwordDetector, play_audio_file #make the voicecontrol follow the device interface structure for control from homeserver.interface import DeviceInterface, DeviceTarget # import the ...
4,588
1,602
# Name: HELLO WORLD # Author: Fenteale # # Notes: # This is just a tiny program meant to showcase what # a repository will look like when downloaded through # github. print("Hello World!") print("This is just meant to be a tiny program to show off what a repo looks like.") inp = input("Type something here: ") print...
451
133
from pyfirmata import Arduino, util import time board = Arduino('/dev/ttyACM0') while 1: board.digital[13].write(0) time.sleep(1) board.digital[13].write(1) time.sleep(1)
188
78
import pytest from Door import Door def test_find_password(): door_id = "abc" door = Door(door_id) assert(door.find_password() == "18f47a30") def test_find_password2(): door_id = "abc" door = Door(door_id) assert(door.find_password2() == "05ace8e3")
275
111
import FWCore.ParameterSet.Config as cms process = cms.Process("SiPixelCPEGenericErrorParmReaderTest") process.load("CondCore.DBCommon.CondDBSetup_cfi") process.load("FWCore.MessageService.MessageLogger_cfi") process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet( input = cms.untracked...
1,528
464
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry import test from benchmarks import silk_flags from measurements import smoothness import page_sets @test.Disabled # crbug.com/368767 class...
5,621
1,888
from setuptools import setup, find_packages setup(name='robot', version='1.0', author='Igor Couto', author_email='igorcouto@gmail.com', description='A project to execute a robot that performs several actions on the browser.', packages=find_packages(), license='MIT' )
315
93
#!/usr/bin/env python import argparse import boundary import functools import graphics import itertools import json import operator import os.path import random import re import secrets import sys import traceback from boundary import Boundary from boundary import Domain from boundary import Orientation from boundary...
31,103
10,048
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainpage.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import * class Ui_Form(object): def setupUi(self, Form): ...
11,029
3,760
""" @Author : liujianhan @Date : 2018/6/2 ไธŠๅˆ11:59 @Project : posture_classification @FileName : data_processor.py @Description : Placeholder """ import os from typing import Tuple import pandas as pd from keras.applications.resnet50 import preprocess_input from keras.preprocessing.ima...
2,890
1,019
from math import sqrt x1,y1=map(float,input().split()) x2,y2=map(float,input().split()) p1=x2-x1 p2=y2-y1 res=sqrt((p1*p1)+(p2*p2)) print("%.4f"%res)
150
83
from .pointer_network import PointerNetwork
43
10
from django.shortcuts import render, redirect from django.utils.datastructures import MultiValueDictKeyError def index(request): return render(request, "chat.html", {}) def logged(request): try : bot_name = request.POST["bot_name"] streamer_name = request.POST["streamer_name"] stream_...
985
278
""" Test class attributes. """ import numba from numba import * from numba.testing.test_support import parametrize, main def make_base(compiler): @compiler class Base(object): value1 = double value2 = int_ @void(int_, double) def __init__(self, value1, value2): se...
1,480
497
import time from datetime import datetime import pytest from pnp.plugins.pull import StopPollingError from pnp.plugins.pull.simple import CustomPolling from . import make_runner, start_runner @pytest.mark.asyncio async def test_poll(): events = [] def callback(plugin, payload): events.append(payload...
1,386
448
from picamera import PiCamera from time import * from cv2 import * import numpy as np import os from PIL import Image from .errors import * class RPICam: """A class for the raspberry pi camera Attributes: modelDetails: A dictionary containing details of the Camera imagePath: The ...
3,632
860
class Dummy: """ Class for use when given a pedigree to model. I create a 'dummy' for each individual with key information about that individual """ def __init__(self, parents, founder, children=[]): self.parents = parents self.founder = founder self.children = children...
1,568
473
from setuptools import setup, find_packages """ Uma biblioteca para leitura de arquivos CNAB 240. """ setup( name='sbcnab240', version='0.1.0', url='https://github.com/Superbuy-Team/sbcnab240/', license='MIT', author='SuperBuy Team', author_email='ti@superbuy.com.br', description='Uma bibl...
1,226
413
from mlib.proj.struct import Project from mlib.web.html import HTMLPage, Hyperlink, HTMLImage SKIPPED_SOURCE = [ '@log_invokation', 'global DOC', '@staticmethod' ] def scipy_doc_url(funname): return f'https://docs.scipy.org/doc/scipy/reference/generated/{funname}.html' FUN_LINKS = { 'bilinear': 'https...
860
324
#!/usr/local/bin/python3 import sys import os import shutil import markdown class Page(object): def __init__(self, filename, mtime): self.file_name = filename self.modified_at = mtime def main(argv): if len(argv) != 3: print("USAGE: markdown-journal.py source-dir output-dir") r...
3,607
1,178
#!/usr/bin/python from ansible.module_utils.basic import * def site_result(site, trusted_sites_download): rs = trusted_sites_download['results'] for r in rs: if r['site'] == site: return r msg = "Result for site {} not found in {}".format(site, rs) raise Exception(msg) def set_j...
1,090
367
"""Schemas Schemas Package more description """
53
17
from itertools import chain, combinations from re import search from urllib.parse import urlparse from pymongo.errors import BulkWriteError from tweepy import OAuthHandler, API from yaml import load as yaml_load, BaseLoader from objects.article import Article from objects.hashtag import Hashtag from objects.tweet imp...
5,829
2,183
import psycopg2 import pandas as pd from ensemble_compilation.utils import gen_full_join_query, print_conditions class DBConnection: def __init__(self, db_user="postgres", db_password="postgres", db_host="localhost", db_port="5432", db="shopdb"): self.db_user = db_user self.db_password...
3,985
1,099
# encoding: utf-8 # module Autodesk.AutoCAD.EditorInput calls itself EditorInput # from Acmgd, Version=24.0.0.0, Culture=neutral, PublicKeyToken=null, accoremgd, Version=24.0.0.0, Culture=neutral, PublicKeyToken=null # by generator 1.145 # no doc # no imports # no functions # classes class AddedKeywords(Enu...
137,967
43,896
from all_models_for_mock.models.M0001_mock import * from all_models_for_mock.models.M0002_keywords import * from all_models_for_mock.models.M0003_statisic_task import *
169
69
# This program reverses a given string def reverse(): user_string = input("Enter a string: ") s = user_string[::-1] print(s) reverse()
151
52
import copy import cmath import numpy import scipy.linalg from pauxy.estimators.thermal import greens_function, one_rdm_from_G, particle_number from pauxy.estimators.mixed import local_energy from pauxy.walkers.stack import PropagatorStack from pauxy.walkers.walker import Walker from pauxy.utils.linalg import regularis...
29,383
10,807
from collections import OrderedDict import os import re from schedules_tools.schedule_handlers.smart_sheet import ScheduleHandler_smartsheet import yaml DEFAULT_TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'templates') DEPENDENCY_REGEX = re.compile(r'^{(?P<to>predecessor|\d+)}(?P<type>[F|S]+)?' ...
1,607
528