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
19771467472
from flask import Flask, jsonify, request, send_from_directory from flask_cors import CORS import os import dateData import csvContent from utilFunctions import * import json DEBUG = True UPLOAD_FOLDER = './uploads/' UPLOADS_DATE_DATA_PATH = 'resources/uploadDates.txt' app = Flask(__name__) app.config.from_object(__...
Eamon-Crawford/flaskVueProject
server/app.py
app.py
py
3,713
python
en
code
0
github-code
90
9017751390
from flask import Flask, render_template from flask_restful import Api from db import db from resources.game import GameByCategory, GameByPlatform, GameList from resources.checkhealth import CheckHealth from resources.recreate import ReCreateSchema import os import logging import logging.config import watchtower import...
EliranKasif/CloudSchool-PythonRestApi
app.py
app.py
py
3,380
python
en
code
0
github-code
90
3618138444
""" This module contains the Level class. Drawing and updating of actors should occur here. """ import pygame as pg from data.core import tools from . import constants class Level(object): """ This class represents the whole starscape. The starscape consists of three star layers. The player is drawn a...
reddit-pygame/Python_Arcade_Collab
data/games/space_war/level.py
level.py
py
3,307
python
en
code
3
github-code
90
7895865285
import requests def test_permission_basic(token, host): res1 = requests.get( host + '/api/2.0/libraries/all-cluster-statuses', auth=('token', token), ) assert res1.status_code == 200 def test_permission_admin(token, host): res1 = requests.get( host + '/api/1.2/libraries/list'...
ShopRunner/stork
tests/test_token_permissions.py
test_token_permissions.py
py
615
python
en
code
47
github-code
90
15027641634
# -*- coding:utf-8 -*- import sys sys.path.append("../") from pytorch_transformers import BertModel import torch import torch.nn as nn from model.base_model import base_model from torchcrf import CRF sys.path.append("../") from layers.utensil import _generate_mask class bert_crf(base_model): def __in...
cfy201696/Craig-Ai
model/bert_crf.py
bert_crf.py
py
1,960
python
en
code
0
github-code
90
452185985
import contextlib import functools import os import re import shutil import sqlite3 import time class DatabaseException(Exception): pass # Checks that a value represents a valid project, version, or file name. def validate_name(name): if name in ('.', '..'): raise DatabaseException('Invalid name') ...
marcv81/tempstore
tempstore/database.py
database.py
py
11,121
python
en
code
0
github-code
90
21792986406
import folium import os import json m = folium.Map(locaiton=[42.3601, -71.0589], zoom_start=12) #Vega Visualisation vis = os.path.join('data','vis.json') #global tooltip tooltip = 'click for more info' #create markers folium.Marker([42.363600, -71.099500], popup='<strong>location1</strong>', tooltip=tooltip).ad...
AGeeson/GeoProjects
foliumtest/map.py
map.py
py
800
python
en
code
0
github-code
90
27222336998
import string import services import sims4.commands from sims4.collections import AttributeDict from sims4.localization import LocalizationHelperTuning from sims4.tuning.tunable import HasTunableSingletonFactory, AutoFactoryInit from ui.ui_dialog import UiDialog, UiDialogOkCancel from ui.ui_dialog_generic impo...
AlinaNikitina1703/Sims4ScriptCore
Scripts/scripts_core/sc_input.py
sc_input.py
py
20,564
python
en
code
2
github-code
90
19012755735
class Solution: def __method1 (self, nums): nums.sort() i, j, count = 0, 1, 0 while (j < len(nums)): diff = nums[j] - nums[i] if (diff == k): count += 1 while (((j + 1) < len(nums)) and (nums[j] == nums[j + 1])): j += 1 ...
Tejas07PSK/fraz-leetcode-hot-250
Array/k_diff_pairs_in_arr.py
k_diff_pairs_in_arr.py
py
857
python
en
code
1
github-code
90
25562601764
from concurrent import futures from contextlib import contextmanager import logging import socket import threading import grpc helloworld_pb2, helloworld_pb2_grpc = grpc.protos_and_services( "helloworld.proto" ) _LOGGER = logging.getLogger(__name__) _LOGGER.setLevel(logging.INFO) @contextmanager def get_free_l...
grpc/grpc
examples/python/wait_for_ready/wait_for_ready_example.py
wait_for_ready_example.py
py
3,186
python
en
code
39,468
github-code
90
25712179134
import bpy, platform from functions import * class TrackPanel(bpy.types.Panel): '''class of the panel who contains addon control''' bl_space_type = "CLIP_EDITOR" bl_region_type = "TOOLS" bl_label = "Single track" bl_category = "Curve Anim" def draw(self, context): '''the function that draw the addon UI''' ...
CaptainDesAstres/Frames-Animated-By-Curve
single_track/panels.py
panels.py
py
8,053
python
en
code
1
github-code
90
14064465771
from bisect import bisect_right from typing import List, Tuple import numpy as np from iris.cube import Cube from iris.exceptions import CoordinateNotFoundError from improver import BasePlugin from improver.metadata.utilities import ( create_new_diagnostic_cube, generate_mandatory_attributes, ) from improver....
metoppv/improver
improver/psychrometric_calculations/hail_size.py
hail_size.py
py
21,733
python
en
code
95
github-code
90
18061555599
import sys readline = sys.stdin.readline MOD = 10 ** 9 + 7 INF = float('INF') sys.setrecursionlimit(10 ** 5) def main(): l = list(map(int, readline().split())) l.sort() if any([x % 2 == 0 for x in l]): print(0) else: s = l[0] * l[1] print(s) if __name__ == '__main__': m...
Aasthaengg/IBMdataset
Python_codes/p04005/s818956502.py
s818956502.py
py
326
python
en
code
0
github-code
90
6684951024
from collections import Counter import re class ConllEntry: def __init__(self, id, form, lemma, pos, cpos, feats=None, parent_id=None, relation=None, deps=None, misc=None): self.id = id self.form = form self.norm = normalize(form) self.cpos = cpos.upper() self.pos = pos.upp...
elikip/bist-parser
bmstparser/src/utils.py
utils.py
py
2,463
python
en
code
275
github-code
90
18326082131
import time #import downdetector_graber #import internettrafficreport_graber import Isitdown_graber import istheservicedown import outage_report_grabber import combiner_v2 import os while 1==1: conf=open(os.path.expanduser("~/FCC/senior_project/config.txt"),"r") conf_data=conf.readlines() print...
dude13498/senior_project
runner.py
runner.py
py
794
python
en
code
0
github-code
90
22806764016
""" Write a funciton that returns true if one array is a rotation of another. example: [1, 2, 3, 4, 5, 6, 7] and [6, 7, 1, 2, 3, 4, 5] No duplicates in these arrays.** Solution: Find 2 indices where the arrays share a common element. Use these 2 indices loop through both arrays simultaneously and check for thei...
manuel1alvarez/Python-Problems
is_rotation.py
is_rotation.py
py
1,611
python
en
code
0
github-code
90
1175962762
from cvzone.ClassificationModule import Classifier import cv2 cap = cv2.VideoCapture("Res/Spike.mp4") myClassifier = Classifier() while True: img = cap.read() prediction = myClassifier.getPrediction(img) cv2.imshow("Image", img) cv2.waitKey(2)
1Ne0Phyte1/Everything_Python
OpenCV/OpenCV Projects/Object_detection.py
Object_detection.py
py
262
python
en
code
1
github-code
90
36493276805
#Cellule d'importation des modules nรฉcessaires ร  l'exรฉcution du Notebook import numpy as np import pandas as pd import sklearn as sk from sklearn import linear_model import urllib import sys #Rรฉcupรฉration du fichier de donnรฉes sur le git du projet response = urllib.request.urlopen("https://github.com/NaasCraft/projet...
NaasCraft/projetPython2014
wholeCode.py
wholeCode.py
py
4,789
python
en
code
0
github-code
90
18850624058
''' Analysis 1.input เธ„เธทเธญ เธเธฒเธฃเธ™เธณเธ‚เน‰เธญเธกเธนเธฅเน€เธ‚เน‰เธฒเธ—เธฒเธ‡เนเธ›เน‰เธ™เธžเธดเธกเธžเนŒ เน‚เธ”เธขเธ›เน‰เธญเธ™เธ•เธฑเธงเน€เธฅเธ‚เน€เธ‚เน‰เธฒเน€เธฃเธทเนˆเธญเธขเน† เธˆเธ™เธเธงเนˆเธฒเธˆเธฐเน€เธˆเธญ -1 เธ–เธถเธ‡เธซเธขเธธเธ”เธฃเธฑเธšเธ‚เน‰เธญเธกเธนเธฅ 2.process เธ„เธทเธญ เน€เธ›เน‡เธ™เธเธฒเธฃเธ™เธณเธ‚เน‰เธญเธกเธนเธฅเธ—เธฑเน‰เธ‡เธซเธกเธ” เธกเธฒเธซเธฒเธ„เนˆเธฒเน€เธ‰เธฅเธตเนˆเธขเน‚เธ”เธขเน„เธกเนˆเธฃเธงเธก -1 3.output เธ„เธทเธญ เธเธฒเธฃเนเธชเธ”เธ‡เธœเธฅเธ‚เธญเธ‡เธ„เนˆเธฒเน€เธ‰เธฅเธตเนˆเธข 4.Define a Variable เธ„เธทเธญเธเธฒเธฃเธเธณเธซเธ™เธ”เธ•เธฑเธงเนเธ›เธฃ เนƒเธ™เนเธ•เนˆเธฅเธฐเธ‚เน‰เธญเธกเธนเธฅเน€เธžเธทเนˆเธญเธฃเธฑเธšเธ„เนˆเธฒเนเธฅเธฐเนเธชเธ”เธ‡เธœเธฅเธ‚เธญเธ‡เธ„เนˆเธฒเธ™เธฑเน‰เธ™ ''' sum = 0.0 n = 0 ...
Jangtiplada/Jang
Homework9.py
Homework9.py
py
919
python
th
code
0
github-code
90
10419424155
import torch import torch.nn as nn from skimage import io, color import numpy as np from dataTools.dataNormalization import * unNorm = UnNormalize() class deltaEColorLoss(nn.Module): def __init__(self, normalize=None): super(deltaEColorLoss, self).__init__() self.loss = [] self.normalize = ...
sharif-apu/BJDD_CVPR21
loss/colorLoss.py
colorLoss.py
py
1,372
python
en
code
59
github-code
90
32631488601
#!/usr/bin/env python3 # Homework from Paul McWhorter YouTube video lesson 9 import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BOARD) button_up = 36 button_down = 40 led_pin = 38 # The below uses the built-in pullup/pulldown resistors on the Pi GPIO.setup(button_up, GPIO.IN, pull_up_down=GPIO.PUD_DOW...
dmr-git/py
rpi/gpio_pwm.py
gpio_pwm.py
py
1,022
python
en
code
0
github-code
90
13386392089
#!/bin/python # # Author : Ye Jinchang # Date : 2015-05-19 15:42:23 # Title : 29 divide two integers # Divide two integers without using multiplication, division and mod operator. # # If it is overflow, return MAX_INT. class Solution(object): MAX_INT = (1 << 31) - 1 def divide(self, divide...
Alwayswithme/LeetCode
Python/029-divide-two-integers.py
029-divide-two-integers.py
py
904
python
en
code
1
github-code
90
14293597280
# from PyQt5 import QtWidgets, QtGui, QtCore # from PyQt5.QtGui import QWheelEvent # from PyQt5.QtWidgets import QWidget # from PyQt5.QtCore import Qt, QEvent from PIL import Image from base_objs.b_obj import BWindowWorker, BAreaWorker, BFigureWorker, BArea, BLayer from b_mat.b_mat_worker import generate_mat_from_imag...
konstantinche36/b_platform
ui/ui_app_start.py
ui_app_start.py
py
6,299
python
en
code
0
github-code
90
29719068716
import re import sys from pyspark.sql.types import * from pyspark.sql import SparkSession from matplotlib import pyplot as plt def main(argv,session): input_data = argv[0] pop_data= argv[1] out_data = argv[2] input_rdd = session.sparkContext.textFile(input_data) pop_rdd = ...
dorisamo21/bigdata_labs
week12/provideratiosdf.py
provideratiosdf.py
py
4,423
python
en
code
0
github-code
90
34997868144
# tableไฝœๆˆshow้–ขๆ•ฐ def time_log(func): """ๅ‡ฆ็†ๆ™‚้–“ใ‚’่จˆๆธฌใ™ใ‚‹ใƒ‡ใ‚ณใƒฌใƒผใ‚ฟ้–ขๆ•ฐ""" def wrapper(*args,**kwargs): import datetime start = datetime.datetime.today() print("\n---start:" + func.__name__) res = func(*args,**kwargs) end = datetime.datetime.today() delta = end - start pr...
96no3/PythonStudy
Python/201910/191008/table_show01.py
table_show01.py
py
1,309
python
en
code
0
github-code
90
24934941227
import torch import torch.nn as nn import numpy as np from transformers import (RobertaConfig, RobertaModel, RobertaTokenizer, BartConfig, BartForConditionalGeneration, BartTokenizer, T5Config, T5ForConditionalGeneration, T5Tokenizer) import logging from mmd import M...
starve123456/copilot
copilot/models.py
models.py
py
13,544
python
en
code
0
github-code
90
15427394462
from abc import ABC from enum import Enum import warnings # needed until apply behaves better with Pint quantities in arrays from typing import Type from pint import Quantity from pint_pandas import PintArray import pandas as pd import pint import pint_pandas ureg = pint.get_application_registry() Q_ = ureg.Quantit...
sijilo/ITR
ITR/portfolio_aggregation.py
portfolio_aggregation.py
py
7,339
python
en
code
null
github-code
90
18389391279
import sys def solve(): input = sys.stdin.readline N = int(input()) W = [int(w) for w in input().split()] wt = [0] * (N + 1) for i, w in enumerate(W): wt[i+1] = wt[i] + w minD = 1000000 for i in range(N): minD = min(minD, abs(wt[i+1] - (wt[N] - wt[i+1]))) print(minD) ...
Aasthaengg/IBMdataset
Python_codes/p03012/s944300316.py
s944300316.py
py
370
python
en
code
0
github-code
90
22824784325
from django.contrib.auth.mixins import LoginRequiredMixin from django.db.models import Count from django.db.transaction import on_commit from django.http import HttpResponse, HttpResponseRedirect from django.urls import reverse_lazy from django.views.decorators.csrf import csrf_exempt from django.views.generic import C...
chrismcband/email-reply-demo
email_reply_demo/emails/views.py
views.py
py
4,448
python
en
code
0
github-code
90
4186524842
"""code for attention models""" import torch from box import Box from torch import nn from src.arch.slice_cnn_utils import Encoder1_2D, MaxPool, MeanPool, PooledAttention, ResNetEncoder class MRI2DSlice(nn.Module): def __init__( self, attn_num_heads, attn_dim, attn_drop=False, agg_fn="attention", in_...
umgupta/2d-slice-set-networks
src/arch/ukbb/brain_age_slice_set.py
brain_age_slice_set.py
py
6,276
python
en
code
5
github-code
90
18493066569
#!/usr/bin/env python # coding: utf-8 # In[16]: S = input() T = input() # In[20]: mydict = {} for i in range(len(S)): if S[i] in mydict: if T[i] != mydict[S[i]]: ans = "No" break else: mydict[S[i]] = T[i] else: a = list(mydict.values()) b = list(set(a)) ...
Aasthaengg/IBMdataset
Python_codes/p03252/s375616547.py
s375616547.py
py
417
python
en
code
0
github-code
90
44485831703
from riplib.Plugin import Plugin import codecs import logging import os import riplib.osxripper_time import sqlite3 __author__ = 'osxripper' __version__ = '0.1' __license__ = 'GPLv3' class UsersChromeFavicons(Plugin): """ Parse information from /Users/<username>/Library/Application Support/Google/Chrome/Defa...
maurice-schuppe/osxripper
plugins/osx/UsersChromeFavicons.py
UsersChromeFavicons.py
py
3,970
python
en
code
1
github-code
90
74117362856
import json import requests import asyncio import BetterDocModels async def GetProviders(location_coordinates, recordLimit, skipCount): mentalHealthSpecialties = ["mental-health-counselor", 'psychiatrist', "mental-health-nurse-practitioner",'clinical-psychologist', 'counseling-pshychologist', 'cognitive-behavioral...
charudut/DrCityYay
BetterDocApi.py
BetterDocApi.py
py
3,935
python
en
code
0
github-code
90
18107269459
def bubble_sort(c, n): for i in range(n): for j in range(n-1, i, -1): if c[j][1] < c[j-1][1]: c[j], c[j-1] = c[j-1], c[j] return c def selection_sort(c, n): for i in range(n-1): minj = i for j in range(i+1, n): if c[j][1] < c[minj][1]: ...
Aasthaengg/IBMdataset
Python_codes/p02261/s332392205.py
s332392205.py
py
812
python
en
code
0
github-code
90
16465742603
from moco_wrapper.models import objector_models as obj class PlanningEntry(object): def __init__(self, **kwargs): nk = kwargs if "project" in kwargs.keys() and kwargs["project"] is not None: p = obj.Project(**kwargs["project"]) nk["project"] = p if "user" in kwarg...
sommalia/moco-wrapper
moco_wrapper/models/objector_models/planning_entry.py
planning_entry.py
py
465
python
en
code
2
github-code
90
6185444852
# abs01.py # ์–ด๋– ํ•œ ์ˆซ์ž์— ๋Œ€ํ•ด ์ ˆ๋Œ€ ๊ฐ’์œผ๋กœ ๋งŒ๋“ค์–ด ์ฃผ๋Š” ํ•จ์ˆ˜ ๋งŒ๋“ค๊ธฐ # ๋งค๊ฐœ ๋ณ€์ˆ˜ ์ด๋ฆ„์€ ์ž„์˜์˜ ์ด๋ฆ„์ด์–ด๋„ ๋œ๋‹ค. def absolute(n): if n < 0: n = -n return n su = -5 result = absolute(su) print(result) mylist = [2, -4, -7] newlist = [] for i in mylist: newlist.append(absolute(i)) print(newlist) # for ๋ฌธ์„ ํ†ตํ•ด ์ƒˆ๋กœ์šด ๋ฆฌ์ŠคํŠธ ๋งŒ๋“ค๊ธฐ newlist2 = [absolute(i) for i i...
super1947/AICourse
DAY04/abs01.py
abs01.py
py
527
python
ko
code
0
github-code
90
40390680540
import socket from threading import Thread import random from time import sleep BUFFER = 1024 SERVER_WELCOME_PORT = 5000 SERVER_HEARTBEAT_PORT = 5001 CLIENT_MESSAGE_PORT = 5002 SERVER_MESSAGE_PORT = 5003 DELIMITER = "?CON?" B_DELIMITER = b"?CON?" # TODO CHANGE REPLICAS = 2 ERR_MSG = "NO" B_ERR_MSG = b"NO" CONFIRM_MS...
Leosimetti/DS-project-2-Distributed-file-system
Nameserver/NameServer.py
NameServer.py
py
25,524
python
en
code
0
github-code
90
18055231409
N, A, B = map(int, input().split()) S = input() all = 0 foreign = 0 for i in range(len(S)): if S[i] == 'a' and all < A + B: print('Yes') all += 1 continue if S[i] == 'b' and all < A + B and foreign < B: print('Yes') all += 1 foreign += 1 continue print('No')
Aasthaengg/IBMdataset
Python_codes/p03971/s991625010.py
s991625010.py
py
293
python
en
code
0
github-code
90
19597451449
import requests import random import re def title(): print('+------------------------------------------') print('+ \033[31mๅ…ฌไผ—ๅท๏ผšๆทฑๅคœ็ฌ”่ฎฐๆœฌ \033[0m') print('+ \033[34mVersion: weiphp \033[0m') pri...
wushigudan/poc
WeiPHP.py
WeiPHP.py
py
2,845
python
en
code
14
github-code
90
73562705898
from os import urandom from struct import pack, unpack_from from time import time import socket import hashlib import mtproto from ctr_socket import CTRSocket from tls_socket import TLSSocket def connect(dc_id, ip, port, secret, timeout): protocol = 0xefefefef obfs = len(secret) > 32 proxy_real_secret = ...
chinuts/tg-mtproxy-test
main.py
main.py
py
1,712
python
en
code
1
github-code
90
19568964272
import numpy def Optimal_BST(p,q,n): e=numpy.zeros((n+2,n+1)) #let e[1...n+1,0...n] w=numpy.zeros((n+2,n+1)) #let w[1...n+1,0...n] root=numpy.zeros((n+1,n+1)) #let root[1...n,1...n] #initialization for i in range(1,n+2): e[i][i-1]=q[i-1] w[i][i-1]=q[i-1] #recursive for...
leo735262/Python
ALG/Optimal_BST.py
Optimal_BST.py
py
1,143
python
en
code
0
github-code
90
27328462875
#!/usr/bin/env python import bernhard import os, time from datetime import datetime from sys import argv from socket import gethostname HOST = gethostname() SERVER = argv[1] STATEFILE = '/var/backups/local.backup.timestamp' c = bernhard.Client(SERVER) event = {} event['host'] = HOST event['service'] = 'last succes...
c2corg/infrastructure
puppetmaster/site-modules/c2cinfra/files/backup/last_backup.py
last_backup.py
py
1,110
python
en
code
2
github-code
90
8531654857
def fact(n): result=1 if(n<0): print("Can't find factorial of a negative number") elif(n==0): print("1",end=" "); else: for i in range(2,n+1): result*=i return result # a =fact(99999) # print(a)
yashu762001/Python-Tutorial
General/Factorial.py
Factorial.py
py
254
python
en
code
1
github-code
90
18011677619
from collections import defaultdict def input_as_int(): return list(map(int,input().split())) def get_comb(n): # n C n ใพใง fac = get_fact(n) com = [["error" for _ in range(n+1)] for _ in range (n + 1)] for i in range(n + 1): for j in range(i + 1): if i >= j: com[i...
Aasthaengg/IBMdataset
Python_codes/p03776/s020738595.py
s020738595.py
py
1,016
python
en
code
0
github-code
90
73632996138
from LinkedList import LinkedList def del_mid_node(n): n.next = n.next.next n.value = n.next.next.value ll = LinkedList() ll.add_multiple([1, 2, 3, 4]) middle_node = ll.add(5) ll.add_multiple([7, 8, 9]) print(ll) del_mid_node(middle_node) print(ll)
tech-cow/big4
algorithm_AKA_่ฐทๆญŒๆˆ‘ๆฅไบ†/cc150/chapter2_linked_list/2_3_delete_mid_node.py
2_3_delete_mid_node.py
py
261
python
en
code
7
github-code
90
18001428719
def main(): import sys input = sys.stdin.readline n, t = list(map(int, input().rstrip('\n').split())) T = list(map(int, input().rstrip('\n').split())) cnt = 0 for i in range(1, n): cnt += min(T[i] - T[i-1], t) print(cnt + t) if __name__ == '__main__': main()
Aasthaengg/IBMdataset
Python_codes/p03733/s329315507.py
s329315507.py
py
301
python
en
code
0
github-code
90
16989450562
import matplotlib.pyplot as plt import numpy as np from PIL import Image from skimage import color def load_demo_image(): im = color.rgb2lab(Image.open('../object_recognition/img/Patern_test.jpg')) / 100.0 return im[..., 0] def zca_whitening(inputs): sigma = np.dot(inputs, inputs.T) / inputs.shape[1] #...
nanopony/keras-convautoencoder
helpers.py
helpers.py
py
5,359
python
en
code
174
github-code
90
74946847015
# -*- coding: utf-8 -*- """ Problem 142 - Perfect Square Collection Find the smallest x + y + z with integers x > y > z > 0 such that x + y, x โˆ’ y, x + z, x โˆ’ z, y + z, y โˆ’ z are all perfect squares. """ from math import sqrt def solution(): limit = 1000 squares = {n*n: n for n in xrange(1, int(sqrt(2)*limit...
yred/euler
python/problem_142.py
problem_142.py
py
1,452
python
en
code
1
github-code
90
69887413418
class node(object): def __init__(self,value = None,left = None,right = None,father = None): self.value = value self.left = left self.right = right self.father = father def build_father(left,right): n = node(value = left.value + right.value,left = left,right = right) ...
iamtonymwt/Image-Processing
JPEGpy/Huffman.py
Huffman.py
py
6,463
python
en
code
0
github-code
90
71635459816
import os import numpy as np import wandb import logging logging.getLogger().setLevel(logging.INFO) class CheckpointSaver: def __init__(self, dirpath, decreasing=True, top_n=5): """ dirpath: Directory path where to store all model weights decreasing: If decreasing is `True`, then lower met...
makcfd/exploiting-ml-multimodality
my_utilities/logger.py
logger.py
py
2,214
python
en
code
1
github-code
90
5231802271
print("************ๆฌข่ฟŽๆฅๅˆฐๅฎ ็‰ฉๅบ—**************") dictionary={} dictionary["name"] = input("่ฏท้—ฎไฝ ็š„ๅฎ ็‰ฉๅ–ไธ€ไธชๅๅญ—") value = 0 dictionary["value"] = 0 class animal(): def __init__(self): typeanimal = int(input("่ฏท้€‰ๆ‹ฉๅฎ ็‰ฉ็ฑปๅž‹๏ผš1ใ€็‹—็‹—๏ผ›2ใ€ไผ้น…")) if typeanimal == 1: typedog = int(input("่ฏท้€‰ๆ‹ฉ็‹—็š„ๅ“็ง๏ผš1ใ€่ชๆ˜Ž็š„ๆ‹‰ๅธƒๆ‹‰ๅคš็Šฌ๏ผ›2ใ€้…ท้…ท็š„้›ช็บณ็‘ž")) ...
zou9229/InternshipStudy
demo1.py
demo1.py
py
3,660
python
en
code
0
github-code
90
18110796049
from collections import deque def doubly(n): list = deque() for i in range(n): line = input().split() p = line[0] while True: try: key = line[1] break except IndexError: break if p == "insert": l...
Aasthaengg/IBMdataset
Python_codes/p02265/s632640942.py
s632640942.py
py
728
python
en
code
0
github-code
90
18124708729
s = int(input()) sec = min = hour = 0 sec = s%60 if s >= 60: min = int(s/60) if min >= 60: hour = int(min/60) min = min%60 print(str(hour) + ':' + str(min) + ':' + str(sec))
Aasthaengg/IBMdataset
Python_codes/p02390/s966185220.py
s966185220.py
py
199
python
en
code
0
github-code
90
16471101084
from scipy.ndimage import gaussian_filter1d import numpy as np import json import os import torch def trans_motion3d(motion3d, local3d=None, unit=128): # orthonormal projection motion3d = motion3d * unit # neck and mid-hip motion3d[1, :, :] = (motion3d[2, :, :] + motion3d[5, :, :]) / 2 motion3d[...
ChrisWu1997/2D-Motion-Retargeting
functional/motion.py
motion.py
py
5,730
python
en
code
406
github-code
90
17931367669
s = str(input()) n = 4 for bit in range(1 << (n-1)): f = s[0] for i in range(0,(n-1)): if bit & (1 << i): f += '+-' + s[i+1] else: f += '+' + s[i+1] #print(f) ans = sum(map(int,f.split('+'))) if ans == 7: break print(f.replace('+-','-')+'=7')
Aasthaengg/IBMdataset
Python_codes/p03545/s485526884.py
s485526884.py
py
311
python
en
code
0
github-code
90
73951271976
from dataclasses import dataclass import numpy as np import copy from scipy import interpolate from scipy.interpolate import BSpline from scipy.integrate import quad from shapely.geometry import Point, LinearRing, GeometryCollection, LineString, MultiPoint, Polygon import pickle @dataclass class Region: name: str...
HaoruXue/spline-trajectory-optimization
spline_traj_optm/models/trajectory.py
trajectory.py
py
13,395
python
en
code
1
github-code
90
1301144606
from CNNLorenzMie.crop_feature import crop_feature import cv2, json from matplotlib import pyplot as plt import numpy as np from lmfit import report_fit from time import time import os with open('your_MLpreds.json', 'r') as f: MLpreds = json.load(f) savedict = [] path = os.getcwd()+'/norm_images' numimgs = len([...
laltman2/CNNLorenzMie
experiments/refine.py
refine.py
py
1,717
python
en
code
6
github-code
90
17437488970
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow import keras class Aggregation(keras.layers.Layer): # pyformat: disable """Layer which represents an aggregation function. Calls the model on each of the ragged ...
tensorflow/lattice
tensorflow_lattice/python/aggregation_layer.py
aggregation_layer.py
py
1,912
python
en
code
515
github-code
90
39338352547
import tkinter as tk from tkinter import * # declares a global variable expression = "" # functions for numbers, equal, and clearing out # function for numbers def btn_click(item): global expression # con of string expression = expression + str(item) # updates the expression input_text.set(expr...
notdien/GUI-calculator
main.py
main.py
py
4,936
python
en
code
0
github-code
90
44212597724
import re import requests import random import time import pickle from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from bs4 import BeautifulSoup from gtts import gTTS import...
linux1218/spesial_interview
project_web_scraping/spesial_interview_new.py
spesial_interview_new.py
py
11,855
python
en
code
0
github-code
90
24745471077
import pickle import matplotlib.pyplot as plt import sys, os import numpy as np import FormPars if len(sys.argv) < 2: print('========== Syntax ===========') print('python PlotBurnIn.py') print('<mcmc pickle file>') print('<path to figure directory (optional)>') exit() sPathToPickleMCMC = os.path...
zachgreene/ElectronLifetime
PythonCodeELMCMC/PlotBurnIn.py
PlotBurnIn.py
py
2,187
python
en
code
0
github-code
90
11945095465
# ๋ฌธ์ž์—ด ์žฌ์ •๋ ฌ string = "K1KA5CB7" stringList = list(string) stringList.sort() result = [] number = 0 for i in stringList: if i.isdigit(): number += int(i) else: result.append(i) result.append(str(number)) print("".join(result))
EcoFriendlyAppleSu/algo
algorithm/implementation/practice/StringRearrange.py
StringRearrange.py
py
263
python
en
code
0
github-code
90
13289159264
class Solution(object): def topKFrequent(self, nums, k): """ :type nums: List[int] :type k: int :rtype: List[int] """ result = [] newNums = [str(x) for x in nums] listOfNum = set(newNums) numDict = dict.fromkeys(listOfNum, 0) for num ...
feux-follets/neetcode
1_arrays_and_hashing/top_k_frequent_elements.py
top_k_frequent_elements.py
py
588
python
en
code
1
github-code
90
30933348167
import json import os import sys from pathlib import Path ## ADJUSTABLE VARIABLES ## # FORCE_DEBUG should be a boolean (True or False, no quotes) # Note: Environment variables can only store strings. Convert this to string if it has to be an environment variable. FORCE_DEBUG = True # HEADER_FILL should be a strin...
AznIronMan/invoice-pdf-to-excel-batch-converter
__main__.py
__main__.py
py
1,929
python
en
code
0
github-code
90
18924620575
# """Receive messages over from RabbitMQ and send them over the websocket.""" # import pika # connection = pika.BlockingConnection( # pika.ConnectionParameters(host='localhost') # ) # channel = connection.channel() # channel.exchange_declare( # exchange='fe662fd9de834fc', exchange_type='fanout' # ) # # exc...
Prodip007/realtime_chat_app
websocket.py
websocket.py
py
3,827
python
en
code
0
github-code
90
25091128159
# coding=utf-8 from __future__ import absolute_import import octoprint.plugin import octoprint.printer from octoprint.util import RepeatedTimer from octoprint.events import Events import pigpio # Main class used to interface with pigpio class OctoPiBoxControl: def __init__(self, parent, printer_pin, spare_pin, prin...
hcomet/OctoPrint-OctoPiBox
octoprint_octopibox/__init__.py
__init__.py
py
14,443
python
en
code
0
github-code
90
73397775976
# -*- coding: utf-8 -*- __author__ = 'gzp' import json from copy import copy class ListNode(object): def __init__(self, x): self.val = x self.next = None class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None def get_nodes(self):...
elfgzp/Leetcode
utils.py
utils.py
py
1,967
python
en
code
1
github-code
90
18836851102
# -*- coding: utf-8 -*- """ Created on Sun Aug 12 15:32:57 2018 @author: nikhil """ file = open('../bacterial_result.txt', 'r+') content = file.read() file.seek(0) lines = content.split('\n') line_cnt = len(lines) avg_per = float(lines[line_cnt - 1].split('=')[1]) file.write(lines[0] + '\tDifference') diff_sum ...
nik1806/Plant-leaf-infection-detection
standard_deviation.py
standard_deviation.py
py
861
python
en
code
7
github-code
90
71954599978
from time import time import biorbd_casadi as biorbd from bioptim import Solver, OdeSolver from .gait.load_experimental_data import LoadData from .gait.ocp import prepare_ocp, get_phase_time_shooting_numbers, get_experimental_data def generate_table(out): root_path = "/".join(__file__.split("/")[:-1]) # De...
s2mLab/BioptimPaperExamples
gait/generate_table.py
generate_table.py
py
3,001
python
en
code
3
github-code
90
31608430415
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import sys import copy import pyqtgraph as pg import re from PyQt5 import QtWidgets, uic, QtGui, QtCore from path_to_path.read_file_dialog import read_file_dialog as dialog from path_to_path.path_calculation import path_calculation as path_calc pg.setConfigOption("...
peace2017/path_to_path
path_to_path/graph_view/graph_view.py
graph_view.py
py
7,500
python
en
code
0
github-code
90
12654873333
import numpy as np from PIL import Image from functools import partial import cProfile, pstats, io from time import time from tqdm import tqdm, trange import os def get_max_beta_for_zero_sxy_and_sxx(mx, my, n): max_beta = 1.0 for j in range(n): for a, b in [(mx[j], my[j]), (1-mx[j], 1-my[j])]: ...
71c/paint_regression
paint_regression_2.py
paint_regression_2.py
py
13,174
python
en
code
0
github-code
90
4829184591
#Exercรญcio Python 105: Faรงa um programa que tenha uma funรงรฃo notas() que pode receber vรกrias notas de alunos e vai retornar um dicionรกrio com as seguintes informaรงรตes: #โ€“ Quantidade de notas #โ€“ A maior nota #โ€“ A menor #โ€“ A mรฉdia da turma #โ€“ A situaรงรฃo (opcional) def notas(*valor, show=False): """ -> Funรงรฃo p...
rodrigojgrande/python-mundo
desafios/desafio-105.py
desafio-105.py
py
1,166
python
pt
code
0
github-code
90
27807880123
import math from typing import Union from models.base import Processable class Circle(Processable): def __init__( self, radius: Union[int, float], diameter: Union[int, float], square: Union[int, float], perimeter: Union[int, float], ): self._radius = radius ...
AlexFoxalt/GeoPymetry
models/circles.py
circles.py
py
1,718
python
en
code
0
github-code
90
74404983977
import matplotlib.pyplot as plt import matplotlib.colors as colors import numpy as np import argparse import ROOT, array, ctypes, datetime from matplotlib import style style.use('plt.mplstyle') def get_unixtime_rms_arrays(bad_run_list, file_list): unixtimes = [] rms = {} for c in range(16): rm...
clark2668/ara5_analysis
studies/2022.11_proposal/plot_rms/plot_rms.py
plot_rms.py
py
5,522
python
en
code
0
github-code
90
2377499756
# From https://colab.research.google.com/drive/1LouqFBIC7pnubCOl5fhnFd33-oVJao2J?usp=sharing#scrollTo=yn1KM6WQ_7Em import torch import numpy as np from flows import RectifiedFlow import torch.nn as nn import tensorboardX import os from models import UNetEncoder from guided_diffusion.unet import UNetModel import torchv...
sangyun884/fast-ode
generate.py
generate.py
py
9,396
python
en
code
56
github-code
90
7482447342
import random import numpy as np from TestingHelpfuncs import Helpfuncs as hf import math # Global variables SIZES = [28*28, 32, 10] # Number of nodes in: [input layer, hidden layer, ... , output layer] EPOCHS = 10 BATCH_SIZE = 16 USED_SHARE_OF_DATA = 0.1 #LEARNING_RATE = 5 END_LEARNING_RATE = 0.1 WEIGHT_B...
axeboii/Neural-Network
Visualisation/TestingNetwork.py
TestingNetwork.py
py
8,902
python
en
code
0
github-code
90
22206990858
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def binaryTreePaths(self, root): """ :type root: TreeNode :rtype: List[str] """ r...
Eurus-Holmes/LCED
Binary Tree Paths.py
Binary Tree Paths.py
py
797
python
en
code
11
github-code
90
29826894599
import numpy as np import matplotlib.pyplot as plt import pandas as pd #importing the dataset dataset = pd.read_csv('NFLX.csv') X = dataset.iloc[:,2:3].values y = dataset.iloc[:,3].values #Fitting the decision tree Regression to the dataset from sklearn.tree import DecisionTreeRegressor regressor = DecisionTreeRegre...
sumit-mandal/Stock_price_Using_LINEARREGRESSIONMODELS
Decision_tree_without_testset.py
Decision_tree_without_testset.py
py
975
python
en
code
0
github-code
90
29423098624
import cv2 import numpy as np import matplotlib.pyplot as plt # kryternia przetwania obliczen (blad+liczba iteracji) criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) #przygotowanie punktow 2D w postaci: (0, 0, 0), (1, 0, 0), (2, 0, 0)...., (6, 7, 0) objp = np.zeros((6 * 7, 3), np.float32) o...
Maveric4/ZAW
lab5_Stereo_vision/cam_cal.py
cam_cal.py
py
2,222
python
pl
code
0
github-code
90
69998658536
from brax import jumpy as jp from brax import math from brax import pytree from brax.physics import config_pb2 from brax.physics.base import P, QP, vec_to_arr @pytree.register class Euler: """Symplectic euler integration.""" def __init__(self, config: config_pb2.Config): """Creates a Euler integrator. A...
belinghy/BraxPlayground
brax/physics/integrators.py
integrators.py
py
2,607
python
en
code
1
github-code
90
5742194794
from dataclasses import asdict, dataclass, field from datetime import datetime, timezone from urllib.parse import urljoin from config import Config @dataclass class MarkdownPage(): template: str content: str summary: str title: str | None date: datetime keywords: str | None slug: str | No...
amirkarimi/amirkarimi.github.io
models.py
models.py
py
1,446
python
en
code
4
github-code
90
13778661258
import os from config import ADMINS from flask import Flask, request, render_template, redirect, url_for,Blueprint,g,current_app,send_from_directory from werkzeug.utils import secure_filename from pyexcel_xls import XLBook from .forms import UploadForm,SendEmailsForm from ..models import Topic, User, Format, Content,R...
yefeiyang0806/Event-Manager
EventManager/app/upload/views.py
views.py
py
10,174
python
en
code
0
github-code
90
24999584615
def transpose(matrix: [[int]]) -> [[int]]: m, n = len(matrix), len(matrix[0]) res = [[0 for _ in range(m)] for _ in range(n)] for i in range(m): for j in range(n): res[j][i] = matrix[i][j] return res if __name__ == '__main__': print(transpose([[1,2,3],[4,5,6],[7,8,9],[0,0,0]]))...
Lycorisophy/LeetCode_python
็ฎ€ๅ•้ข˜/867.่ฝฌ็ฝฎ็Ÿฉ้˜ต.py
867.่ฝฌ็ฝฎ็Ÿฉ้˜ต.py
py
321
python
en
code
1
github-code
90
36665221537
INPUT = [int(i) for i in input().split()] N, W = INPUT[0], INPUT[1] TC = 0 CHEESE = [] for i in range(N): INPUT = [int(x) for x in input().split()] CHEESE.append([INPUT[0], INPUT[1]]) CHEESE = sorted(CHEESE, reverse=True) for c in CHEESE: TC += c[0] * min(W, c[1]) W -= min(W, c[1]) if W <= 0: ...
ringedSquid/Stuy_CCC_Potd
atcoder/abc229_c.py
abc229_c.py
py
341
python
en
code
0
github-code
90
41317810716
""" Mad Libs Generator """ # story 1 def p_story1(): print("************************") print ("Zoo") print("************************") print (f"Today I went to the zoo. I saw a(n) {adjective1} {noun1} jumping up and down on its tree. " \ f"He {verb_p1} {adverb1} through the large tunnel t...
ViGi7520/Python_basic_codes
madlips.py
madlips.py
py
3,409
python
en
code
0
github-code
90
18061324259
import math import sys input = sys.stdin.readline a, b, c = map(int, input().split()) x = (a//2)*b*c x = abs(abs(x-a*b*c)-x) y = (b//2)*a*c y = abs(abs(y-a*b*c)-y) z = (c//2)*a*b z = abs(abs(z-a*b*c)-z) print(min(x, y, z))
Aasthaengg/IBMdataset
Python_codes/p04005/s565092068.py
s565092068.py
py
224
python
en
code
0
github-code
90
27091794058
from spack import * class Lordec(MakefilePackage): """LoRDEC is a program to correct sequencing errors in long reads from 3rd generation sequencing with high error rate, and is especially intended for PacBio reads.""" homepage = "http://www.atgc-montpellier.fr/lordec/" url = "https://gite.li...
matzke1/spack
var/spack/repos/builtin/packages/lordec/package.py
package.py
py
654
python
en
code
2
github-code
90
28265589091
######################################################################### # ---------> FILE: gen.py # ---------> AUTHOR: Max Xu # ---------> MAIL: xuhuan@live.cn # ---------> DATE: 05/03/2017 TIME:11:25:55 ######################################################################### # !/usr/bin/env python #...
maxsxu/MTSAnomalyDetection
util/gen_data.py
gen_data.py
py
4,358
python
en
code
25
github-code
90
27308750631
from gold.statistic.MagicStatFactory import MagicStatFactory from gold.statistic.Statistic import Statistic from gold.statistic.GraphStat import GraphStat from quick.statistic.PositionToGraphNodeIdStat import PositionToGraphNodeIdStat from gold.statistic.FormatSpecStat import FormatSpecStat from gold.track.TrackFormat ...
uio-bmi/track_rand
lib/hb/quick/statistic/ColocalizationIn3dAssumingCompleteGraphStat.py
ColocalizationIn3dAssumingCompleteGraphStat.py
py
1,942
python
en
code
1
github-code
90
22211679449
from scipy.stats import beta from scipy.stats import bernoulli as bern import numpy as np import matplotlib.pyplot as plt def main(): # ๅญฆ็ฟ’ใƒ‡ใƒผใ‚ฟ็”Ÿๆˆ batch_number = 4 train_size = 400 batch_size = int(train_size / batch_number) mu = 0.7 # ๅฎŸ้š›ใฎฮผใฎๅ€ค X = bern.rvs(mu,size = train_size) X = X.reshape([...
elkel53930/machine_learning_by_bayes
ch03/bern.py
bern.py
py
977
python
en
code
0
github-code
90
31114067596
#!/usr/bin/python3 import sys for line in sys.stdin: line = line.strip() column = line.split(",") city = column[1] country = column[2] year_2021 = column[3] city1 = "".join(c for c in city if c.isalpha()) country1 = "".join(c for c in country if c.isalpha()) #year_2021_1 = "".join(c for c in year_2021 if c.is...
gabrielecosta/big-data-dataset
inquinamento/mapper.py
mapper.py
py
389
python
en
code
0
github-code
90
804565301
expected_outcomes = {"X": "LOSE", "Y": "DRAW", "Z": "WIN"} winning_outcomes = {"A": "Y", "B": "Z", "C": "X"} draw_outcomes = {"A": "X", "B": "Y", "C": "Z"} losing_outcomes = {"A": "Z", "B": "X", "C": "Y"} move_scores = {"X": 1, "Y": 2, "Z": 3} outcome_scores = {"WIN": 6, "DRAW": 3, "LOSE": 0} total_score = 0 with op...
kneedels/adventOfCode2022
day2/part2.py
part2.py
py
829
python
en
code
0
github-code
90
24261443392
from tensorflow.examples.tutorials.mnist import input_data from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Activation, Convolution2D, MaxPooling2D, Dropout, Flatten from keras.utils import np_utils # mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) ...
tsuchikazu/playground
machine-leaning/keras/Deep_MNIST_for_Experts.py
Deep_MNIST_for_Experts.py
py
1,989
python
en
code
0
github-code
90
4951934666
# [๊ธฐ์ดˆ-2์ฐจ์›๋ฐฐ์—ด] ๋ฐ”๋‘‘์•Œ ์‹ญ์ž ๋’ค์ง‘๊ธฐ # ๋ถ€๋ชจ๋‹˜์„ ๊ธฐ๋‹ค๋ฆฌ๋˜ ์˜์ผ์ด๋Š” ๊ฒ€์ •/ํฐ ์ƒ‰ ๋ฐ”๋‘‘์•Œ์„ ๋ฐ”๋‘‘ํŒ์— ๊ฝ‰ ์ฑ„์›Œ ๊น”์•„ ๋†“๊ณ  ๋†€๋‹ค๊ฐ€... # "์‹ญ(+)์ž ๋’ค์ง‘๊ธฐ๋ฅผ ํ•ด๋ณผ๊นŒ?"ํ•˜๊ณ  ์ƒ๊ฐํ–ˆ๋‹ค. # ๋ฐ”๋‘‘ํŒ(19 * 19)์— ํฐ ๋Œ(1) ๋˜๋Š” ๊ฒ€์ • ๋Œ(0)์ด ๋ชจ๋‘ ๊ฝ‰ ์ฑ„์›Œ์ ธ ๋†“์—ฌ์žˆ์„ ๋•Œ, # n๊ฐœ์˜ ์ขŒํ‘œ๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ ์‹ญ(+)์ž ๋’ค์ง‘๊ธฐํ•œ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•ด๋ณด์ž. # ์ฐธ๊ณ  # ๊ฐ€๋กœ ๋ฒˆํ˜ธ, ์„ธ๋กœ ๋ฒˆํ˜ธ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” 2์ฐจ์› ๋ฐฐ์—ด์„ ์‚ฌ์šฉํ•˜๋ฉด # ์ด๋Ÿฌํ•œ ํ˜•ํƒœ๋ฅผ ์‰ฝ๊ฒŒ ๊ธฐ๋กํ•˜๊ณ  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ฌผ๋ก  ๋” ํ™•์žฅํ•œ n์ฐจ์› ๋ฐฐ์—ด๋„ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค. # ๋ฐฐ์—ด ์ž…๋ ฅ ๋ฐฉ๋ฒ• m = ...
jsj0718/til-study-legacy
Algorithm/CodeUp100/1097.py
1097.py
py
2,032
python
ko
code
0
github-code
90
18158626939
from functools import reduce from fractions import gcd import math import bisect import itertools import sys sys.setrecursionlimit(10000000) input = sys.stdin.readline INF = float("inf") MOD = 1000000007 class Combination(object): def __init__(self, N): self.fac = [0] * (N + 1) self.inv = [0] * (N ...
Aasthaengg/IBMdataset
Python_codes/p02555/s972837020.py
s972837020.py
py
1,124
python
en
code
0
github-code
90
71186118696
#Task 1 best_emp_name = 0 best_emp = 0 p = 0 hpay = 0 pay1 = 0 pay2 = 0 pay3 = 0 pay4 = 0 pay5 = 0 for i in range (1,31): emp_name = input("Enter Your Name: ") emp_num = int(input("Enter Number: ")) hrs = int(input("Enter Number of hours worked: ")) #Task 2 if hrs < 5: p=0 pay1 = pay1 ...
aneesh27/Projects
Pre Release for summative.py
Pre Release for summative.py
py
1,304
python
en
code
0
github-code
90
44020025852
import unittest """ Returns true if given number is prime. Introductory (school) method: Test if n is prime => check for all values from 2 through sqrt(n) to see if the value divides n. If no value divides n, then return True. With the exclusion of 2 and 3, all primes are of the form 6k+1 or 6k-1. So, a better way to t...
prathamtandon/g4gproblems
Math/is_prime.py
is_prime.py
py
878
python
en
code
3
github-code
90
24178564407
import numpy as np import logging from evaluation.unsupervised_metrics.correlation import gaussian_total_correlation, gaussian_wasserstein_correlation from evaluation.unsupervised_metrics.mutual_info import discrete_mutual_info, discrete_entropy from evaluation.shared import generate_batch_factor_code def unsupervised...
kkahloots/Generative_Models
evaluation/unsupervised_metrics/disentangle_api.py
disentangle_api.py
py
2,180
python
en
code
1
github-code
90
21650432472
#!/usr/bin/env python import subprocess import optparse import re def get_arguments(): # Object to Handle or Parse User Inputs Using Arguments parser = optparse.OptionParser() # Adding Options to Parser Object parser.add_option("-i", "--interface", dest="interface", help="Network Interface to Change ...
pentestcave/Automation-Tooling
mac-changer/mac-changer.py
mac-changer.py
py
2,552
python
en
code
0
github-code
90
71794428777
import itertools # 1. ็ป„ๅˆ็”Ÿๆˆๅ™จ # ็ป„ๅˆๅฏ่ฟญไปฃๅฏน่ฑก for item in itertools.product([1, 2, 3, 4], [5, 6, 7, 8]): print(item) # ๅฏนๅฏ่ฟญไปฃๅฏน่ฑก็š„ๅ…ƒ็ด ็”ŸๆˆไธๅŒ็š„ๆŽ’ๅˆ—็ป„ๅˆ ็ป„ๅˆ็š„ไธชๅ…ƒ็ด ้กบๅบไธๅŒ print(list(itertools.permutations([1, 2, 3, 4]))) # ๅฏนๅฏ่ฟญไปฃๅฏน่ฑก็š„ๅ…ƒ็ด ็”ŸๆˆไธๅŒ็š„ๆŽ’ๅˆ—็ป„ๅˆ ็ป„ๅˆ็š„ไธชๅ…ƒ็ด ้กบๅบไธๅŒ(ๆŒ‡ๅฎš้•ฟๅบฆ) print(list(itertools.permutations([1, 2, 3, 4], 2))) # ๅฏนๅฏ่ฟญไปฃๅฏน่ฑก็š„ๅ…ƒ็ด ็”ŸๆˆไธๅŒ็š„ๆŽ’ๅˆ—็ป„ๅˆ ไธ่€ƒ่™‘ๅ…ƒ็ด ้กบๅบ(...
LIMr1209/test
itertools_test.py
itertools_test.py
py
1,491
python
en
code
0
github-code
90