seq_id
stringlengths
4
11
text
stringlengths
113
2.92M
repo_name
stringlengths
4
125
โŒ€
sub_path
stringlengths
3
214
file_name
stringlengths
3
160
file_ext
stringclasses
18 values
file_size_in_byte
int64
113
2.92M
program_lang
stringclasses
1 value
lang
stringclasses
93 values
doc_type
stringclasses
1 value
stars
int64
0
179k
โŒ€
dataset
stringclasses
3 values
pt
stringclasses
78 values
19329693229
from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build from google.oauth2.credentials import Credentials from google.auth.transport.requests import Request import os # All scopes together ALL_SCOPES = [ 'https://www.googleapis.com/auth/contacts.readonly', 'https://ww...
clarkdever/gcal-gcontacts-sync
google_api_utils.py
google_api_utils.py
py
2,803
python
en
code
0
github-code
6
19969055167
""" This helps in finding the means and standards of the images to normalize before training. To run python3 calculate_means_std.py -i path/to/image/folder/ """ import argparse import subprocess import yaml import os import sys sys.path.remove("/opt/ros/kinetic/lib/python2.7/dist-packages") import cv2 import nump...
vijaysamula/Building_floor_counter
calculate_means_stds.py
calculate_means_stds.py
py
2,438
python
en
code
0
github-code
6
13454184469
""" words list๊ฐ€ ๋งํฌ๋งŒ ์žˆ๊ณ , ๊ธ€์ž ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์Œ. ๊ธ€์ž ๋ฆฌ์ŠคํŠธ๋ฅผ ๋ฐ›์•„์˜ค๊ธฐ ์œ„ํ•œ ํŒŒ์ผ """ from selenium import webdriver from bs4 import BeautifulSoup import pandas as pd class Get_chndic_data: def __init__(self, link): self.link = link self.get_data = [] def beautiful_soup(self, link): """ Beautiful Soup...
i-hs/chn_words_crawling
make_database/words_list.py
words_list.py
py
2,691
python
ko
code
0
github-code
6
22126010030
import math import random # read data from file def getData(fn): # get data file = open(fn, 'r') read = file.readlines() file.close states = int(read[0]) # number of states rewards = [] # reward data (also state data) moves = [] # move data for i in range(1, len(read...
WannaBeSuperteur/AI
QLearning.py
QLearning.py
py
4,032
python
en
code
0
github-code
6
33708620212
import os from google.cloud import storage class GoogleStorageLoader(): def __init__(self) -> None: """Start Google Cloud clint - could be used for uploading to storage """ os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "../content/key-bucket.json" self.client = storage.Client() ...
IhorLuk/reddit_api_data_ingestion
src/storage.py
storage.py
py
724
python
en
code
0
github-code
6
41054313506
# coding: utf-8 # # Heat Diffusion in Soils # # This Jupyter Notebook gives an example how to implement a 1D heat diffusion model in Python. # # First we need to import the packages which we will be using: # # In[1]: import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns impo...
solomelittle/EL-Individual-Assignment
03_ScriptCH_WieringermeerBoundary.py
03_ScriptCH_WieringermeerBoundary.py
py
7,445
python
en
code
0
github-code
6
3477283820
import logging import os import typing from collections import defaultdict from typing import Dict import dpath.util from voluptuous import Any from dvc.exceptions import DvcException from dvc.utils.serialize import ParseError, load_path from dvc_data.hashfile.hash_info import HashInfo from .base import Dependency ...
gshanko125298/Prompt-Engineering-In-context-learning-with-GPT-3-and-LLMs
myenve/Lib/site-packages/dvc/dependency/param.py
param.py
py
4,814
python
en
code
3
github-code
6
42072257921
#!/usr/bin/env python # coding: utf-8 # In[36]: import requests from bs4 import BeautifulSoup import pandas list1=[] for page in range(0,30,10): r = requests.get("http://www.pyclass.com/real-estate/rock-springs-wy/LCWYROCKSPRINGS/t=0&s="+str(page)+".html", headers={'User-agent': 'Mozilla/5.0 (X11; Ubuntu;...
shivangijain827/python-projects
web - scraper/main.py
main.py
py
1,883
python
en
code
0
github-code
6
74099804029
import os import os.path as osp import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import pandas as pd import argparse from dataset import collate_fn, MergedMatchingDataset from torch.utils.data import DataLoader from EmbedModel import EmbedModel from GCN import gcn from logger import...
ChenRunjin/GNEM
test.py
test.py
py
6,754
python
en
code
5
github-code
6
41254027126
from copy import copy, deepcopy from itertools import izip from burrahobbit.util import all SENTINEL = object() SHIFT = 5 BMAP = (1 << SHIFT) - 1 BRANCH = 2 ** SHIFT MAXBITMAPDISPATCH = 16 def relevant(hsh, shift): """ Return the relevant part of the hsh on the level shift. """ return hsh >> shift & BMAP ...
fmayer/burrahobbit
burrahobbit/_tree.py
_tree.py
py
17,423
python
en
code
8
github-code
6
9162832850
def _self_extract_binary(ctx): """Implementation for the self_extract_binary rule.""" # This is a bit complex for stripping out timestamps zip_artifact = ctx.actions.declare_file(ctx.label.name + ".zip") touch_empty_files = [ "mkdir -p $(dirname ${tmpdir}/%s); touch ${tmpdir}/%s" % (f, f) ...
bazelbuild/bazel
scripts/packages/self_extract_binary.bzl
self_extract_binary.bzl
bzl
2,138
python
en
code
21,632
github-code
6
26470959901
""" Problem 71: Ordered Fractions https://projecteuler.net/problem=71 Goal: By listing the set of reduced proper fractions for d <= N in ascending order of size, find the numerator and denominator of the fraction immediately to the left of n/d. Constraints: 1 <= n < d <= 1e9, gcd(n, d) == 1, d < N <= 1e15 Reduced P...
bog-walk/project-euler-python
solution/batch7/problem71.py
problem71.py
py
7,025
python
en
code
0
github-code
6
24455754580
# -*- coding: utf-8 -*- """ @author: Fatih Kemal Terzi """ import cv2 import numpy as np # Image reading img = cv2.imread('pools.png') count=0 # Image converting to HSV color space hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) # Adjusting range of blue color for detecting pools lower_blue = np.array([8...
FatihKemalTerzi/Image-Processing
Midterm3.py
Midterm3.py
py
1,105
python
en
code
0
github-code
6
10502033252
# https://www.geeksforgeeks.org/find-the-smallest-positive-number-missing-from-an-unsorted-array/ def missing(res): N = len(res) for i in range(0, N): if res[i] < N and res[i] > 0: res[res[i]-1] = -res[res[i]-1] # print(res) for i in range(0, N): if res[i] > 0: return i+1 if __name__ == '__main__': ...
anojkr/help
Array/smallest_missing_number_in_unsorted_array.py
smallest_missing_number_in_unsorted_array.py
py
455
python
en
code
0
github-code
6
3739410797
import requests from bs4 import BeautifulSoup import re def get_vote_links(current_page): """Finds the vote page links on the main folktingspage. Args: main_page_soup (_type_): Takes in the main page with all the vote subpages as a soap object Returns: _type_: Returns a list of soap Obje...
jonahank/Vote-Prediction-Model
utils/scraper_functions.py
scraper_functions.py
py
4,617
python
en
code
1
github-code
6
10138194613
from eth_keys.datatypes import ( PrivateKey, PublicKey, Signature, ) class BaseECCBackend(object): def __init__(self): self.PublicKey = type( '{0}PublicKey'.format(type(self).__name__), (PublicKey,), {'_backend': self}, ) self.PrivateKey = ty...
adithyabsk/loanchain
loanchain/lib/python2.7/site-packages/eth_keys/backends/base.py
base.py
py
1,000
python
en
code
5
github-code
6
75131970108
import requests headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"} "ไผ ๅ…ฅๅ‚ๆ•ฐ็š„ๅฝขๅผ" params = {"wd":"haha"} "ๆœ€ๅŽ้ข็š„้—ฎๅทๅฏๅŠ ๅฏไธๅŠ ๏ผŒไธๅŠ ็š„่ฏ๏ผŒ็จ‹ๅบไผš่‡ชๅŠจๅธฎไฝ ๅŠ ไธŠ" url_temp = "https://www.baidu.com/?" "ๆณจๆ„็”จrequests่ฐƒ็”จpostๅ’Œgetๆ—ถ็š„ๅ‡ฝๆ•ฐ" r = requests.get(url_temp, ...
hahahei957/NewProject_Opencv2
venv_2/็ˆฌ่™ซ/01_HelloWorld.py
01_HelloWorld.py
py
874
python
zh
code
0
github-code
6
9512772188
import sys import pandas as pd import numpy as np import xml.dom.minidom #from exercise 3 def output_gpx(points, output_filename): """ Output a GPX file with latitude and longitude from the points DataFrame. """ def append_trkpt(pt, trkseg, doc): trkpt = doc.createElement('trkpt') trkpt...
tomchiu19/tourPlanner
code/05-generate-gpx.py
05-generate-gpx.py
py
2,464
python
en
code
0
github-code
6
24254182121
import time import requester import json import config location_id_data = {} exclude_ids = config.settings["loc_ids_to_exclude"] # Gananoque & Tay Valley Old People One & Prescott def parseLocationsToDict(): # Locations.json is extracted from the bottom of the pomelo covid-vaccination "locations" html page whe...
TASelwyn/PomeloScraper
main.py
main.py
py
4,417
python
en
code
0
github-code
6
1708447421
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import ball_endmill from utility import mm_to_inch from utility import plot_circle def plot_spheremill_toolpos(params): # Extract parameters diam_tool = params['diam_tool'] diam_sphere = params['diam_sphere'] ...
willdickson/sphere_mill_gcode
sphere_mill_gcode/ball_endmill_viz.py
ball_endmill_viz.py
py
2,135
python
en
code
0
github-code
6
25693073835
# coding=gbk # ๅ‡ฝๆ•ฐpart_3 ่ฟ”ๅ›žๅ€ผ ๆดป็”จreturn่ฏญๅฅ # part_3.1 ่ฟ”ๅ›ž็ฎ€ๅ•ๅ€ผ def get_formatted_name(first_name, last_name): """่ฟ”ๅ›žๆ•ดๆด็š„ๅง“ๅ""" full_name = first_name + " " + last_name return full_name.title() musician = get_formatted_name('jen', 'hex') print(musician) # return่ฏญๅฅ่ฟ”ๅ›ž่ฐƒ็”จๅ‡ฝๆ•ฐ็š„ไปฃ็ ่กŒ # ่ฐƒ็”จ่ฟ”ๅ›žๅ€ผ็š„ๅ‡ฝๆ•ฐ้œ€่ฆๅŠ ไธŠๅ˜้‡ # part_3.2 ่ฎฉๅฎžๅ‚ๅ˜ๆˆๅฏ้€‰ ...
Troysps/learn_python
61/ๅ‡ฝๆ•ฐ3_่ฟ”ๅ›žๅ€ผ.py
ๅ‡ฝๆ•ฐ3_่ฟ”ๅ›žๅ€ผ.py
py
2,326
python
en
code
0
github-code
6
9661128383
def gcd(A: int, B: int): if B == 0: return A else: return gcd(B, A % B) A, B = map(int, input()) result = gcd(A, B) while result > 0: print(1, end='') result -= 1 # ํฐ์ชฝ์—์„œ ์ž‘์€ ์ชฝ์„ ๋‚˜๋ˆ ์„œ ๋–จ์–ด์ง€๋ฉด ์ž‘์€ ์ชฝ์ด ์ตœ๋Œ€ ๊ณต์•ฝ์ˆ˜ # ๋‚˜๋ˆ„์–ด ๋–จ์–ด์ง€์ง€ ์•Š์œผ๋ฉด 1, 0์ด๋ฉด ๋‚˜๋จธ์ง€ ํ•˜๋‚˜๊ฐ€ ์ตœ๋Œ€๊ณต์•ฝ ์ˆ˜
java-squid/lets-algorithm
07--number-theory/ragdoll/1850.py
1850.py
py
365
python
ko
code
0
github-code
6
18597795385
class BankCard: def __init__(self, number, cvc, first_name, last_name): self.number = number self.cvc = cvc self.first_name = first_name self.last_name = last_name def _luhn_algorithm(self, value): card_sum = 0 for index, digit in enumerate(value): di...
pyteacher123/py35-onl
lesson15/classwork/task2.py
task2.py
py
1,323
python
en
code
2
github-code
6
10933119158
import os import cv2 # commutator vision import numpy as np import matplotlib.pyplot as plt import tensorflow as tf mnist = tf.keras.datasets.mnist # The hand number nad what it is (x_train, y_train), (x_test, y_test) = mnist.load_data() # split to training data and test data || x is the pixle data y is what Number...
Zippy-boy/HandDigets
main.py
main.py
py
1,658
python
en
code
0
github-code
6
33702855496
import socket HOST = "127.0.0.1" # localhost PORT = 1234 # pixelflut-port with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: sock.connect((HOST, PORT)) XMIN=641 XMAX=1279 YMIN=0 YMAX=719 for y in range(YMIN, YMAX+1): for x in range(XMIN, XMAX+1): ...
HacktoberfestMunich/Hacktoberfest-2023
Teams/red_titans/src/RedBackground.py
RedBackground.py
py
403
python
en
code
0
github-code
6
73700516027
import os, time, gc import numpy as np import gym import random from gym import spaces from gym.utils import seeding from screeninfo import get_monitors import pybullet as p from .agents.objects import Object from .util import Util from .agents.agent import Agent class BaseEnv(gym.Env): def __init__(self, time_s...
gabriansa/collaborative-gym
collaborative_gym/envs/base_env.py
base_env.py
py
20,082
python
en
code
0
github-code
6
35037176201
import cv2 import numpy as np from analyzers.analyseContour import AnalyseContour from analyzers.contour import Contour class AnalyseSafran(AnalyseContour): """ Class qui mesure la taille du safran qui sort de l'eau. Attributs: x1RefPoint (int): coordonnรฉe x du premier point de rรฉfรฉrence corresp...
Torystan/analyse-images
analyzers/analyseSafran.py
analyseSafran.py
py
4,231
python
fr
code
0
github-code
6
38466019670
__author__ = 'christiaanleysen' import features.featureMaker as fm from sklearn.metrics import mean_absolute_error import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import LinearRegression from sklearn import preprocessing ''' This file is used to calculate the linear regression ''' def pre...
chrike-platinum/Thesis-Gaussian-process-regression-clustering-and-prediction-of-energy-consumption
Methods/LinRegPrediction.py
LinRegPrediction.py
py
1,353
python
en
code
1
github-code
6
23135628898
# Make Table 4: Snowdrift Type Census Zonal Statistics import pandas as pd df = pd.read_csv('drift_zonal_statistics_mean_over_time.csv', index_col=False) del df['Median Drift Depth [m]'] df.replace('watertrack', 'water track (f)', inplace=True) df.replace('polygon', 'ice wedge (f)', inplace=True) df.replace('stream...
charparr/arctic-snowdrifts
snowdrift_type_census/results/make_table_4.py
make_table_4.py
py
1,271
python
en
code
0
github-code
6
27267969236
from flask import Flask, render_template from shp_display import * app = Flask(__name__) def script(): return ['hades2'] def get_table(db): db = db script = "<table>" # Header Generator code = "<tr>" for s in db: if str(s) != "MULTIPOLYGON" and str(s) != 'geometry': cod...
nitish8090/Watershed_Modules_Py3
flask_app/app.py
app.py
py
1,373
python
en
code
0
github-code
6
37964221731
import sys import os import random from PIL import Image ''' Simple image carver. Right now it will assemble any and all JPEGS found including partial fragmented files. It does not find the rest of the file. You must have pillow installed. You can do that by `pip install pillow`. YOU MUST HAVE PYTHON 3 NOT 2! THE Pi...
steviekong/Jpeg_carver
carver.py
carver.py
py
3,434
python
en
code
1
github-code
6
26247964346
import six import webob.exc from oslo_log import log from delfin.i18n import _ LOG = log.getLogger(__name__) class ConvertedException(webob.exc.WSGIHTTPException): def __init__(self, exception): self.code = exception.code self.title = '' self.explanation = exception.msg self.err...
sodafoundation/delfin
delfin/exception.py
exception.py
py
8,827
python
en
code
201
github-code
6
16543442339
# RE_DATA names DATA_BLOCK = "Data" ACTION = "Action" STAGE = "Stage" STATIONFROM = "StationFrom" STATIONFROMCODE = "StationFromCode" STATIONTO = "StationTo" STATIONTOCODE = "StationToCode" DEPARTDATE = "DepDate" DEPARTTIME = "DepTime" BADDATE = "BadDate" BADTIME = "BadTime" ARRTIME = "ArrTime" STATIONAT = "StationAt" ...
Grimmii/TrainChatBot
src/ai_chatbot/scripts/REDataHeader.py
REDataHeader.py
py
806
python
en
code
0
github-code
6
1601092211
__author__ = "Meet Dave" __version__ = "1.0" __maintainer__ = "Meet Dave" __email__ = "meetkirankum@umass.edu" # Load libraries import matplotlib.pyplot as plt import torch import cv2 import numpy as np from torchvision import models from torchvision import transforms from make_video import make_video # Load pret...
meetdave06/random-cv-tasks
test1/test1.py
test1.py
py
2,455
python
en
code
0
github-code
6
73727669948
import torch def get_device(model=None): """Returns two-tuple containing a PyTorch device (CPU or GPU(s)), and number of available GPUs. Returns a two-tuple containing a PyTorch device (CPU or GPU(s)) and number of available CUDA devices. If `model` is not None, and a CUDA device is available, the model...
bowang-lab/Transformer-GCN-QA
src/utils/model_utils.py
model_utils.py
py
2,040
python
en
code
15
github-code
6
24199424367
# -*- coding: utf-8 -*- """ Created on Tue Jun 25 15:22:37 2019 @author: Administrator """ # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None import test_module from queue import PriorityQueue class Node: def __init__(self, prior...
AiZhanghan/Leetcode
code/23. Merge k Sorted Lists.py
23. Merge k Sorted Lists.py
py
1,325
python
en
code
0
github-code
6
18821603273
import os def rename_files(): # 1 get file names from a folder # r stands for raw path file_list = os.listdir(r"D:\workspace\Udacity\Course 1\Lesson 1\Prank") print(file_list) os.chdir(r"D:\workspace\Udacity\Course 1\Lesson 1\Prank") # 2 for each file, rename file for file_name in file...
joshuar500/full-stack-nano
Course 1/Lesson 1/rename_files.py
rename_files.py
py
438
python
en
code
0
github-code
6
73675801466
import os, sys proj_path = "/home/webuser/webapps/tigaserver/" os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tigaserver_project.settings") sys.path.append(proj_path) os.chdir(proj_path + "util_scripts/") from django.core.wsgi import get_wsgi_application application = get_wsgi_application() from django.db.model...
Mosquito-Alert/mosquito_alert
util_scripts/check_in_progress_reports.py
check_in_progress_reports.py
py
1,276
python
en
code
6
github-code
6
39380382951
import datetime import jpholiday from django import template register = template.Library() # Djangoใฎใƒ†ใƒณใƒ—ใƒฌใƒผใƒˆใ‚ฟใ‚ฐใƒฉใ‚คใƒ–ใƒฉใƒช # ใ‚ซใ‚นใ‚ฟใƒ ใƒ•ใ‚ฃใƒซใ‚ฟใจใ—ใฆ็™ป้Œฒใ™ใ‚‹ @register.filter def get_dict_value(dictionary, key): return dictionary.get(key) @register.filter def append_string(dest, src): return dest + src @register.filter def get_day_...
manakamu/docker
django/Docker-Django/django_project/pole/templatetags/pole_tags.py
pole_tags.py
py
1,141
python
ja
code
0
github-code
6
39463837440
# Standard library imports import serial import time import sys import zerorpc import datetime # Application library imports from MySQLhandler import * import Utility SCRIPT_NAME = "RFIDhandler" TIME_BEFORE_ACTIVATION = 60 * 5 print("Initialize serial connection with Arduino") try: s = serial.Serial('/dev/ttyAC...
jeremyalbrecht/Alarm-RPI
RFIDhandler.py
RFIDhandler.py
py
2,490
python
en
code
0
github-code
6
43367818416
# Importancia de la caracterรญstica de permutaciรณn (PFI) para la clasificaciรณn de latidos utilizando un perceptrรณn multicapa (MLP) # # # - Cรณdigo 'PFI.py' # - Trabajo Fin de Mรกster. # - Nรฉstor Bolaรฑos Bolaรฑos. (nestorbolanos@correo.ugr.es) import warnings warnings.filterwarnings("ignore") import numpy as np imp...
Nestructor/Codigo_TFM_Aplicacion-del-Aprendizaje-Profundo-en-la-toma-de-Decisiones-Clinicas-Informadas
PFI.py
PFI.py
py
6,333
python
es
code
0
github-code
6
36774550355
class Solution(object): def equalPairs(self, grid): """ :type grid: List[List[int]] :rtype: int """ dic = defaultdict(int) no_pair = 0 rows = len(grid) cols = len(grid[0]) for i in range(rows): dic[tuple(grid[i])] += 1 ...
nathy-min/Competitive-Programming
2352-equal-row-and-column-pairs/2352-equal-row-and-column-pairs.py
2352-equal-row-and-column-pairs.py
py
494
python
en
code
2
github-code
6
43216118551
import graphlab as gl import urlparse settings = {'client_log': 's3://dato-demo-metrics/client-logs', 'server_log_old': 's3://gl-testing-chris/log/strata-predictive-service-three_logs', 'server_log_old2': 's3://dato-stratanow/logs/stratanow_logs', 'server_log': 's3://dato-stratanow/...
turi-code/Strata-Now
data/metrics.py
metrics.py
py
1,912
python
en
code
4
github-code
6
42440314481
import plotly.express as px import plotly.graph_objs as go import pandas as pd from sklearn.decomposition import PCA import numpy as np #****************** Rรฉcupรฉration des donnรฉes CSV ************************# df = pd.read_csv("https://simplonline-v3-prod.s3.eu-west-3.amazonaws.com/media/file/csv/be67fa74-2c34-419...
AbdiNi/Plotly-Dash
Dash_Plotly/My_dataset.py
My_dataset.py
py
4,007
python
en
code
0
github-code
6
29059896663
import imageio import torch import torch.nn.functional as F import numpy as np import os, argparse os.environ["CUDA_VISIBLE_DEVICES"] = "0" from net.bgnet import Net from utils.tdataloader import test_dataset parser = argparse.ArgumentParser() parser.add_argument('--testsize', type=int, default=416, help='testing size...
thograce/BGNet
etest.py
etest.py
py
1,718
python
en
code
57
github-code
6
38049723382
import sys import os import yaml import json CUSTOM_WORD_LIST_FILENAME = '.wordlist.txt' def find_wordlist_files(path): wordlist_paths = [] for root, dirs, files in os.walk(path): for file in files: if file.endswith(CUSTOM_WORD_LIST_FILENAME): wordlist_paths.append(os.path....
actions-marketplace-validations/jordanbean-msft_wth-spell-check-action
generate-spellcheck.py
generate-spellcheck.py
py
1,153
python
en
code
0
github-code
6
3962586718
import sys import os import random import matplotlib.pyplot as plt from typing import List BASE_FILENAME="develop" OUTPUT_TYPE="png" def create_pie_chart(keywords: List[str], base_filename: str, output_type: str): data = [] explode = [] biggest_value = 0 biggest_iterator = 0 for i, _ in enumerate...
neilschark/bullshitgraphs
bullshitgraphs/bullshitgraphs.py
bullshitgraphs.py
py
1,675
python
en
code
1
github-code
6
962892446
from tkinter import * from tkinter.messagebox import showinfo import pandas as pd import numpy as np import sklearn as sk from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt # function call def cal(): data = pd.read_csv("2a.csv") if (var1.get()=='123'): showinf...
Santonu-Naskar/Rainfall-Prediction
rainfall/main/main1.py
main1.py
py
3,959
python
en
code
0
github-code
6
73652302269
# ็ผ–ๅ†™ไธ€ไธชๅ‡ฝๆ•ฐ๏ผŒ่พ“ๅ…ฅๆ˜ฏไธ€ไธชๆ— ็ฌฆๅทๆ•ดๆ•ฐ๏ผˆไปฅไบŒ่ฟ›ๅˆถไธฒ็š„ๅฝขๅผ๏ผ‰๏ผŒ่ฟ”ๅ›žๅ…ถไบŒ่ฟ›ๅˆถ่กจ่พพๅผไธญๆ•ฐๅญ—ไฝๆ•ฐไธบ '1' ็š„ไธชๆ•ฐ๏ผˆไนŸ่ขซ็งฐไธบๆฑ‰ๆ˜Ž้‡้‡๏ผ‰ใ€‚ class Solution(object): def hammingWeight(self, n): """ :type n: int :rtype: int """ ret = 0 while n: n &= n - 1 ret += 1 return ret
xxxxlc/leetcode
Bit/hammingWeight.py
hammingWeight.py
py
397
python
zh
code
0
github-code
6
27137014730
#Programmer Sadiq #By@Sadiqul Islam #Use of sum() function #sum() function #Syntax of sum() function : sum(iterable,start) #If you want to add all element of list.So you use it #Example 1 list1 = list(range(0,11)) #list app = sum(list1,0) #use of sum() function print(app) #add element of list #Example 2 ...
swesadiqul/python-list
sum() function.py
sum() function.py
py
470
python
en
code
0
github-code
6
2053821942
from config import dogs_and_cats_config as config from pyimagesearch.preprocessing import ImageToArrayPreprocessor, MeanPreprocessor, CropPreprocessor from pyimagesearch.io import HDF5DatasetGenerator from keras.models import load_model import progressbar import json import numpy as np import cv2 import argparse import...
lykhahaha/Mine
PractitionerBundle/chapter10-dogs_vs_cats/crop_accuracy_public_test.py
crop_accuracy_public_test.py
py
1,859
python
en
code
0
github-code
6
30192351629
import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from sklearn.datasets import load_iris iris = load_iris() X = iris.data y = iris.target def sigmoid(inX):# ๅฎšไน‰sigmoidๅ‡ฝๆ•ฐ return 1.0/(1+np.exp(-inX)) def std_da...
TJPU-ML/Homework-for-the-fall-semester-of-2018
iris classification/็Ž‹็†™็…š/lris.py
lris.py
py
2,416
python
en
code
0
github-code
6
30950837477
def D0(fp): Dt = 1 taur = 1./(3*Dt) return fp**2*taur/2. def rms(fp,ts): Dt = 1 taur = 1./(3*Dt) d = 2 tts = ts*1e-5 return 4*Dt*tts+fp**2*taur**2/(d*(d-1))*(2*d*tts/taur+np.exp(-2*d*tts/taur)-1) def swim(fp,rho): Dt = 1 taur = 1./(3*Dt) return rho*fp*fp*taur/2.0...
samueljmcameron/ABPs_coarse_graining
experiments/2020_03_31/no_interactions_pressure/single_pressure.py
single_pressure.py
py
1,818
python
en
code
0
github-code
6
73279162747
import numpy as np import matplotlib.pyplot as plt # system variables fs = 100e3 f = 1e3 phi = np.pi/4 N = 4*fs/f n_var = 0.01 # create some empty vectors to fill x = np.zeros(N, dtype=complex) n_a = np.zeros(N, dtype=complex) e = np.zeros(N) w = np.zeros(N) y = np.zeros(N, dtype=complex) y_ = np.zero...
yrrapt/ada-comms
sinusoid_estimate_noise.py
sinusoid_estimate_noise.py
py
1,012
python
en
code
0
github-code
6
12242514248
#!/usr/bin/env python from rootpy import ROOT from rootpy.io import File from rootpy.tree import Tree from collections import deque def find_maintenance(filename): aux_file = File(filename, 'read') aux_tree = aux_file.get('t_hk_obox') maintenance_start = False maintenance_list = [] gps_time_list =...
ZhenghengLi/POLAR_DATA
Preprocessing/script/split_time.py
split_time.py
py
2,130
python
en
code
2
github-code
6
2568321990
from DATA.datamanager import Datamanager dm=Datamanager() """ woorden=dm.alle_woorden() for woord in woorden : print (woord[1] ) woord = "abluties" woord=dm.check_by_zoekterm(woord,woord[0]) print (woord) """ woord = "daar" woord=dm.check_by_zoekterm_alle_woorden(woord) print (woord) """a="test" print (len(a)) p...
johangoyvaerts/PhytonicWordGame-johan
test.py
test.py
py
523
python
en
code
0
github-code
6
18446576990
from django.conf import settings from django.contrib import messages from django.http import HttpResponseRedirect from allauth.account import signals from allauth.account.adapter import DefaultAccountAdapter class AccountAdapter(DefaultAccountAdapter): def is_open_for_signup(self, request): return getatt...
epicserve/django-base-site
apps/accounts/auth_adapter.py
auth_adapter.py
py
1,443
python
en
code
284
github-code
6
16647141836
import os import pandas as pd import numpy as np from tqdm.auto import tqdm from textaugment import EDA from nltk.tokenize import word_tokenize class DataProcessing: def __init__(self, input_path, output_path): self.input_path = input_path self.output_path = output_path self.X = None ...
marynadorosh/test_task
src/data/make_dataset.py
make_dataset.py
py
2,626
python
en
code
0
github-code
6
31437732860
#!/bin/usr/python3 # Coding: utf-8 # Author: Rogen # Description: ๆคๆ ช็Œๆบ‰็ด€้Œ„ from tkinter import ttk, messagebox from GUI_language import * import subprocess import csv, os import pandas as pd import tkinter as tk class Water_management(object): def __init__(self,ver,code): self.language = ver self.internal_code =...
NCHU-rogen/ExpertSystem_Project
Planting_water.py
Planting_water.py
py
5,947
python
en
code
0
github-code
6
16270189491
import pymysql import datetime def insert(outsideTemp, insideTemp, targetTemp, fanState): sql = "INSERT INTO FANS ( `time`, `outside_temp`, `inside_temp`, `target_temp`, `fan_state`) " sql += "VALUES ( \"{0}\", {1}, {2}, {3}, {4})".format(datetime.datetime.now(), outsideTemp, insideTemp, targetTemp, fanState) ...
scottware/fans
database.py
database.py
py
1,653
python
en
code
0
github-code
6
27513964476
# -*- coding: utf-8 -*- import os import sys import io import math def synthesize_asic_entity(yosys_location, yosys_synth_script, target_cell, entity_name, timing_constraint, synthesis_output_folder): # Check if folder exists, and if not create if(not os.path.isdir(synthesis_output_folder)): os.mkdir(...
tintin10q/subterranean2digital
Reference_code/verilog_project/yosys_synth/synth.py
synth.py
py
11,689
python
en
code
0
github-code
6
26625188476
from django.conf import settings from django.core import urlresolvers from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ from product.modules.downloadable.models imp...
dokterbob/satchmo
satchmo/apps/product/modules/downloadable/views.py
views.py
py
4,066
python
en
code
30
github-code
6
40633067575
from django.urls import path from .views import ( add_to_cart, delete_from_cart, order_details, checkout, update_transaction_records, success ) app_name = 'cart' urlpatterns = [ path('^add-to-cart/<int:pk>/<slug:slug>/', add_to_cart, name="add_to_cart"), path('^order-summary/', order_d...
sadakchap/cfe-ecom
cart/urls.py
urls.py
py
662
python
en
code
0
github-code
6
20164701509
import cv2 import mediapipe as mp from handLandmarksDefine import * from objectCoords import * import time import numpy as np import math import serial start_time = 0 end_time = 0 try: arduino = serial.Serial('COM3', 9600) except serial.serialutil.SerialException: print("Arduino not connected") # lm = landm...
vladpasat/HandFlow0
handTrackingModule.py
handTrackingModule.py
py
16,607
python
en
code
0
github-code
6
8099648005
import pandas as pd import pydotplus from IPython.display import Image from sklearn import metrics from sklearn.externals.six import StringIO from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier, export_graphviz # nazwy wszystkich kolumn z CSV column_names = ['Elevation'...
fedoruka/fct_classification
main.py
main.py
py
2,347
python
en
code
0
github-code
6
34004358765
import numpy as np import pandas as pd class FillNa: params = [True, False] param_names = ["inplace"] def setup(self, inplace): N = 10 ** 6 rng = pd.date_range("1/1/2000", periods=N, freq="min") data = np.random.randn(N) data[::2] = np.nan self.ts = pd.Series(dat...
Tommyhappy01/8-PANDAS
asv_bench/benchmarks/replace.py
replace.py
py
2,121
python
en
code
4
github-code
6
41682530680
"""add directory id to address Revision ID: 19e625982be8 Revises: a9adfd3c2eba Create Date: 2018-02-02 23:11:03.395662 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '19e625982be8' down_revision = 'a9adfd3c2eba' branch...
MondayHealth/provider-import
alembic/versions/19e625982be8_add_directory_id_to_address.py
19e625982be8_add_directory_id_to_address.py
py
973
python
en
code
0
github-code
6
8366348060
# /usr/bin/env python # -*- coding:utf-8 -*- import sys import math from dataclasses import dataclass from functools import reduce from functools import wraps """ ่ฟญไปฃๅ™จ ่ฟญไปฃๆ˜ฏPythonๆœ€ๅผบๅคง็š„ๅŠŸ่ƒฝไน‹ไธ€๏ผŒๆ˜ฏ่ฎฟ้—ฎ้›†ๅˆๅ…ƒ็ด ็š„ไธ€็งๆ–นๅผใ€‚ ่ฟญไปฃๅ™จๆ˜ฏไธ€ไธชๅฏไปฅ่ฎฐไฝ้ๅކ็š„ไฝ็ฝฎ็š„ๅฏน่ฑกใ€‚ ่ฟญไปฃๅ™จๅฏน่ฑกไปŽ้›†ๅˆ็š„็ฌฌไธ€ไธชๅ…ƒ็ด ๅผ€ๅง‹่ฎฟ้—ฎ๏ผŒ็›ดๅˆฐๆ‰€ๆœ‰็š„ๅ…ƒ็ด ่ขซ่ฎฟ้—ฎๅฎŒ็ป“ๆŸใ€‚่ฟญไปฃๅ™จๅช่ƒฝๅพ€ๅ‰ไธไผšๅŽ้€€ ่ฟญไปฃๅ™จๆœ‰ไธคไธชๅŸบๆœฌ็š„ๆ–นๆณ•๏ผš iter() ๅˆ›ๅปบ่ฟญไปฃๅ™จ ...
renxiaowei-1991/pythonLearn
a01PythonLearn/package/b01PythonLearn/c23ClassHighLearn.py
c23ClassHighLearn.py
py
24,298
python
zh
code
0
github-code
6
37176092039
import numpy as np import cv2 # Check available mouse events available with opencv library # events = [i for i in dir(cv2) if 'EVENT' in i] # print(events) # General Callback function used for handling mouse events def click_event(event, x, y, flags, param): # Show x and y coordinate if event == cv2.EVENT_LB...
sbhrwl/object_detection
src/opencv/mouse_events/handle_mouse_event.py
handle_mouse_event.py
py
1,226
python
en
code
0
github-code
6
8101165169
import requests import json from config import keys class ConvertionException(Exception): pass class CryptoConverter: @staticmethod def get_price(quote: str, base: str, amount: str): if quote == base: raise ConvertionException(f'ะ’ั‹ ะฒะฒะตะปะธ ะพะดะธะฝะฐะบะพะฒั‹ะต ะฒะฐะปัŽั‚ั‹ {base}.') ...
voxvt/botexam
utils.py
utils.py
py
1,270
python
ru
code
0
github-code
6
70968292347
import cv2 import numpy as numpy import os detector = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml') recognizer = cv2.face.LBPHFaceRecognizer_create() recognizer.read("trainer/trainer.yml") font = cv2.FONT_HERSHEY_SIMPLEX id = 0 name = ['none', 'Godswill', 'Ebere', 'Godswill', 'handle'] cap = cv2.VideoCap...
awesomegusS/cv
recognizer.py
recognizer.py
py
1,158
python
en
code
0
github-code
6
21141233312
import datetime import json import os import time import pandas as pd import requests from mystockdata import config, db from mystockdata.db import DatetimeIndexMixin, PrefixedDfDb from mystockdata.exceptions import HistoryDataError class ShSeDb(DatetimeIndexMixin, PrefixedDfDb): prefix = 'sh_se_' class CybSe...
onecans/my
mystockdata/mystockdata/se.py
se.py
py
9,831
python
en
code
2
github-code
6
72226014269
from flask import Flask from flask_sqlalchemy import SQLAlchemy import os import datetime from sqlalchemy.dialects.postgresql import ARRAY app = Flask(__name__) SECRET_KEY = os.urandom(32) app.config['SECRET_KEY'] = SECRET_KEY app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///db.sqlite" app.config['RECAPTCHA_USE_S...
dananguyenucsb/ithinkihavecovid-19
model.py
model.py
py
1,606
python
en
code
1
github-code
6
20972559660
import torch from tools.image import transforms, cv from tools.image.index_map import default_map from tools import tensor def to_rgb(hex): return ((hex >> 16) & 255, (hex >> 8) & 255, (hex >> 0) & 255) def draw_box(image, box, scale=1.0, name=None, confidence=None, thickness=2, color=(255, 0, 0), text_color=...
oliver-batchelor/detection
detection/display.py
display.py
py
3,548
python
en
code
0
github-code
6
21712175054
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from optparse import make_option from ...scraper import Scrap class Command(BaseCommand): option_list = BaseCommand.option_list + (make_option( '--url', action='store', dest='url', help='Sub...
jms/FlyNi-API
flyni_api/flyni/management/commands/get_data.py
get_data.py
py
500
python
en
code
0
github-code
6
73364821308
# ้€š่ฟ‡่ฏปๅ–ssr-> txt็š„ๆ–‡ไปถไธญๆŸฅๆ‰พๅฏนๅบ”็š„ๆ–‡ๅญ—็‰‡ๆฎต่€Œๅฏผๅ‡บๅฏนๅบ”็š„ๆ—ถ้—ดๆˆณ """ 1. ่ฏปๅ–ๆ–‡ไปถ 1.1 ่พ“ๅ…ฅ้œ€่ฆๆŸฅๆ‰พ็š„็ฑปๅž‹๏ผˆๅŒ…ๆ‹ฌ๏ผšๅญ—ๅน•๏ผ‰ 1.2 ่พ“ๅ…ฅ้œ€่ฆๆŸฅๆ‰พ็š„ๆ–‡ไปถ 1.3 ่ฏปๅ–ๅฏนๅบ”ๆ–‡ไปถ 2. ่พ“ๅ…ฅ้œ€่ฆๆŸฅๆ‰พ็š„ๆ–‡ๅญ—ๅ†…ๅฎน 2.1 ๅŒๆ—ถๆŸฅๆ‰พ3ไธช่ฏ 3. ่ฟ›่กŒ่‡ชๅŠจๅŒ–ๆŸฅๆ‰พๅฏนๅบ”็š„ๅ†…ๅฎน 3.1 ่ฟ›่กŒๅŒๆ—ถๆŸฅๆ‰พ1.0็‰ˆๆœฌ,้’ˆๅฏน3ไธช่ฏ่ฟ›่กŒๅŒไธ€ๅŒน้… 4. ่พ“ๅ‡บๅฏนๅบ”็š„ๅ†…ๅฎน็š„ๆ—ถ้—ดๆˆณ 4.1 ๆ—ถ้—ดๆˆณ่šๅˆ 4.2 ่พ“ๅ‡บๅฏนๅบ”็š„ๆ–‡ไปถ """ def zimu_time(search_letter_list,file_name,sum_time): # 1.0 ่ฏปๅ–ๆœฌ้กน็›ฎไธญ็š„ๆ–‡ไปถ f = open(file_name,"r",encoding=...
ExplosiveElements/letter_time
zimu.py
zimu.py
py
4,494
python
en
code
0
github-code
6
8245327650
from pymongo import MongoClient from fastapi import HTTPException from datetime import datetime class ModekenSystemManager: def __init__(self, username, password): self.client = MongoClient(f'mongodb://{username}:{password}@db.modeken-system.com:27017') self.db = self.client['modeken-system'] ...
tochiman/modeken-ticket-system
backend/src/mongo.py
mongo.py
py
5,068
python
en
code
0
github-code
6
74796405626
import torch import torchvision from torch import nn from torch.nn import Sequential, Conv2d, MaxPool2d, Flatten, Linear from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter train_dataset = torchvision.datasets.CIFAR10(root="../dataset_CIFAR10", train=True, download=True, ...
ccbit1997/pytorch_learning
src/cifar10_model.py
cifar10_model.py
py
1,591
python
en
code
0
github-code
6
6250184169
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 19 12:46:12 2018 @author: CTF Team """ from PyQt5 import uic,QtCore, QtGui, QtWidgets from PyQt5.QtCore import QSize, Qt import CompanyTaxUI import sys import pandas as pd import csv import numpy as np class ApplicationWindow(QtWidgets.QMainWindow)...
larry2967/academic-projects
taxcalculator/CompanyTaxSavingsApp.py
CompanyTaxSavingsApp.py
py
14,683
python
en
code
0
github-code
6
10423167833
from __future__ import annotations import dataclasses from random import Random from unittest.mock import MagicMock import pytest from randovania.game_description.game_patches import GamePatches from randovania.game_description.resources.pickup_index import PickupIndex from randovania.game_description.resources.reso...
randovania/randovania
test/games/prime2/generator/test_echoes_bootstrap.py
test_echoes_bootstrap.py
py
3,634
python
en
code
165
github-code
6
8385237281
from __future__ import absolute_import from __future__ import print_function import os import sys from argparse import ArgumentParser if 'SUMO_HOME' in os.environ: sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) import sumolib # noqa def get_options(args=None): parser = ArgumentParser(descr...
ngctnnnn/DRL_Traffic-Signal-Control
sumo-rl/sumo/tools/turn-defs/turnFile2EdgeRelations.py
turnFile2EdgeRelations.py
py
1,716
python
en
code
17
github-code
6
14205921043
import collections class Node: def __init__(self, value): self.value = value self.neighbours = [] def make_graph(n_of_nodes, edges): graph = [] for i in range(n_of_nodes): node = Node(i+1) graph.append(node) for first_node, second_node in edges: ...
jdalbosco/hackerrank
preparation-kits/one-week/d6-mock_test.py
d6-mock_test.py
py
1,287
python
en
code
0
github-code
6
37430288968
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: ็ฅจๅ‹ๆœบ็ฅจ้ข„่ฎข็ณป็ปŸ10ๅค„SQLๆณจๅ…ฅ referer: http://www.wooyun.org/bugs/wooyun-2010-0118867 author: Lucifer description: multi sqliใ€‚ ''' import sys import requests class piaoyou_ten_sqli_BaseVerify: def __init__(self, url): self.url = url def run(self): h...
iceyhexman/onlinetools
scanner/plugins/cms/piaoyou/piaoyou_ten_sqli.py
piaoyou_ten_sqli.py
py
1,575
python
en
code
1,626
github-code
6
74725395066
from datetime import datetime from pynamodb.models import Model from pynamodb.attributes import UnicodeAttribute, NumberAttribute, UTCDateTimeAttribute from flask_blog.lib.utils import is_production import os class Entry(Model): class Meta: table_name = "serverless_blog_entries" region = 'ap-north...
uni51/serverless_python_tutorial
application/flask_blog/models/entries.py
entries.py
py
1,030
python
en
code
0
github-code
6
72995183868
import os import sys import time import struct import debug import eosapi from eosapi import N, push_transactions from common import prepare, Sync from tools import cpp2wast def init_debug(wasm=True): def init_decorator(func): def func_wrapper(*args, **kwargs): if wasm: _src_di...
learnforpractice/pyeos
programs/pyeos/tests/wasm/lab/t.py
t.py
py
3,368
python
en
code
131
github-code
6
10966117387
import os import clip import torch.nn as nn from datasets import Action_DATASETS from torch.utils.data import DataLoader from tqdm import tqdm import wandb import argparse import shutil from pathlib import Path import yaml from dotmap import DotMap import pprint import numpy from modules.Visual_Prompt imp...
Lycus99/SDA-CLIP
test.py
test.py
py
11,801
python
en
code
0
github-code
6
3469450468
# As per the requirements: # Marshall Christian 001520145 # This table was inspired with the help of Cemel Tepe as well as Cemel Tepe - "Let's go hashing" # Space complexity = O(n) class HashTable(object): def __init__(self, size=10): self._struct = self.struct_creation(size) # insert() hashes the ...
MarsTheProgrammer/Delivery-System-for-Packages
HashTable.py
HashTable.py
py
2,237
python
en
code
0
github-code
6
44091100190
import os import os.path import numpy as np from PIL import Image from PIL import ImageDraw from PIL import ImageFont _logo_fonts = { "Arial" : ImageFont.truetype(os.path.abspath(os.path.dirname(__file__))+"/arial.ttf", 200), "ArialBold" : ImageFont.truetype(os.path.abspath(os.path.dirname(__file__...
jisraeli/DeepBind
code/libs/deepity/deepity/tape2logo.py
tape2logo.py
py
13,154
python
en
code
85
github-code
6
14038264100
from app.email_body import EmailBody class User: def __init__(self, name, nickname, email, locations): self.name = name self.nickname = nickname self.email = email self.locations = locations self.artists = [] self.venues = [] self.promoters = [] self...
polyccon/ra-events-notifier
app/user.py
user.py
py
2,621
python
en
code
1
github-code
6
43243820127
from PyQt5.QtCore import QThread, pyqtSignal from simplekml import Kml, Snippet, Types from math import radians, cos, sin, asin, degrees, atan2 import os class PlotFiles(QThread): progressSignal = pyqtSignal(int) threadMessage = pyqtSignal(str) def __init__(self, results, issilist, google, gps): ...
stephenmhall/Coordinator_parser
plotfile.py
plotfile.py
py
5,066
python
en
code
0
github-code
6
73712875067
import pandas as pd import os def splitByDay(): for num in range(1,9,1): print("now is working in---"+"HO_",num,".csv") print('\n') #df=pd.read_csv("HO_{}.csv".format(str(num) ) ) data_train=pd.read_csv("I:\Anacoda3\AcondaProject\dataOfOrderAnalysis\HO_...
jasscical/pythonLearning
06_ๆŒ‰ๆฏๅคฉๅˆ‡ๆˆ184ๅผ ่กจ.py
06_ๆŒ‰ๆฏๅคฉๅˆ‡ๆˆ184ๅผ ่กจ.py
py
3,149
python
en
code
0
github-code
6
7847083907
#!/usr/bin/env python """ .. module::robot_state :platform: Unix :synopsis: Python module for the state machine ROS node which keeps track of the robot pose and battery status. Being a simpler version, for the documentation please refer to `the original code <https://github.com/buoncubi/arch_skeleton>`_ ""...
SamueleD98/assignment_1
scripts/robot_state.py
robot_state.py
py
2,198
python
en
code
0
github-code
6
32381382238
import string import os import random import bs4 from urllib import request url = "http://reddit.com" urlPage = request.urlopen(url).read() soup = bs4.BeautifulSoup(urlPage, "html.parser") img_list = [] for img in soup.find_all('img'): img_item = str(img.get('src')).split('//') img_list.append(img_item[1]) #print...
techreign/Webscraping
ImageScraper.py
ImageScraper.py
py
739
python
en
code
0
github-code
6
27520740533
import os import datetime import netCDF4 def handle_netcdf_scheme_wrf(var_names, file_name, run, model, st): # try: if os.path.exists(file_name): data_list = [] file = netCDF4.Dataset(file_name) var1 = file.variables[var_names[0]][:] var2 = file.variabl...
RevertonLuis/Ensemble
lib/handle_netcdfs.py
handle_netcdfs.py
py
2,022
python
en
code
1
github-code
6
10502966682
from rest_framework.test import APITestCase from ...services.notification_service import NotificationService from django.urls import reverse class TestNotificationAPI(APITestCase): def setUp(self): self.payload = { "title": "Winter discount sale started", "description": "Enter cou...
anojkr/onboarding-project
push_notification/apps/notification/tests/unit/test_notification.py
test_notification.py
py
1,381
python
en
code
0
github-code
6
43447073770
import sys, re from argparse import ArgumentParser parser = ArgumentParser(description = 'Calculate the percentage of each nucleotide in the sequence') parser.add_argument("-s", "--seq", type = str, required = True, help = "Input sequence") args = parser.parse_args() seq = seq.upper() if re.search('^[ACGTU]+$', args....
stepsnap/git_HandsOn
Percentage.py
Percentage.py
py
1,350
python
en
code
0
github-code
6
44855918296
class Solution: def countBits(self, num): """ :type num: int :rtype: List[int] """ if num < 0: return [0] ans = [] for i in range(0,num+1): ans.append(len(bin(i)[2:].replace('0',''))) return ans
sandeepjoshi1910/Algorithms-and-Data-Structures
countbits.py
countbits.py
py
308
python
en
code
0
github-code
6
4582056106
import numpy as np import pandas as pd from matplotlib import pyplot as plt import seaborn as sns from scipy import stats import collections import time from sklearn import cluster from sklearn.metrics import adjusted_rand_score import scipy as sp from tqdm import tqdm from sklearn.manifold import MDS from run_dist_mat...
pdavar/Analysis-of-3D-Mouse-Genome-Organization
chromosome_alignment.py
chromosome_alignment.py
py
16,670
python
en
code
0
github-code
6
200126759
import torch import torchvision.transforms as transforms from PIL import Image from model import LeNet device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") def main(): transform = transforms.Compose( [transforms.Resize((32, 32)), transforms.ToTensor(), transforms.Nor...
ChengZhangX/Deeplearning-for-cv
LetNet model/predict.py
predict.py
py
893
python
en
code
0
github-code
6
73983128507
import numpy as np import sys matrix = None def main(): global matrix matrix = np.array([[1,1,-1],[6,2,2],[-3,4,1]],dtype=float) aug_matrix = np.concatenate((matrix,identity_matrix(3)),axis=1) #gaussian2(aug_matrix) #gaussian elimination with maximum pivoting LUdecomp(matrix) #LU decompose...
akiraminase/numerical_methods
matrix_calc.py
matrix_calc.py
py
2,023
python
en
code
0
github-code
6