text
string
size
int64
token_count
int64
from django.core.management.base import BaseCommand from django.contrib.auth import get_user_model from django.template.defaultfilters import slugify, linebreaks, date, truncatechars from wagtail.core.models import Page from wagtail.core.rich_text import RichText from migration.models import * from accounts.models im...
6,792
2,059
from django.apps import AppConfig class CountdowntimerModelConfig(AppConfig): name = 'countdowntimer_model'
114
37
import flask import restea.formats as formats from restea.adapters.base import ( BaseResourceWrapper, BaseRequestWrapper, ) class FlaskRequestWrapper(BaseRequestWrapper): ''' Object wrapping Flask request context. ''' @property def data(self): ''' Returns a payload sent to...
3,206
852
#!/usr/bin/env python # Create/update LDAP entries from custom directory to opendirectory schema import binascii import os import re import sys cmtcre = re.compile(r'#.*$') try: filename = sys.argv[1] except IndexError: filename = os.path.join(os.path.expanduser('~'), 'Desktop', 'openldap.ldif') def get_us...
3,265
1,030
NAME="Time with DST" UUID=0x2A11
33
19
print('Grocery list:') print('"add" to add items and "view" to view list') grocery_list = [] while True: command = input('Enter command: ') if command == 'add': to_add = input('Enter new item: ') grocery_list.append(to_add) # elif stands for "else if" elif command == 'view': for ...
429
140
from datetime import datetime from tts import tts def take_notes(speech_text): words_of_message = speech_text.split() words_of_message.remove("note") cleaned_message = ' '.join(words_of_message) f = open("notes.txt", "a+") f.write("'" + cleaned_message + "'" + " - note taken at: " + datetime.strfti...
777
275
import csv import json def pair_entity_ratio(found_pair_set_len, entity_count): return found_pair_set_len / entity_count def precision_and_recall(found_pair_set, pos_pair_set, neg_pair_set=None): # if a neg_pair_set is provided, # consider the "universe" to be only the what's inside pos_pair_set and neg...
1,813
633
from enum import Enum from urllib.parse import urlparse from src.couchdb import CouchDB class Replication: _RETRY_LIMIT = 3 class ReplType(Enum): All = 1 Docs = 2 Designs = 3 def __init__(self, model, source, target, continuous=False, create=False, drop_first=False, repl_type=Re...
5,084
1,525
#!/usr/bin/env python # coding: utf-8 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Jan 5 2021 @author: Yuxuan Zhang based on the Iso-MPS codes """ #%% -- IMPORTS -- import sys sys.path.append("..") # import one subdirectory up in files # external packages import numpy as np import qiskit as qk import...
11,001
3,179
''' Docker Monitor component For more details about this component, please refer to the documentation at https://github.com/aneisch/docker_monitor ''' import logging from homeassistant.components.switch import ( ENTITY_ID_FORMAT, PLATFORM_SCHEMA, SwitchDevice ) from homeassistant.const import ( ATTR_A...
2,553
791
# pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name # pylint:disable=no-member # pylint:disable=protected-access # pylint:disable=too-many-arguments import re import shutil import tempfile import threading from collections import namedtuple from pathlib import Path ...
23,240
7,111
import sys import click from sonic_py_common import multi_asic, device_info platform_sfputil = None def load_platform_sfputil(): global platform_sfputil try: import sonic_platform_base.sonic_sfp.sfputilhelper platform_sfputil = sonic_platform_base.sonic_sfp.sfputilhelper.SfpUtilHelper() ...
1,282
421
# data structure module
24
6
import tempfile from urllib.request import urlretrieve, urlopen from urllib.error import URLError import pyscipopt as scip import os import pandas as pd class Loader: def __init__(self, persistent_directory=None): """ Initializes the MIPLIB loader object Parameters ---------- ...
5,227
1,554
/******************************************************* * Copyright (C) 2013-2014 Daniel Kaczmarek <dankaczma@gmail.com>, Simulation Based Engineering Lab <sbel.wisc.edu> * Some rights reserved. See LICENSE * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file at the top...
40,723
12,900
# Python code for assembling S$G-based local bar-size and fraction dataset # # ListDataFrame with # name, M_star, B-V_tc, g-r_tc, a_max_obs[arcsec, kpc], amax_dp[arcsec, kpc], distance, # distance_source, inclination # distance_source = direct (Cepheids, SBF, TRGB, etc), T-F, redshift # # Two separate datasets...
22,139
11,169
#!/usr/bin/python import Adafruit_SSD1306 import os from retrying import retry from PIL import Image, ImageDraw, ImageFont class Oled: def __init__(self, display_bus, font_size): # declare member variables self.draw = None self.font = None self.disp = None self.width = Non...
2,166
711
from configargparse import ArgParser from PIL import Image import logging import numpy as np import os def transform_and_save(img_arr, output_filename): """ Takes an image and optionally transforms it and then writes it out to output_filename """ img = Image.fromarray(img_arr) img.save(output_file...
7,180
2,574
import os import json import boto3 def handler(event, context): table = os.environ.get('table') dynamodb = boto3.client('dynamodb') item = { "name":{'S':event["queryStringParameters"]["name"]}, "location":{'S':event["queryStringParameters"]["location"]}, "age":{'S':even...
615
190
""" Module for Gemini FLAMINGOS. .. include:: ../include/links.rst """ import os from pkg_resources import resource_filename from IPython import embed import numpy as np from pypeit import msgs from pypeit import telescopes from pypeit.core import framematch from pypeit.images import detector_container from pypeit....
13,528
4,294
import numpy as np from mllearn.problem_transform import BinaryRelevance from mllearn.problem_transform import CalibratedLabelRanking from mllearn.problem_transform import ClassifierChain from mllearn.problem_transform import RandomKLabelsets from mllearn.alg_adapt import MLKNN from mllearn.alg_adapt import MLDecisionT...
2,266
793
""" This Python modules describes an application that checks for active steam downloads and shuts down the computer when they are all finished. """ import os import signal import threading import subprocess import winreg as reg import tkinter as tk import tkinter.filedialog import tkinter.messagebox import tkinter.scr...
8,713
2,614
# -*- coding: utf-8 -*- __author__ = 'Fanzhong' from flask import Flask, render_template from boto.s3.connection import S3Connection from boto.s3.key import Key import json app = Flask(__name__) ''' This is my website index I'll create my website from now data: 2015.04.10 ''' def get_from_s3(): conn = S3Connectio...
1,200
447
# # Copyright (c) 2020, Neptune Labs Sp. z o.o. # # 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...
14,483
3,657
from ..utils.reporter import report class RegressorDevice(): tape = [] regressor = None @staticmethod def init(regressor): RegressorDevice.tape = [] RegressorDevice.regressor = regressor @staticmethod def reset(): RegressorDevice.tape = [] @staticmethod def a...
1,725
595
from __future__ import absolute_import, division, print_function from libtbx import test_utils import libtbx.load_env #tst_list = [ # "$D/regression/tst_py_from_html.py" # ] tst_list = [ "$D/regression/tst_1_template.py", "$D/regression/tst_2_doc_high_level_objects.py", "$D/regression/tst_3_doc_model_manager....
679
303
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 7 08:53:18 2021 @author: sblair """ import numpy as np import scipy.integrate as integrate from scipy.optimize import fsolve import matplotlib.pyplot as plt L_hx = 30; # cm, length of the heat exchanger nX = 100; # number of points in the x-dire...
1,520
722
import os from starlette.applications import Starlette from starlette.responses import PlainTextResponse, Response from starlette.testclient import TestClient from apistar.client import Client, decoders app = Starlette() @app.route("/text-response/") def text_response(request): return PlainTextResponse("hello,...
3,355
1,078
import os, json from collections import Counter # test if exist and mkdir # ../Results/features/corpus_info/ # ../Results/labels for col in ["FEATS", "PARSEME:MWE", "UPOS", "XPOS", "DEPREL", "DEPS", "LEMMA"]: for file_type in ["train.cupt", "dev.cupt", "test.blind.cupt"]: counter_dict = dict() count_all = Counte...
2,834
1,431
#!/usr/bin/env python3 import sys from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, FileType from Bio import Entrez from rex.util import batchify def parse_args(argv): parser = ArgumentParser(description="eutil", formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument( "eutil", def...
1,403
510
#!/usr/bin/python3 import sys import argparse import math parser = argparse.ArgumentParser(description='Post-processing after labeling, please put your rating in a file with ' 'the same order as in docs.txt, one rating per line.') parser.add_argument('--doc', required=Tru...
3,594
1,248
"""Benchmark-based class. """ import opytimark.utils.exception as e class Benchmark: """A Benchmark class is the root of any benchmarking function. It is composed by several properties that defines the traits of a function, as well as a non-implemented __call__ method. """ def __init__(self, n...
4,273
1,193
from pyrogram.types import CallbackQuery from .variables import USER_ID from pyrogram.errors import MessageNotModified def alert_user(func): async def wrapper(_, cb: CallbackQuery): if cb.from_user and not cb.from_user.id in USER_ID: await cb.answer( f"Sorry, but you can't use this userbot ! make your o...
468
183
from cachetclient.v1.client import Client # noqa from cachetclient.v1.subscribers import Subscriber # noqa from cachetclient.v1.components import Component # noqa from cachetclient.v1.component_groups import ComponentGroup # noqa from cachetclient.v1.incident_updates import IndicentUpdate # noqa from cachetclient...
481
170
from django.contrib import admin from establishment.documentation.models import DocumentationEntry admin.site.register(DocumentationEntry)
141
32
import libs.parsers.parser import libs.parsers.constructor __all__ = ['parser', 'constructor']
96
31
from __future__ import absolute_import from __future__ import division from __future__ import print_function import _init_paths import os import cv2 from opts import opts from detectors.detector_factory import detector_factory import pandas as pd import json image_ext = ['jpg', 'jpeg', 'png', 'webp'] video_ext = ['...
3,732
1,262
#!/usr/bin/env python """Gourde example.""" import argparse import flask from gourde import Gourde # Optional API. try: import flask_restplus except ImportError: flask_restplus = None class Error(Exception): """All local errors.""" pass # This could be as simple as : # gourde = Gourde(app) # app...
1,849
629
from precise.skaters.covariance.allcovskaters import ALL_D0_SKATERS from precise.skaters.covarianceutil.likelihood import cov_skater_loglikelihood from uuid import uuid4 import os import json import pathlib from pprint import pprint import traceback from collections import Counter from momentum.functions import rvar fr...
4,963
1,584
import numpy as np import tensorflow as tf class Positive_Collective_Matrix_Factorization: """ Our proposed model PCMF. Attributes ---------- X : numpy.ndarray Y : numpy.ndarray alpha : int Y weight of loss function. d_hidden : int Number of potential topics. ...
7,995
2,474
class Solution: # @return an integer def uniquePaths(self, m, n): if ((m == 0) or (n == 0)): return 0 if (n > m): return self.uniquePaths(n, m) row = [1] * m for i in range(1, n): # print row r2 = [1] last = 1 ...
447
152
import re import scrapy import util from ScanningSpider.items import CVEItem from ScanningSpider.items import CVEDetailItem class CVEDetails(scrapy.Spider): name = "cve_detail" allowed_domains = ['cvedetails.com'] base_url = 'https://www.cvedetails.com/vulnerability-list/year-' baer_detail_url = "https...
5,080
1,835
# # Source Code Management # ====================== # # %%LICENSE%% # import os import re from dep import opts from dep.helpers import * class Repository: def __init__(self, work_dir, url, vcs, name): self.work_dir = work_dir self.url = url self.vcs = vcs self.name = name se...
21,383
6,523
try: from asyncio import Future, iscoroutine, ensure_future # type: ignore except ImportError: class Future: # type: ignore def __init__(self): raise Exception("You need asyncio for using Futures") def set_result(self): raise Exception("You need asyncio for using Fut...
966
277
"""Example script for setting up and solving a flexible building optimal operation problem.""" import matplotlib.pyplot as plt import numpy as np import pandas as pd import pyomo.environ as pyo import fledge.config import fledge.database_interface import fledge.der_models import fledge.electric_grid_models import fle...
3,579
1,056
""" For a given positive integer n determine if it can be represented as a sum of two Fibonacci numbers (possibly equal). Example For n = 1, the output should be fibonacciSimpleSum2(n) = true. Explanation: 1 = 0 + 1 = F0 + F1. For n = 11, the output should be fibonacciSimpleSum2(n) = true. Explanation: 11 = 3 + 8 ...
1,307
464
""" Advent of Code : Day 09 """ from os import path def parse_input(filename): """ Parse input file values """ script_dir = path.dirname(__file__) file_path = path.join(script_dir, filename) with open(file_path, "r") as file: val = list(map(int, file.read().splitlines())) return val d...
1,291
418
# Generated by Django 3.1.7 on 2021-02-21 13:37 import companies.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('companies', '0002_auto_20210221_1408'), ] operations = [ migrations.CreateModel( name='Email', ...
1,746
522
# @Title: 最长回文子串 (Longest Palindromic Substring) # @Author: KivenC # @Date: 2019-06-12 15:25:33 # @Runtime: 136 ms # @Memory: 13.1 MB class Solution: def longestPalindrome(self, s: str) -> str: # # way 1 # # 从回文串的中心向两边扩展,O(n^2) # # 分奇数串和偶数串 # if len(s) < 2: # return s ...
1,622
660
#!/usr/bin/env python3 ''' ============================================================== Copyright © 2019 Intel Corporation SPDX-License-Identifier: MIT ============================================================== ''' import intel.tca as tca target = tca.get_target(id="whl_u_cnp_lp") components = [(c.component,...
1,176
334
# Copyright 2022 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import pathlib import subprocess import sys from run_assembly import run_product_assembly def main(): parser = argparse.ArgumentParser(...
1,570
463
# -*- coding: utf-8 -*- import logging from celery.result import AsyncResult from tastypie.resources import ModelResource, ALL_WITH_RELATIONS, Resource from tastypie import fields from tastypie.fields import ListField from tastypie.authentication import ApiKeyAuthentication, MultiAuthentication, SessionAuthentication...
7,388
2,061
from cvpro import stackImages import cv2 cap = cv2.VideoCapture(0) while True: success, img = cap.read() imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) imgList = [img, img, imgGray, img, imgGray] imgStacked = stackImages(imgList, 2, 0.5) cv2.imshow("stackedImg", imgStacked) cv2.w...
331
141
from datetime import datetime from app.models import Assessment, User def test_new_user(): new_user = User('usernam1', 'password', datetime(2020, 1, 1), True) assert new_user.username == 'usernam1' assert new_user.password != 'password' assert new_user.signup_date == datetime(2020, 1, 1) assert ne...
513
181
# -*- coding: utf-8 -* from datetime import datetime from slack_sdk import WebClient from slack_sdk.errors import SlackApiError import dataset import logging import dotenv import signal import sys import os class SlackHandler(logging.Handler): def __init__(self, token, channel, username): super().__init...
2,390
850
from capstone import Cs, CsError, cs_disasm_quick, cs_version, CS_API_MAJOR, CS_API_MINOR, CS_ARCH_ARM, CS_ARCH_ARM64, CS_ARCH_MIPS, CS_ARCH_X86, CS_MODE_LITTLE_ENDIAN, CS_MODE_ARM, CS_MODE_THUMB, CS_OPT_SYNTAX, CS_OPT_SYNTAX_INTEL, CS_OPT_SYNTAX_ATT, CS_OPT_DETAIL, CS_OPT_ON, CS_OPT_OFF, CS_MODE_16, CS_MODE_32, CS_MOD...
373
202
#!/usr/bin/env python3 from collections import defaultdict import random import sys from preprocess import ( preprocess_sentence ) from data import ( load_df ) class MarkovChain: def __init__(self, lookback=2): self.trie = defaultdict(lambda : defaultdict(int)) self.lookback = lookback ...
2,841
892
#!/usr/bin/python2 from pprint import PrettyPrinter from argparse import ArgumentParser def parse_image_header(input_file): comment = None for num, line in enumerate(input_file): line = line.strip() if num == 0: # First line, has to be a comment with the version, but we don't ...
4,042
1,287
from http.server import HTTPServer, SimpleHTTPRequestHandler class RepoRequestHandler(SimpleHTTPRequestHandler): def _set_headers(self): self.send_response(200) self.send_header("Content-type", "text/plain") self.end_headers() def _encode(self, text): return text.encode('utf8'...
834
270
print('='*8,'Inscritos','='*8) from module.interface import * from time import sleep menu('Lista de Inscritos') with open('Inscritos.txt') as arq: for o, n in enumerate(arq): print(f'\033[35m{o + 1}\033[m \033[36m{n.title()}\033[m') sleep(0.4) print('-' * 40) while True: r = ' ' while r no...
719
312
import pandas as pd import numpy.testing as npt from pulse2percept.datasets import load_nanduri2012 def test_load_nanduri2012(): data = load_nanduri2012(shuffle=False) npt.assert_equal(isinstance(data, pd.DataFrame), True) columns = ['subject', 'implant', 'electrode', 'task', 'stim_class', ...
1,771
712
from ._base import APIEndPoint class SatellitesAPIEndPoint(APIEndPoint): name = 'satellites' def _list_url(self, **filters): return self._build_url('satellites', **filters) def _detail_url(self, norad_number): return self._build_url('satellites', norad_number)
293
101
#!/usr/bin/env python # coding: utf-8 # In[1]: import dask from dask_kubernetes import KubeCluster import numpy as np # In[ ]: #tag::remote_lb_deploy[] # In[2]: # Specify a remote deployment using a load blanacer, necessary for communication with notebook from cluster dask.config.set({"kubernetes.scheduler-s...
1,096
453
from django.test import TestCase from factories import ImageFactory, ThumbnailImageFactory, ThumbnailFilterFactory from faker import Faker from django.contrib.auth.models import User fake = Faker() class UserModelTest(TestCase): pass class ImageModelTest(TestCase): def setUp(self): self.image = Image...
1,329
417
# Licensed under an MIT open source license - see LICENSE from __future__ import print_function, absolute_import, division import pytest from ..statistics.rfft_to_fft import rfft_to_fft from ._testing_data import dataset1 import numpy as np import numpy.testing as npt try: import pyfftw PYFFTW_INSTALLED = ...
1,189
523
import matplotlib.pyplot as plt import numpy as np # projection method: Chapter 3, Grimm & Schreiber, 2002 basis = [] for i in range(5): a = np.pi * 0.4 * i basis.append([np.cos(a), np.sin(a), np.cos(2 * a), np.sin(2 * a), np.sqrt(0.5)]) basis = np.transpose(basis) def lattice(en=2): # 5D lattice s = (e...
2,344
998
from sys import stdin # Main program def main(): expenses = [0]*1000 for line in stdin: n = int(line) if (n == 0): break; total, toExchangePos, toExchangeNeg = (0,)*3 for i in range(n): line = stdin.readline() expenses[i] = float(line) ...
872
285
from contest import models from django.utils import timezone from contest.functions import is_contest_on, contest_phase def contest_time(request): context = {} now = timezone.now() contest = models.ContestControl.objects.first() if now < contest.start: time = contest.start elif contest.sta...
548
157
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 Tigera, Inc. All rights reserved. # Copyright (c) 2015 Cisco Systems. 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 #...
17,852
5,630
#!/usr/bin/env python3 # TODO: Write a command line tool to browser and search in the database # TODO: Define a command set to search for strings, tags, similar talks, mark talks as seen, mark talks as irrelevant, mark talks as relevant, open a browser and watch, show details, quit # https://opensource.com/article/...
2,716
742
import random # num = random.random() para numeros de 0 e 1 num = random.randint(1, 10) print(num) '''import random 'choice' n1 = str(input('Primeiro aluno: ')) n2 = str(input('Segundo aluno: ')) n3 = str(input('Terceiro aluno: ')) n4 = str(input('Quarto aluno: ')) lista = [n1, n2, n3, n4] escolha = random.choice(lis...
587
253
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'help.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("F...
1,520
592
import os from collections import deque import numpy as np from OpenGL.GL import * import lib.basic_shapes as bs import lib.easy_shaders as es import lib.transformations as tr class GameOver: def __init__(self): self.GPU = deque([ es.toGPUShape(bs.createTextureCube(os.path.join('mod', 'tex', ...
1,729
662
""" The pycity_scheduling framework Copyright (C) 2022, Institute for Automation of Complex Power Systems (ACS), E.ON Energy Research Center (E.ON ERC), RWTH Aachen University Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softwa...
4,571
1,400
""" API functionality for bootcamps """ import logging from datetime import datetime, timedelta import pytz from django.core.exceptions import ValidationError, ObjectDoesNotExist from django.db.models import Sum from applications.constants import AppStates from ecommerce.models import Line, Order from klasses.constan...
13,394
4,000
# -*- coding: UTF-8 -*- # vim: set expandtab sw=4 ts=4 sts=4: # # phpMyAdmin web site # # Copyright (C) 2008 - 2016 Michal Cihar <michal@cihar.com> # # This program 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 Foundati...
1,745
511
import collections import csv import os import sys from enum import Enum from pathlib import Path # adapt paths for jupyter module_path = os.path.abspath(os.path.join('..')) if module_path not in sys.path: sys.path.append(module_path) import face_alignment from yawn_train.src.blazeface_detector import BlazeFaceD...
17,082
6,134
"""Diagnostics support for Launch Library.""" from __future__ import annotations from typing import Any from pylaunches.objects.event import Event from pylaunches.objects.launch import Launch from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers....
1,223
349
"""Tests for mlpiot.base.vision_pipeline_manager""" import unittest from mlpiot.base.action_executor import ActionExecutor from mlpiot.base.event_extractor import EventExtractor from mlpiot.base.scene_descriptor import SceneDescriptor from mlpiot.base.trainer import Trainer from mlpiot.base.vision_pipeline_manager im...
2,894
830
#!/usr/bin/env python3 import re import numpy as np start = 168630 stop = 718098 double = re.compile(r'(\d)\1') triple = re.compile(r'(\d)\1\1') def is_decreasing(num): previous = None for digit in str(num): if not previous: previous = digit continue if previous > digit...
1,176
405
# coding: utf-8 """ Layered Insight Assessment, Compliance, Witness & Control LI Assessment & Compliance performs static vulnerability analysis, license and package compliance. LI Witness provides deep insight and analytics into containerized applications. Control provides dynamic runtime security and analyti...
4,170
1,152
# Copyright (c) 2018, INRIA # Copyright (c) 2018, University of Lille # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, thi...
6,056
1,809
# -*- coding: utf-8 -*- from .._protos.public.uac import Organization_pb2 as _Organization from .._protos.public.common import CommonService_pb2 as _CommonCommonService class CollaboratorType: def __init__(self, global_collaborator_type=None, default_repo_collaborator_type=None, default_endpoint_...
3,700
1,028
# coding: utf-8 import numpy as np from copy import deepcopy from functools import partial from utmLib import utils from utmLib.ml.graph import Node, Graph from pdb import set_trace class BayesianNetwork: def __init__(self,g,ev): assert(g.digraph), "Only directed graph allowed" for i in range(g.N): ...
25,770
13,116
import pybullet as p import time import math import pybullet_data def drawInertiaBox(parentUid, parentLinkIndex, color): dyn = p.getDynamicsInfo(parentUid, parentLinkIndex) mass = dyn[0] frictionCoeff = dyn[1] inertia = dyn[2] if (mass > 0): Ixx = inertia[0] Iyy = inertia[1] Izz = inertia[2] ...
20,411
7,179
""" TensorMONK's :: architectures :: ESRGAN """ __all__ = ["Generator", "Discriminator", "VGG19"] import torch import torch.nn as nn import torchvision from ..layers import Convolution class DenseBlock(nn.Module): r"""From DenseNet - https://arxiv.org/pdf/1608.06993.pdf.""" def __init__(self, tensor_size: t...
7,163
2,503
# -*- coding: utf-8 -*- # # This class was auto-generated from the API references found at # https://epayments-api.developer-ingenico.com/s2sapi/v1/ # from ingenico.connect.sdk.data_object import DataObject class DeviceFingerprintRequest(DataObject): __collector_callback = None @property def collector_c...
1,291
331
# # Copyright (C) 2018 The Android Open Source Project # # 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 la...
3,418
1,822
class PrintDictResults: def __init__(self, dict_of_sorted_words): self.list_of_sorted_words = dict_of_sorted_words def print_items(self, counter): print(f'{counter + 1}. "{self.list_of_sorted_words[counter][1]}" : {self.list_of_sorted_words[counter][0]}') def get_all_words(self): f...
559
195
import bpy try: import bge except: print("no bge module") ## This array of binary strings defines each of 256 characters binary=["0011110000100000001000000111100000100000011000001010110000000000","0100010001001000010100000010110001000100000010000001110000000000","01000100010010000101000000101100010101000...
20,594
17,819
"""Example for Pytest-Gherkin""" import ast from pytest import approx from pt_gh import step, value_options operator = value_options("add", "subtract") @step("I have {num1:d} and {num2:d}") def given_numbers_i(num1, num2, context): """Example of parameter types converted based on annotation and context i...
2,732
879
#!/usr/bin/env python3 import logging import subprocess import re import boto.utils from jinja2 import Environment, FileSystemLoader from taupage import get_config logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) TPL_NAME = 'td-agent.conf.jinja2' TD_AGENT_TEMPLATE_PATH = '/etc/td-agent/t...
8,901
2,971
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # The MIT License # # Copyright (c) 2016 Grigory Chernyshev # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation file...
9,323
2,635
import discord import asyncio import json import asyncpg from discord.ext import commands from discord.ext import tasks class Tasks(commands.Cog): def __init__(self, client): self.client = client print(f'{__name__} 로드 완료!') self.change_status.add_exception_type(asyncpg.Postgr...
1,313
480
from controllers.type_result import Error def unknownError(err): return Error(10001,"Unknown error",err) def invalidParamError(field,condition,err): return Error(10007, "Invalid field(%s: %s)"%(field, condition), err) def parameterParsingError(err): return Error(10008, "Parameter parsing error", err) d...
1,103
384
import numpy as np import math from scipy.optimize import minimize class Optimize(): def __init__(self): self.c_rad2deg = 180.0 / np.pi self.c_deg2rad = np.pi / 180.0 def isRotationMatrix(self, R) : Rt = np.transpose(R) shouldBeIdentity = np.dot(Rt, R) I = np.id...
3,357
1,518
""" Freyr - A Free stock API """ import random import requests.utils header = [ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:83.0) Gecko/20100101 Firefox/83.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0)...
9,133
5,137
from mixcoatl.admin.billing_code import BillingCode from mixcoatl.geography.region import Region from mixcoatl.admin.group import Group from mixcoatl.admin.user import User def get_servers(servers, **kwargs): """ Returns a list of servers Arguments: :param servers: a list of servers that needs to be filt...
8,581
2,591
#! /usr/bin/env python from ROOT import TCanvas, TGraphErrors, TLegend, TPaveText from ROOT import kBlack, kBlue, kRed from Helper import Frame, ReadHistList from Graphics import Style from SpectrumContainer import DataContainer from copy import deepcopy class PeriodComparisonPlot: def __init__(self): ...
8,443
2,742