text
string
size
int64
token_count
int64
from multiprocessing import Process import pymongo from itertools import combinations import csv import time import sys mongo_ip = "192.168.1.127" db_name = "analysis" collection_name = "common_items" max_item_threshold = 20 def load_transaction(filename): transaction = [] with open(filename,'rb') as csvfile: ...
2,154
764
class NoeudBin: def __init__(self, valeur, gauche=None, droit=None): self.valeur = valeur # self.parent = None self.gauche = gauche self.droit = droit def est_double(self): """Renvoie True si le noeud a deux enfants exactement, False autrement.""" return self.gau...
1,962
671
# Generated by Django 2.2.24 on 2022-02-10 12:36 import bluebottle.utils.fields import bluebottle.utils.validators import colorfield.fields from django.db import migrations, models import django_better_admin_arrayfield.models.fields class Migration(migrations.Migration): dependencies = [ ('segments', '0...
3,753
1,067
import os import pandas as pd from kloppy import ( load_epts_tracking_data, to_pandas, load_metrica_json_event_data, load_xml_code_data, ) from codeball import ( GameDataset, DataType, TrackingFrame, EventsFrame, CodesFrame, PossessionsFrame, BaseFrame, Zones, Area...
7,980
2,561
import random print("Rock, Paper, Scissors!") player = int(input("What do you choose? Type 0 for Rock, 1 for paper, 2 for Scissors: ")) computer = random.randint(0, 2) game = [""" _______ ---' ____) (_____) (_____) (____) ---.__(___) """, """ _______ ---' ____)____ ______) ...
2,025
651
# Detector (Faster RCNN) # forward propogate from input to output # Goal: test if the validation output act as expected import sys from pathlib import Path import pickle import timeit from datetime import datetime import pandas as pd import numpy as np import tensorflow as tf from tensorflow.keras.regularizers impor...
3,249
1,134
#!/usr/bin/env python3 # -*- coding=utf-8 -*- import cv2 as cv import numpy as np """ 使用几何矩计算轮廓中心与横纵波比对过滤 对二值图像的各个轮廓进行计算获得对应的几何矩,根据几何矩计算轮廓点的中心位置。 cv.moments(contours, binaryImage) - contours: 轮廓点集 - binaryImage: bool, default False;二值图返回 """ def main(): ...
1,686
820
def get_salary(courier_type, completed_orders): DATA = {"foot": 2, "bike": 5, "car": 9} salary = 500 * DATA[str(courier_type)] * completed_orders return salary
172
70
from settings import Settings from ship import Ship import pygame import sys from trap import Trap from time import clock from random import randint def run_game(): tela1 = Settings() screen = pygame.display.set_mode((tela1.altura, tela1.largura)) background = Settings() pygame.display.set_caption("Spa...
1,967
606
import sys import argparse def read_in(file_path): try: file = open(file_path, 'r') except: sys.stderr.write("[ERROR] read_in(): Cannot open file '%s'\n" % file_path) exit(1) file_content = [] for line in file: file_content.append(line) i = 0 while i < len(fi...
1,463
493
# Copyright 2017 Mirko Lelansky <mlelansky@mail.de> # # 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 a...
5,426
1,486
from __future__ import ( annotations, ) class ModFromSlackError(Exception): """Base class for modfromslack errors""" def __init__( self, message: str, *, preamble: str | None = None, afterword: str | None = None ) -> None: if preamble is not None: ...
1,581
469
from collections import defaultdict from os import makedirs from os.path import realpath, join, dirname, isdir, exists from shutil import copy from jinja2 import Environment, FileSystemLoader from cid.cli.cli_model_specs import CliModelSpecs from cid.cli import cli_post_processing from cid.parser.cid_parser import pa...
7,276
2,122
import mxnet as mx #import neomxnet import os import json import numpy as np from collections import namedtuple import os dtype='float32' Batch = namedtuple('Batch', ['data']) ctx = mx.neuron() is_gpu = False def model_fn(model_dir): print("param {}".format(os.environ.get('MODEL_NAME_CUSTOM'))) print("ctx {}".form...
2,037
824
import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): ''' Load and merge two CSV files - one containing messages and the other containing categories Args: messages_filepath (str): Path to the CSV file containing messages ...
4,040
1,106
########################### # # #650 Divisors of Binomial Product - Project Euler # https://projecteuler.net/problem=650 # # Code by Kevin Marciniak # ###########################
179
56
from bs4 import BeautifulSoup import os import csv bicycles = [] basepath = 'HTMLFiles/' outputFile = open('scraped.py','a') outputFile.write("list=[") len1 = len(os.listdir(basepath)) counter1 = 0 for entry in os.listdir(basepath): counter2 = 0 len2 = len(os.listdir(basepath+'/'+entry)) for folder in os....
3,432
1,050
class Solution: def moveZeroes(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ read_index, write_index = 0, -1 len_nums = len(nums) # shift non-zero numbers to the head of the list while read_index < len_nums: ...
642
198
''' v0.1 2015/11/26 - add output() - add setmode() - add setup() ''' class CDummyGPIO: def __init__(self): self.BOARD = 0; self.OUT = 1; # do nothing return def setmode(self, board): # do nothing return def setup(self, pinnum, inout): # do nothing return def output(self, pinnum, onoff): ...
464
222
from setuptools import setup setup(name='django-headmaster', version='0.0.1', description='Add extra headers to your site via your settings file', url='http://github.com/CyrusBiotechnology/django-headmaster', author='Peter Novotnak', author_email='peter@cyrusbio.com', license='MIT',...
380
114
# -*- coding: utf-8 -*- import os import pytest from sfm import lines_count def test_lines_count(): assert lines_count.count_lines(__file__) >= 22 def test_lines_stats(): n_files, n_lines = lines_count.lines_stats( os.path.dirname(__file__), lines_count.filter_python_script) assert n_files >= 1...
484
181
########################################################################################### # accesscontrol - access control permission and need definitions # # Date Author Reason # ---- ------ ------ # 01/18/14 Lou King Create # # Copyright 2014...
1,884
457
from nailgun.extensions import BaseExtension class NoElo(BaseExtension): name = 'noelo' description = 'no elo' version = '1.0.0' def test_ext(): NoElo()
173
64
# vim: ts=4:sw=4:expandtabs __author__ = 'zach.mott@gmail.com' from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from email_utils.tasks import send_mail RESEND_EMAIL_PERMISSION = 'can_resend_email' @python_2_unicode_c...
1,404
464
#!/usr/bin/python3 from .log_utils import get_module_logger from defang import defang import random import string import urllib.parse logger = get_module_logger(__name__) def random_string(length): return ''.join( random.choice( string.ascii_uppercase + string.ascii_lowercase + ...
1,262
425
# empty file telling python that this directory is a package
61
13
# Slush Tools STRING Module class String: bu = None dat = None def __init__(str): if str == None: print("String argument required.") exit() else: dat = str bu = str return dat def reset(): dat = bu return dat def format(type="custom",args={}): if type == "cus...
803
258
import time, os import numpy as np import json class Timer: def __init__(self, name, remove_start_msg=True): self.name = name self.remove_start_msg = remove_start_msg def __enter__(self): self.start_time = time.time() print('Run "%s".........' % self.name, end='\r' if self.remo...
2,001
669
import carpeta8 # bloque principal lista=carpeta8.cargar() carpeta8.imprimir(lista) carpeta8.ordenar(lista) carpeta8.imprimir(lista)
140
62
import re from mediaRename.constants import constants as CONST def cleanReplace(data): """ Takes each dict object and clean :param data: dict object :return: none """ dataIn = data["files"] # (regX, replaceSTR) cleanPasses = [(CONST.CLEAN_PASSONE, ""), (CONST.CLEAN_PASSTWO, ""), ...
692
229
# Copyright (c) 2019 MindAffect B.V. # Author: Jason Farquhar <jason@mindaffect.nl> # This file is part of pymindaffectBCI <https://github.com/mindaffect/pymindaffectBCI>. # # pymindaffectBCI is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published b...
32,553
12,525
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] c = [] for x in a: if x in b: c.append(x) print(c)
155
119
from tensorflow import keras import os import numpy as np import sys import json sys.path.append("/".join(os.path.abspath(__file__).split("/")[:-2])) from model.dataset import utils, test_sampler def estimate_model_accuracy(model): def predict(word): word = utils.total_conversion(word) word = wor...
2,100
691
import torch import torch.nn as nn import torch.nn.functional as F import os import numpy as np from Layer import FeedForwardNetwork from Layer import MultiHeadAttention __author__ = "Serena Khoo" class Layer(nn.Module): def __init__(self, config, d_model, n_head): super(Layer,self).__init__() self.config =...
927
331
import requests import urllib.request import os import pickle import argparse # file read folder path = 'http://db.itkc.or.kr//data/imagedb/BOOK/ITKC_{0}/ITKC_{0}_{1}A/ITKC_{0}_{1}A_{2}{5}_{3}{4}.JPG' # Manual label = ['BT', 'MO'] middle = 1400 last = ['A', 'V'] # A ~400 V ~009 num = 10 num1 = 400 fin = ['A', 'B',...
2,102
729
"""This module holds the Symbol, ComputationalGraph, and ComputationalGraphNode classes and methods to help construct a computational graph.""" from typing import Optional from .operators import Add, Subtract, Multiply, Divide, Grad, Div, Curl, Laplacian class Symbol: """The Symbol class is the superclass represe...
2,646
678
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for # full license information. import datetime import threading import contextlib class MeasureRunningCodeBlock(contextlib.AbstractContextManager): def __init__(self, name): self.count ...
2,218
673
import tkinter as tk from tkinter import messagebox import json # Constants FONT_NAME = "Open Sans" BG_COLOR = "#f9f7f7" FONT_COLOR = "#112d4e" ACCENT = "#dbe2ef" root = tk.Tk() root.title("Money Tracker") root.config(bg=BG_COLOR) root.resizable(0, 0) root.iconbitmap("C:\\Users\\ASUA\\Desktop\\Tests\\MoneyTransactio...
9,415
3,598
import requests class ResponseParser: @staticmethod def parse(response: dict): result = response["result"] if "status" in response.keys(): status = bool(int(response["status"])) message = response["message"] assert status, f"{result} -- {message}" el...
519
131
import json import matplotlib import matplotlib.pyplot as plt import numpy as np import os import time def people_distribution_map(data, file): unique, indices, counts = np.unique( data[:, 0], return_index=True, return_counts=True) generations = list(zip(unique, indices, counts)) plt_size_x = int(...
12,725
4,464
from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("setup", "doctype", "company") companies = frappe.get_all("Company", fields=["name", "default_payable_account"]) for company in companies: if company.default_payable_account is not None: frappe.db.set_value("Company", comp...
403
134
# 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 # distributed u...
4,653
1,196
from PIL import Image import numpy as np # Works when launched from terminal # noinspection PyUnresolvedReferences from k_means import k_means input_image_file = 'lena.jpg' output_image_prefix = 'out_lena' n_clusters = [2, 3, 5] max_iterations = 100 launch_count = 3 def main(): # Read input image image = np...
1,026
369
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import tensorflow as tf import yaml from model.dcrnn_supervisor import DCRNNSupervisor def main(args): with open(args.config_filename) as f: supervisor_config = yaml.load(f) ...
3,389
1,075
import torch.optim as optim from torch import nn from data.match_dataset import MatchDataset from torch.utils.data import DataLoader from models.lol_result_model import LOLResultModel import torch if __name__ == '__main__': EPOCH = 50 BATCH_SIZE = 32 loader = DataLoader(MatchDataset('dataset/train_data....
1,035
354
#!/usr/bin/env python import libtripled, logging, sys, os # CONSTANTS log = logging.getLogger('tripled.cpfromddd') def next_chunk(tripled, path): chunks = tripled.read_file(path) for chunk in chunks: log.debug('reading from worker[%s] path[%s]' % (chunk[0], chunk[1])) yield tripled.read_block(c...
774
297
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from enum import Enum from typing import cast, Dict, List, Optional, Tuple, Union impor...
10,094
3,108
from .plugin_loader import manifest from .plugin_manager import PluginManager
78
19
from opytimizer.optimizers.science import HGSO # One should declare a hyperparameters object based # on the desired algorithm that will be used params = { 'n_clusters': 2, 'l1': 0.0005, 'l2': 100, 'l3': 0.001, 'alpha': 1.0, 'beta': 1.0, 'K': 1.0 } # Creates an HGSO optimizer o = HGSO(param...
330
145
"""Image generating architectures. Kyle Roth. 2019-07-10. """
63
29
from django.conf.urls import url from .views import (EmergencyContactCreateView, EmergencyContactUpdateView, EmergencyContactDeleteView, EmergencyContactDetailView, EmergencyContactListView, AdverseEventTypeUpdateView, AdverseEventTypeCreateView, AdverseEventTypeDeleteView, Adve...
2,668
905
#!/usr/bin/python3 '''Handles all database interactions for qbootstrapper ''' from flask import g from qbflask import app import sqlite3 def connect_db(): '''Connects to the database and returns the connection ''' conn = sqlite3.connect(app.config['DATABASE']) conn.row_factory = sqlite3.Row retur...
1,133
351
"""Interprets each AST node""" import ast import textwrap from typing import Any, Dict, List def extract_fields(code: str) -> Dict[str, Any]: """Extracts data from code block searching for variables Args: code: the code block to parse """ # Parsing expects that the code have no indentation ...
2,795
827
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutStrings(Koan): def test_double_quoted_strings_are_strings(self): string = "Hello, world." # self.assertEqual(__, isinstance(string, str)) # Returns true, because string and str are the same type. s...
4,757
1,443
params = [int(x) for x in input().split()] point = params[-1] card_numbers = sorted([int(i) for i in input().split()]) max_sum = 0 for i in range(len(card_numbers)): for j in range(i+1, len(card_numbers)): for k in range(j+1, len(card_numbers)): if card_numbers[i] + card_numbers[j] + card_numbe...
630
220
import os import re # from .m.red import readInput data = open("2\\input.txt").read().split('\n') parsedData = [] for x in data: parsedData.append(list(filter(None, re.split("[- :]", x)))) parsedData.pop() count = 0 for x in parsedData: print(x) if(x[3][int(x[0])-1] != x[3][int(x[1])-1] and (...
453
206
#!/usr/bin/env python2.4 """ """ class MyClass(object): def __init__(self, a, b): print 'MyClass.__init__', a, b #super(MyClass, self).__init__(a, b) # works in 2.4 super(MyClass, self).__init__() # works in 2.6 obj = MyClass(6, 7)
284
110
from django.shortcuts import render from django.http import JsonResponse from django.db import connections from django.db.models import Count from django.contrib import admin from visitor.models import Apache import json admin.site.register(Apache) # Create your views here. def text(request): apachelogs_list = Ap...
1,183
455
# --- # jupyter: # jupytext: # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.13.7 # kernelspec: # display_name: Python 2 # language: python # name: python2 # --- # %% import pandas a...
2,451
1,036
import pytest import pyhomogenize as pyh from . import has_dask, requires_dask from . import has_xarray, requires_xarray from . import has_numpy, requires_numpy def test_time_compare(): netcdffile1 = pyh.test_netcdf[0] netcdffile2 = pyh.test_netcdf[2] time_control1 = pyh.time_control(netcdffile1) ti...
655
242
from behave import * from hamcrest import assert_that, equal_to from vec3 import Vec3, vec3 from vec4 import Vec4, point, vector from base import equal, normalize, transform, ray, lighting import numpy as np from shape import material, sphere, test_shape, normal_at, set_transform, intersect, glass_sphere, point_light f...
8,391
2,898
#!/usr/bin/env python # 'wordfrequencies.py'. # Chris Shiels. import re import sys def pipemaybe(l): def internal(v): return reduce(lambda a, e: e(a) if a is not None else None, l, v) return internal def partial(f, *args): args1 = args def internal(*args): return f(*(args1 + args)) return inter...
2,073
753
import threading import time import numpy as np from collections import deque class ThreadGenerator(threading.Thread): def __init__(self, generator, max_queue_size=10): threading.Thread.__init__(self) self.generator = ThreadGenerator self.buffer = deque(maxlen=max_queue_size) self.m...
741
227
from django.apps import AppConfig class PbsConfig(AppConfig): name = 'pbs'
81
28
""" fetch historical stocks prices """ from tqdm import tqdm import pandas as pd import pandas_datareader as pdr from .base import DataFetcher def get_stock_price(symbol, start, end): """get stock price of a company over a time range Args: symbol (str): ticker symbol of a stock start (datetime...
1,544
462
from .instruccionAbstracta import InstruccionAbstracta class Expresion(InstruccionAbstracta): def __init__(self): pass def valorPrimitivo(self,valor,tipo): self.valor = valor self.tipoOperacion = tipo self.opIzquierdo = None self.opDerecho = None def ope...
809
275
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
2,963
829
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\postures\posture_tunables.py # Compiled at: 2016-02-19 01:17:07 # Size of source mod 2**32: 2003 byt...
1,940
559
from . import Log, Move
23
7
from Musician import Musician class Guitarist(Musician): solo = 'Guitar Sounds' instrument = 'Guitar'
107
38
import unittest import numpy as np import fastpli.objects import fastpli.tools class MainTest(unittest.TestCase): # TODO: implement object.fiber.*manipulations* def setUp(self): self.fiber = np.array([[0, 0, 0, 1], [1, 1, 1, 2]], dtype=float) self.fiber_bundle = [self.fiber.copy()] s...
6,126
2,497
import tensorflow as tf from kerascv.layers.iou_similarity import IOUSimilarity iou_layer = IOUSimilarity() class ArgMaxMatcher(tf.keras.layers.Layer): """ArgMax matcher""" # [pos, neutral, neg] def __init__(self, matched_threshold, unmatched_threshold): self.matched_threshold = matched_threshol...
4,403
1,510
import socket import struct IP_BACKUP = '127.0.0.1' PORTA_BACKUP = 5000 ARQUIVO_BACKUP = "/home/aluno-uffs/Documentos/Trab_Final/Atv1-Distribuida/cliente_BACKUP.c" #Recebe o arquivo. sockReceber = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) sockReceber.setsockopt(socket.SOL_SOCKET, socket.SO_...
538
253
import numpy as np from matplotlib import pyplot as plt from localpoly.base import LocalPolynomialRegression # simulate data np.random.seed(1) X = np.linspace(-np.pi, np.pi, num=150) y_real = np.sin(X) y = np.random.normal(0, 0.3, len(X)) + y_real # local polynomial regression model = LocalPolynomialRegression(X=X, ...
634
253
## Activation functions from .module import Module from ..utils import functional as F class ReLU(Module): def __init__(self, in_place=False): super(ReLU, self).__init__() self.in_place = in_place self.init_buffer() def init_buffer(self): self.buffer['activated'] = None ...
690
208
from . import spec from typing import ( # noqa: F401 Any, Callable, List, NewType, Tuple, ) from .spec import ( BeaconState, BeaconBlock, ) def process_transaction_type(state: BeaconState, transactions: List[Any], max_transactio...
2,829
905
""" Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm 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 agre...
1,419
413
import os import sys import boto3 from github import Github SSM_CLIENT = boto3.client("ssm") GITHUB_REPO_NAME = os.environ.get("GITHUB_REPO_NAME", "") PR_NUMBER = os.environ.get("PR_NUMBER", "") FAILED = bool(int(sys.argv[2])) GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN", "") if __name__ == "__main__": repo =...
799
308
from __future__ import annotations from typing import TYPE_CHECKING, Dict, List, Optional, Union from Acquire.Client import Wallet if TYPE_CHECKING: from openghg.dataobjects import SearchResults __all__ = ["Search"] class Search: def __init__(self, service_url: Optional[str] = None): if service_url...
2,460
683
# -*- coding: utf-8 -*- """ Copyright 2019 CS Systèmes d'Information 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...
1,524
510
import numpy as np from scipy.stats import bernoulli import heapq class DiffusionModel: def __init__(self, graph, majority, get_diffusion_probability, num_rels): self.graph = graph self.majority = majority nodes = sorted(self.graph.nodes()) self.node_index_map = {nodes[i] :...
4,467
1,432
from driver_53x5 import main main(0x5395)
43
22
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: v2ray.com/core/proxy/vmess/inbound/config.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf i...
7,104
2,789
import logging import csv import time from bs4 import BeautifulSoup import requests logging.basicConfig( format='%(asctime)s %(levelname)s:%(message)s', level=logging.INFO) class Crawler: def __init__(self, urls=[]): self.visited_urls = [] self.urls_to_visit = urls def download_url...
2,631
809
from asteroid.interp import interp from asteroid.version import VERSION from asteroid.state import state from asteroid.globals import ExpectationError from asteroid.walk import function_return_value from asteroid.support import term2string from sys import stdin import readline def repl(): state.initialize() p...
2,605
695
"""API for eeadm file state.""" from http import HTTPStatus from flask import request from flask_restx import Namespace, Resource, fields from core.eeadm.file_state import EEADM_File_State from ltfsee_globus.auth import token_required api = Namespace( "file_state", description="Get state of a file in archive eea...
1,762
569
from numpy import sort from src.helpers.dataframe_helper import df_get, write_to_csv def add_missing_class_rows_to_test_data(train_data_path, test_data_path): __add_missing_classes(train_data_path, test_data_path) def __add_missing_classes(train_data_path, test_data_path): if train_data_path is None or test...
1,350
484
''' 【システム】BOAT_RACE_DB2 【ファイル】140_mkcsv_t_info_d.py 【機能仕様】直前情報HTMLファイルから直前情報明細テーブル「t_info_d」のインポートCSVファイルを作成する 【動作環境】macOS 11.1/Raspbian OS 10.4/python 3.9.1/sqlite3 3.32.3 【来  歴】2021.02.01 ver 1.00 ''' import os import datetime from bs4 import BeautifulSoup #インストールディレクトの定義 BASE_DIR = '/home/pi/BOAT_RACE_DB' ''' 【関 数】...
7,925
3,006
#!/usr/bin/env python3 import numpy as np B = np.reshape(np.genfromtxt("data/b_nmc.txt"), (40, 40)) import matplotlib.pyplot as plt plt.contourf(B) plt.colorbar() plt.show()
174
77
#!/usr/bin/env python3 import os, json print("Content-type:text/html\r\n\r\n") print print("<title>Test CGI</title>") print("<p>Hello World!</>") # #Q1 # print(os.environ) # json_object = json.dumps(dict(os.environ), indent=4) # #print(json_object) #Q2 # for param in os.environ.keys(): # if (param=="QUERY_STRING"...
602
249
#!/usr/local/bin/python3 from subprocess import Popen, PIPE from urllib.parse import quote import sqlite3, datetime, sys, re # Global Variables removeCheckedItems = True # Set to false if you want to keep "completed" to-do items when this is run bearDbFile = str(sys.argv[3]) oneTabID = str(sys.argv[4]) # Methods de...
2,194
738
import sys from time import perf_counter from command import CommandList from errors import DppArgparseError, DppDockerError, DppError from message import message def _handle_cmdline_error(e: DppError): if isinstance(e, DppArgparseError): message.stdout_argparse_error(str(e)) elif isinstance(e, DppDo...
1,319
427
# -*- coding: utf-8 -*- """ ui/choice_grid.py Last updated: 2021-05-04 Manage the grid for the puil-subject-choice-editor. =+LICENCE============================= Copyright 2021 Michael Towers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with ...
9,962
3,044
import math result=(math.pow(3,2)+1)*(math.fmod(16,7))/7 print(result)
72
36
# -*- coding: utf-8 -*- """ Created on Tue Feb 5 16:25:45 2019 @author: polsterc16 ============================================================================== LICENCE INFORMATION ============================================================================== This Software uses Code (spg4) provided by "Brandon Rho...
5,585
1,520
from autostat.run_settings import RunSettings, Backend from autostat.kernel_search import kernel_search, get_best_kernel_info from autostat.dataset_adapters import Dataset from autostat.utils.test_data_loader import load_test_dataset from html_reports import Report from markdown import markdown import matplotlib.py...
3,370
1,230
# -*- coding: utf-8 -*- """ @Remark: 用户模块的路由文件 """ from django.urls import path, re_path from rest_framework import routers from apps.lyusers.views import UserManageViewSet system_url = routers.SimpleRouter() system_url.register(r'users', UserManageViewSet) urlpatterns = [ re_path('users/disableuser/(?P<pk>....
424
170
# -*- coding: utf-8 -*- ''' Texas A&M University Sounding Rocketry Team SRT-6 | 2018-2019 SRT-9 | 2021-2022 %-------------------------------------------------------------% TAMU SRT _____ __ _____ __ __ / ___/______ __ _____ ___/ / / ___...
44,393
14,999
#/usr/bin/env python import sys from setuptools import setup from cricket import VERSION try: readme = open('README.rst') long_description = str(readme.read()) finally: readme.close() required_pkgs = [ 'tkreadonly', ] if sys.version_info < (2, 7): required_pkgs.extend(['argparse', 'unittest2', 'p...
1,359
437
import requests; import json; from collections import Counter # Counts and orders the list of violations import sys; from urllib.parse import quote_plus # Make sysarg url-safe # List of Apache Commons libraries which I know can be analyzed (without crashing/failing their tests) commonsList = ["bcel", "beanutils", ...
2,701
1,058