text
string
size
int64
token_count
int64
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-16 15:26 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('climatemodels', '0043_auto_20170116_1623'), ] operations = [ migrations.RenameModel...
412
160
import numpy import os import json import cv2 import csv import os.path as osp import mmcv import numpy as np def isgood(w,h): if w<2 or h<2: return False if w /h >10.0 or h/w >10.0: return False return True def bbox_iou(box1, box2): b1_x1, b1_y1, b1_x2, b1_y2 = box1 ...
13,528
4,748
#!/usr/bin/env python3 # Copyleft 2021 Sidon Duarte # import http import sys from typing import Any import colorama import requests from rabbitgetapi import cli from rabbitgetapi import exceptions from rabbitgetapi import build_parser def main() -> Any: try: result = cli.dispatch(sys.argv[1:]) excep...
1,121
372
from typing import Union, Iterable import hashlib def hash_id(seeds:Union[str, Iterable], n:int=32)->str: """For the moment, use the default simple python hash func """ h = hashlib.sha256(''.join(seeds)).hexdigest()[:n] return h
245
84
import os import numpy as np import torch from torch.utils.data import Dataset import math import torch import torch.nn.functional as F import random import torchvision.datasets from torchvision.transforms import * from torch.utils.data import DataLoader from torchvision import datasets, transforms from PIL import Imag...
12,182
4,433
print(lambda x: x*x (10)) # may give address of lambda function
67
25
from app import crud from app.db.database import get_default_bucket from app.models.config import ITEM_DOC_TYPE from app.models.item import ItemCreate, ItemUpdate from app.tests.utils.user import create_random_user from app.tests.utils.utils import random_lower_string def test_create_item(): title = random_lower_...
3,029
943
MODEL_PATH = "./model/model.pt"
32
16
##**************************************************************************************## ## Step1. Load Packages and Input Data ## ##**************************************************************************************## import pandas as pd import nu...
12,271
5,181
name = "testspeed" from time import time from sys import argv from os import system tic = time() system('python %s' % (argv[1])) toc = time() print('used %s seconds' % (toc - tic))
189
70
from osgeo import ogr from typing import List, Union import math import os import warnings import numpy as np from gdalhelpers.checks import values_checks, datasource_checks, layer_checks from gdalhelpers.helpers import layer_helpers, datasource_helpers, geometry_helpers def create_points_at_angles_distance_in_direct...
6,660
1,910
import unittest from rotor_tests import * from rotor_settings_tests import * from reflector_tests import * from enigma_tests import * unittest.main()
151
46
from werkzeug import find_modules, import_string from forums import routes from forums.modifications import modify_core def init_app(app): with app.app_context(): for name in find_modules('forums', recursive=True): import_string(name) app.register_blueprint(routes.bp) modify_core()
320
95
"""Routes related to ingesting data from the robot""" import os import logging from pathlib import Path from flask import Blueprint, request, current_app from pydantic import ValidationError from werkzeug.utils import secure_filename from polybot.models import UVVisExperiment logger = logging.getLogger(__name__) b...
1,380
407
#dependency Module class AppModule: @singleton @provider def provide_business_logic(self, api: Api) -> BusinessLogic: return BusinessLogic(api=api) @singleton @provider def provide_api(self) -> Api: configuration return Api() if __name__ == '__main__': injector ...
405
132
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
639
167
# This file is part of beets. # Copyright 2015 # # 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, pu...
1,572
457
import tools.libtcod.libtcodpy as libtcod class Console(object): def __init__(self, x=[0,0], y=[0,0], parent_console=None): self._settings = { "x": x, "y": y, "Parent_Console": parent_console } self._settings["Width"] = int(max(self._settings["x"][1], se...
1,714
520
# MINLP written by GAMS Convert at 04/21/18 13:54:11 # # Equation counts # Total E G L N X C B # 497 61 388 48 0 0 0 0 # # Variable counts # x b i s1s s2s sc ...
48,942
30,870
# coding=utf8 # Copyright 2018 JDCLOUD.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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
1,236
396
from rest_framework import status from django.urls import reverse from authors.apps.articles.models import Article from authors.base_test_config import TestConfiguration slug = None class TestLikeDislike(TestConfiguration): """ Class to test for liking and disliking of articles. """ def create_artic...
3,462
936
# ------------------------------------------------------------ # Training script example for Keras implementation # # Kaisar Kushibar (2019) # kaisar.kushibar@udg.edu # ------------------------------------------------------------ import os import sys import numpy as np from functools import partial from tkinter import...
6,843
2,314
""" ======================= Yahoo Finance source ======================= """ import re import requests import time from json import loads from bs4 import BeautifulSoup from yahoofinancials import YahooFinancials # Yahoo Finance data source class YahooFinanceSource(YahooFinancials): def __init__(self, ticker): ...
3,875
1,204
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class EnterpriseItem(scrapy.Item): # define the fields for your item here like: searchTime = scrapy.Field() searchCriteria = scrapy.Field() ...
695
228
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 12 10:02:58 2020 @author: Xavier Jimenez """ #------------------------------------------------------------------# # # # # # Imports # # # # # #------------------------------------------------------------------# import numpy as np import os import ...
26,510
8,005
#!/usr/bin/env python import betterwin G=betterwin.confcfg.load_global_config() def read_skell(skel): with open(skel) as template: tpl= template.readlines() def head(tpl): for idx,line in enumerate(tpl): if 'cfg_start' in line: header=tpl[0:idx] return header def bottom(tpl): for idx,line in ...
776
349
import torch.nn as nn import torch import torch.nn.functional as F import absl.flags as flags from absl import app FLAGS = flags.FLAGS # Point_center encode the segmented point cloud # one more conv layer compared to original paper class Pose_Ts(nn.Module): def __init__(self): super(Pose_Ts, self).__ini...
1,348
611
from greenflow.dataframe_flow import Node from greenflow.dataframe_flow.portsSpecSchema import (ConfSchema, PortsSpecSchema) from greenflow.dataframe_flow.metaSpec import MetaDataSchema from greenflow.dataframe_flow.util import get_file_path from greenflow.dataframe...
2,653
750
import mandelbrot as mand from PIL import Image width = 1280 height = 720 scale = 2 def pixelToCoord( pos ): (x, y) = pos return ( 4*(x/height - 0.5)/scale , -4*(y/height - 0.5)/scale) def main(): me = mand.mandelbrot(2) img = Image.new('RGB', (width,height), color = 'white') for y in range(0,...
623
259
import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn.utils.weight_init import trunc_normal_ #adapted from open-mmlab implementation of swin transformer class RelativePositionBias(nn.Module): def __init__(self, window_size=(7, 7), num_heads=8 ): su...
1,699
609
#Import some stuff import os import zipfile import ConfigParser import string import argparse from xml.etree.ElementTree import ElementTree from constants import SHORT_NAME, VERSION_NUMBER, FULL_NAME, GEOGEBRA_XML_LOCATION from diagram import AsyDiagram, doCompileDiagramObjects, drawDiagram # Argument parser {{{ pars...
6,065
2,320
import torch from utils import get_teacher1, get_teacher2, get_student def collect_model(args, data_info_s, data_info_t1, data_info_t2): """This is the function that constructs the dictionary containing the models and the corresponding optimizers Args: args (parse_args): parser arguments data...
1,714
542
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Item' db.create_table(u'core_item', ( (u'id', self.gf('django.db.models.fields.A...
8,759
2,789
r""" =================================================== ConeCyl (:mod:`desicos.abaqus.conecyl`) =================================================== .. currentmodule:: desicos.abaqus.conecyl Cone/Cylinder Model ===================== Figure 1 provides a schematic view of the typical model created using this module. T...
3,309
1,327
def generate_structure(thread_len, max_posts): time_delay_ids = [0] * thread_len + [1] * (max_posts - thread_len) structure_ids = [ [3] * idx + [4] + [2] * (thread_len - 1 - idx) + [5] * (max_posts - thread_len) for idx in range(thread_len) ] + [[5] * max_posts] * (max_posts - thread_len) ...
465
180
class _R(int): def __repr__(self): return "r%s"%(super(_R, self).__repr__(),) __str__ = __repr__ class _F(int): def __repr__(self): return "fr%s"%(super(_F, self).__repr__(),) __str__ = __repr__ class _V(int): def __repr__(self): return "vr%s"%(super(_V, self).__repr__(),) ...
1,230
725
"""Problem 9: Special Pythagorean triplet. Brute force.""" import unittest def find_triple(s): """Returns abc where a^2+b^2=c^2 with a+b+c=s.""" a, b, c = 998, 1, 1 while b < 999: if a**2 + b**2 == c**2: return a*b*c if a == 1: c += 1 b = 1 a...
445
191
import uuid import datetime import utilities.file_utilities as file_utilities EBXML_TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%SZ" def get_uuid(): """Generate a UUID suitable for sending in messages to Spine. :return: A string representation of the UUID. """ return str(uuid.uuid4()).upper() def get_times...
920
291
from test_couch import * from test_toggle import * from test_quickcache import *
81
24
import sqlite3 from helpers import get_db_path, get_timeframes from traceback import print_tb timeframes = get_timeframes() print(timeframes) for timeframe in timeframes: with sqlite3.connect(get_db_path(timeframe)) as connection: try: c = connection.cursor() print("Cleanin up!"...
998
280
from __future__ import division import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec import seaborn as sns import pandas as pd import glob import re from itertools import combinations import matplotlib matplotlib.rcParams['text.usetex'] = True def plot_probabilities(X, probabilities,...
8,059
3,282
from os.path import join, exists, isdir, relpath, abspath, dirname import datetime as dt import posixpath import logging import tempfile from os import stat, makedirs, remove import random import uuid from cStringIO import StringIO import time from six import string_types try: import gevent except: gevent = No...
10,125
2,914
# Generated by Django 2.0.3 on 2018-04-06 18:37 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('nadine', '0033_payment_m...
982
303
from generate import generate from datetime import datetime from time import sleep # sorting algorithms def linear_sort(unsorted_list): list_len = len(unsorted_list) smallest_int = 0 sorted_list = list() for index in range(list_len): smallest_int = 1000000 for element in unsorted_li...
5,212
1,612
#!/usr/bin/env python # coding=utf-8 import web import lib.user as user """首页[done]""" class index: """首页""" def GET(self): html = web.template.frender('templates/index.html') name = user.getName() return html(name)
251
89
from __future__ import absolute_import, division, print_function, unicode_literals import json import logging import math import os import sys from io import open import numpy as np import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from pytorch_transformers import WEIGHTS_NAME, CONFIG_N...
19,448
6,327
from setuptools import setup __version__ = '0.0.3' REQUIRES = ['psycopg2-binary'] EXTRAS_REQUIRE = { 'sqlalchemy': ['sqlalchemy'], 'jinjasql': ['jinjasql'], 'pandas': ['jinjasql', 'pandas'], } extras_lists = [vals for k, vals in EXTRAS_REQUIRE.items()] # flattening the values in EXTRAS_REQUIRE from popula...
1,166
392
""" Figurenerkennung for German literary texts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `figur` is very easy to use: ``` >>> import figur >>> text = "Der Gärtner entfernte sich eilig, und Eduard folgte bald." >>> figur.tag(text) SentenceId Token Tag 0 0 Der _ 1 0 Gä...
603
183
import cv2 import numpy as np import os def frames_to_video(inputpath,outputpath,fps): image_array = [] files = [f for f in os.listdir(inputpath) if isfile(join(inputpath, f))] files.sort(key = lambda x: int(x[5:-4])) for i in range(len(files)): img = cv2.imread(inputpath + files[i]) size = ...
725
279
import tensorflow as tf import numpy as np import traceback import os.path from .worker import Worker from .param import * from .params import * import logging logger = logging.getLogger(__name__) class HeartbeatHook(tf.train.SessionRunHook): def __init__(self, heatbeat, should_continue): self.heatbeat = heat...
5,303
2,076
import os import glob import yaml import torch import argparse from addict import Dict from dataset import * from init import * from utilities import * from train import * def parse_args(): parser = argparse.ArgumentParser(description='infer') parser.add_argument('--config', type=str, default='./tracer/train_...
4,064
1,273
"""acceptance tests""" import unittest from nose.plugins.attrib import attr @attr('acc') class AcceptanceTestCase(unittest.TestCase): """Base AcceptanceTestCase""" pass
181
58
#!/usr/bin/env python3 # Copyright (c) 2019 The Bitcoin SV developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_f...
4,222
1,424
# Generated by Django 2.1.8 on 2020-01-08 07:55 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('goods', '0062_auto_20191205_1656'), ] operations = [ migrations.RenameField( model_name='replgoodstype', old_name='p...
1,022
343
import gym import numpy as np import tensorflow as tf import time from actor_critic.policy import A2CBuilder from actor_critic.util import discount_with_dones, cat_entropy, fix_tf_name from common.model import NetworkBase from common.multiprocessing_env import SubprocVecEnv from tqdm import tqdm class ActorCritic(...
9,838
3,287
from enum import Enum import hashlib import math import os import random import re from chainmap import ChainMap from torch.autograd import Variable import librosa import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data as data from .manage_audio import AudioPrepr...
23,504
8,286
import json import os import arrow import libvirt import pytest from virt_backup.backups import DomBackup from virt_backup.domains import get_xml_block_of_disk from virt_backup.backups.snapshot import DomExtSnapshot, DomExtSnapshotCallbackRegistrer from virt_backup.exceptions import DiskNotFoundError, SnapshotNotStart...
7,642
2,476
import re from . import base class regex_search_ternary(base.Function): """ Ternary regex operator, it takes arguments in the following form STR1, REGEX, STR2, STR3 If REGEX matches STR1 (re.search is used), STR2 is returned, otherwise STR3 is returned """ def __init__(self): # 4 arguments super(regex_searc...
554
211
__version__ = "2.4.3" from . import errors from .client import Client from .interpreter import Interpreter from .time import Time from .formatters import format_property, format_decision_rules from .reducer import reduce_decision_rules from .tree_utils import ( extract_decision_paths_from_tree, extract_decisio...
905
291
# -*- coding: utf-8 -*- from .instance import BlockchainInstance from ..block import Block as SyncBlock, BlockHeader as SyncBlockHeader from graphenecommon.aio.block import ( Block as GrapheneBlock, BlockHeader as GrapheneBlockHeader, ) @BlockchainInstance.inject class Block(GrapheneBlock, SyncBlock): """...
969
273
# NxN 시험관, 바이러스 매 초 상하좌우로 증식, 낮은 번호의 바이러스부터 우선순위 # 시간동안(for) 낮은 번호부터 증식 시작. 바이러스가 있거나 matrix 범위 이상이면 stop. # 바이러스 종류별 좌표 추가 n, k = map(int, input().split()) matrix = [] for _ in range(n): matrix.append(list(map(int, input().split()))) s, x, y = map(int, input().split()) # 상 하 좌 우 dx = [-1, 1, 0, 0] # 위아래 dy = [0...
1,015
575
""" Internationalization tasks """ import re import subprocess import sys from path import Path as path from paver.easy import cmdopts, needs, sh, task from .utils.cmd import django_cmd from .utils.envs import Env from .utils.timer import timed try: from pygments.console import colorize except ImportError: ...
7,843
2,815
import sympy.physics.mechanics as _me import sympy as _sm import math as m import numpy as _np frame_n = _me.ReferenceFrame('n') frame_a = _me.ReferenceFrame('a') a = 0 d = _me.inertia(frame_a, 1, 1, 1) point_po1 = _me.Point('po1') point_po2 = _me.Point('po2') particle_p1 = _me.Particle('p1', _me.Point('p1_...
2,020
1,167
import filecmp, os, tempfile, unittest from click.testing import CliRunner from tenx.asm_stats import asm_stats_cmd, get_contig_lengths, get_scaffold_and_contig_lengths, get_stats, length_buckets class AsmStatsTest(unittest.TestCase): def setUp(self): self.data_dn = os.path.join(os.path.dirname(__file__),...
3,830
1,414
import socket import pickle import random import string import time import hashlib import os BUFFER_SIZE = 65536 def send_message(msg, port): # Setup socket for the user to be send s_temp = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s_temp.connect((socket.gethostname(), port)) # encode and se...
3,435
1,024
import json from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from data_refinery_api.test.test_api_general import API_VERSION from data_refinery_common.models import ( Experiment, ExperimentOrganismAssociation, ExperimentSampleAssociation, Or...
3,850
1,237
import pdftotext import sys import numpy as np import pandas as pd import regex as re def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def get_server_type(server_type_str): """Check wether string is contained""" server_type_list = server_type_str.split(' ') if len(server_type_li...
4,804
1,651
# random_forest.py # does the random forest calcutlaions import decision_tree import partition import heapq import table_utils import classifier_util from homework_util import strat_folds def run_a_table(table, indexes, class_index, N, M, F): """ Takes a table, splits it into a training and test set. Creates a ...
3,705
1,101
import tensorflow as tf from tensorflow.python.framework import graph_util from tensorflow.contrib.slim.python.slim.nets import alexnet from tensorflow.python.ops import random_ops from tensorflow.python.tools import optimize_for_inference_lib from tensorflow.python.framework import dtypes from tensorflow.core.framewor...
5,682
1,926
default_app_config = "comic.container_exec.apps.CoreConfig"
60
21
import requests import json import os from bs4 import BeautifulSoup as bs from secret import * from smtplib import SMTP from datetime import datetime from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart def maths(num1, num2, num3=None): num1 = int(''.join(num1.split(','))) num2 ...
18,320
6,265
''' Copyright 2020 Xilinx 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, software distr...
6,494
2,108
# Generated by Django 3.0 on 2020-01-07 07:56 import datetime from django.db import migrations from django.utils.timezone import utc import tinymce.models class Migration(migrations.Migration): dependencies = [ ('photos', '0007_auto_20200107_1022'), ] operations = [ migrations.AddField(...
545
208
from vcache_utils import VCacheStats from bfs_common import BFSParameters import sys import pandas as pd class BFSVCacheStats(VCacheStats): def _subclass_init_add_group_by_fields(self): self._parameters = BFSParameters(self.filename) self._parameters.updateDataFrame(self._data) self._group_...
525
160
import json import logging import re from pathlib import Path from typing import Optional, Union import pandas as pd from . import DOCSURL, DS_URL_PREFIX, readers # configure logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) ch = logging.StreamHandler() ch.setLevel(logging.INFO) logger.addHa...
14,511
4,287
# This program rolls two dices and prints what you got # We set two variables (min and max) , lowest and highest number of the dice. import random min = 1 max = 6 roll_again = "yes" # We then use a while loop, so that the user can roll the dice again. while roll_again == "yes" or roll_again == "y": print "Roll...
487
163
#TEMA:GENERADORES ###################################################################### #Funcion que me regresa un numero determinado de numeros pares def generaParesFuncion(limite): num=1 miLista=[] while num<limite: miLista.append(num*2) num = num+1 return miLista ########################################...
1,584
440
# -*- coding: utf-8 -*- """ lantz.qt.widgets ~~~~~~~~~~~~~~~~ PyQt widgets wrapped to work with lantz. :copyright: 2018 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from . import feat, nonnumeric, numeric from .common import WidgetMixin, Childr...
443
146
# -*- coding: utf-8 -*- import struct import iota from iotapy.storage import converter as conv TRANSACTION_METADATA_TRITS_LENGTH = 1604 HASH_BYTES_LENGTH = 49 HASH_TRITS_LENGTH = 243 def get_key(bytes_: bytes): # Convert key bytes to iota.TransactionHash if not isinstance(bytes_, bytes): raise Type...
4,368
1,674
#! /usr/bin/env python import tensorflow as tf import tensorflow.contrib.slim as slim seed = 0 def fc2d(inputs, num_outputs, activation_fn, scope, ): with tf.variable_scope(scope, reuse=tf.AUTO_REUSE) as s: n0, n1, n2 = inputs.get_shape().as_list() weights = tf.get_var...
22,271
5,798
from tkinter import* import website import tkinter.font as font from PIL import ImageTk,Image import os import sqlite3 import webbrowser def main(): cgnc=Tk() cgnc.title('Show') cgnc.iconbitmap("logo/spectrumlogo.ico") f=font.Font(family='Bookman Old Style',size=10,weight='bold') f1=fo...
5,980
2,296
import requests from typing import List from fastapi import FastAPI, Path from pydantic import BaseModel, HttpUrl from fastapi.middleware.cors import CORSMiddleware cors_origins = [ 'https://www.govdirectory.org', 'https://www.wikidata.org', ] user_agent_external = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; r...
4,650
1,525
from ..field import Field class Password(Field): min = None max = None messages = { 'min': 'Must be at least {min} characters long.', 'max': 'Must have no more than {max} characters.', } def is_empty(self, value): return value is None or value is '' def validate(sel...
569
171
""" This script adds a specific column to the `bug_type_entropy_projectname_old` tables. The added column contains the nesting depth (>=0) of each line. """ import os, sys, psycopg2, ntpath, traceback, subprocess from pprint import pprint #-------------------------------------------------------------------------------...
5,933
1,807
import matplotlib.pyplot as plt import numpy as np import cv2 import scipy.spatial from sklearn.linear_model import RANSACRegressor import os import sys import inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0, parent...
10,862
4,240
from setup import * import pygame, sys, os from pygame.locals import * class Menu( object ): def __init__( self ): self.init = pygame.init() self.font = pygame.font.Font(None, 80) self.screen = pygame.display.set_mode( [ LARGURA, ALTURA ] ) self.background = pygame.image.load( "im...
2,221
714
import json from investing_algorithm_framework.app.stateless.action_handlers \ .action_handler_strategy import ActionHandlerStrategy class CheckOnlineHandler(ActionHandlerStrategy): MESSAGE = {"message": "online"} def handle_event(self, payload, algorithm_context): return { "statusCod...
459
129
# ---------------------------------------------------------------ALL REQUIRD FILES------------------------------------------------------------- from tkinter import * import tkinter.ttk as ttk import tkinter.messagebox as msg import tkinter.filedialog as tf from ttkthemes import ThemedStyle from PIL import Image, Image...
20,757
7,451
#!/usr/local/miniconda2/bin/python # _*_ coding: utf-8 _*_ """ @author: MarkLiu @time : 17-6-19 下午8:44 """
108
63
import sys #Fornece funções e variáveis para manipular partes do ambiente de tempo de execução do Python from time import sleep import pygame from settings import Settings from game_stats import GameStats from bullet import Bullet from alien import Alien def check_keydown_events(event, ai_settings, screen, stats, sb...
11,451
3,905
# # Copyright 2016-2017 Games Creators Club # # MIT License # from sonarsensor_service import *
98
42
import numpy as np from CelestialMechanics.kepler.constants import K def mu_sun(m2_over_m1: float) -> float: """ mu = k * sqrt(1 + m2/m1) :param m2_over_m1: :type m2_over_m1: :return: mu :rtype: float """ mu = K * np.sqrt(1. + m2_over_m1) return mu * mu def mu_na(n: float, a: ...
806
345
#!/usr/bin/python3 import hl_utils from hl_constants import * import string import re from datetime import datetime def guthaben(): guthaben = '' if hl_utils.is_cip(): raw = "" with open(hl_utils.hlpath(PRINT_LOG)) as f: raw = f.read(); ...
3,276
1,066
import datetime from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from vigil_ctf_app.EmailBackEnd import EmailBackEnd #Authentication views ONLY...
1,368
368
import os import pickle from functools import partial from itertools import permutations, combinations import networkx as nx import numpy as np from bitstring import BitArray from collections import Counter try: from graph_measures.features_infra.feature_calculators import NodeFeatureCalculator, Featur...
19,223
6,424
from src import XMLAnalyzerException import lxml.etree as ET from src.Structures import * from src import XMLFilter from src import XMLUtil import constants import re from src.xml_decoder import html_entitize def apply_all(xml, post_processes): for post_process in post_processes: xml = apply(xml, post_proc...
2,885
900
"""RF Pulse Simulation Functions. """ from sigpy import backend __all__ = ['abrm', 'abrm_nd', 'abrm_hp'] def abrm(rf, x, balanced=False): r"""1D RF pulse simulation, with simultaneous RF + gradient rotations. Args: rf (array): rf waveform input. x (array): spatial locations. bala...
4,954
1,887
#!/usr/bin/env python # apachelint - simple tool to cleanup apache conf files # USAGE: apachelint [conffile] # -*-Python-*- import sys import re filename = sys.argv[1] indentlevel = 0 indentstep = 4 prevlineblank = False with open(filename) as f: for line in f: # strip leading & trailing space / line en...
821
244
"""Vectorized math formulae""" from numba import vectorize, int64, float64 from math import lgamma, exp, isnan, log __all__ = ["binom", "xlogy"] @vectorize([float64(int64, int64)], fastmath=True) def binom(n, k): """Obtain the binomial coefficient, using a definition that is mathematically equivalent but num...
931
325
# @Copyright [2021] [Yash Bajaj] import fileinput as fi # This module replaces the word <|SPACE|> with a new line (code line 18) def writer(): with open("c:/PycharmProjects/copy_data_from_1_file_to_another/input.txt", "w") as writer: data = input("Whatever you will write will be present in input.txt - ") ...
1,171
391