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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
71962467875 | import menus
import pitch_trainer
import interval_trainer
import chord_trainer
import scale_trainer
import chimes
'''
Main CLI menu for the Tone Trainer game
'''
chimes.welcome()
menus.title()
menus.print_play_menu()
while True:
sel = input()
sel = sel.strip()
if sel == '1':
r = pitch_trainer.run()
if ... | charboltron/ear_trainer | src/main.py | main.py | py | 703 | python | en | code | 0 | github-code | 1 |
11822802935 | import pygame
from typing import List, Callable, Tuple
GREEN = (0, 255, 0)
RED = (255, 0, 0)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
GREY = (57, 57, 57)
LIGHT_GREY = (99, 99, 99)
LIGHT_BLUE = (141, 182, 205)
# BACKGROUND_COLOR = (158, 58, 64)
BACKGROUND_COLOR = (113, 155, 158)
SIDEBAR_IMAGE_SCALE = 1.5 # make card... | YoussefSamaan/Splendor-Game | client/game/utils.py | utils.py | py | 5,485 | python | en | code | 0 | github-code | 1 |
25161342964 | #!/usr/bin/python
import sys
import numpy as np
import scipy.signal as signal
from scipy.io import wavfile
import sklearn as sk
import librosa
import heartpy as hp
import soundfile as sf
from scipy.fft import fft, ifft, fftfreq
import matplotlib.pyplot as plt
src_signal = librosa.load("LAB5_500HzFHR.wav", sr=None)
... | cKaliban/DSP-Architecture-Lab | Python-WSL/signal_processing.py | signal_processing.py | py | 1,670 | python | en | code | 0 | github-code | 1 |
27467950633 | import tensorflow as tf
import numpy as np
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.training import moving_averages
from tensorflow.python.training.moving_averages import assign_moving_average
import cfg
class resnet_mcnn(object):
def __init__(self):
self.batch_size = ... | akira-l/counting-project | counting method/resmcnn.py | resmcnn.py | py | 9,574 | python | en | code | 1 | github-code | 1 |
40218112068 | from datetime import datetime
from flask import render_template, url_for, redirect, flash, request, Blueprint
from flask_login import current_user, login_required
from website import db, settings
from website.hours.forms import LogHoursForm
from website.models import User, Event, Hours
from website.events.utils impor... | kastuparu/FRC190Website | website/hours/routes.py | routes.py | py | 3,670 | python | en | code | 0 | github-code | 1 |
24366566245 | import datetime
import boto3
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from django.template import loader
from django.views.decorators.clickjacking import xframe_options_exempt
from phishing.forms import CreateTemplate
from phishing.models import Submission, MTurkUser, Ra... | maths22/trawl | phishing/views.py | views.py | py | 5,419 | python | en | code | 0 | github-code | 1 |
40110576625 | #mรm์ ์ ๋ฐฉํ ํ๋ ฌ M์ n-๊ฑฐ๋ญ์ ๊ณฑ์ธ Mโฟ์ ๊ณ์ฐํด ๋ณด๊ธฐ
#์ถ์ ์ ๋ณต ์ ๋ต์ผ๋ก ํ๋ ฌ์ ๊ฑฐ๋ญ์ ๊ณฑ์ ๊ตฌํํ ์ ์์
#๋ ํ๋ ฌ์ ๊ณฑํ๋ multMat(M1, M2)ํจ์๊ฐ ์ด๋ฏธ ์๋ค๊ณ ๊ฐ์ ํ๊ณ ํ๋ ฌ ๊ฑฐ๋ญ์ ๊ณฑ ์ฝ๋๋ฅผ ๊ตฌํํด ๋ณด๊ธฐ
def powerMat(x, n) :
if n == 1 :
return x
elif (n%2) == 0:
return powerMat(multMat(x, x), n//2)
else :
return multMat(x, powerMat(multMat(x,x), (n-1) // 2))... | WooJungE/AI_Algorithm | 0424.py | 0424.py | py | 947 | python | ko | code | 0 | github-code | 1 |
5130403051 | #==============================================================================
# TODO: ADD DOCUMENATION ORGANIZE
#==============================================================================
import datetime
import os
import time
import timeit
import fnmatch
import pandas as pd
import requests
import zipfile
import... | AbbasElHachem/extremes | _f_combine_all_dwd_data_one_df.py | _f_combine_all_dwd_data_one_df.py | py | 7,520 | python | en | code | 0 | github-code | 1 |
37506124101 | #!/usr/bin/env python3
import sys
import traceback
def Q3(sb):
def is_in(char): # True if in [a-zA-Zโ']
return char in "โ'" or \
'a' <= char <= 'z' or \
'A' <= char <= 'Z' # python syntax, chained comparison
s = ' '.join(sb)
j = 0
ans = set()
for i, c in enumerate(... | anniehastur450/challenge2022 | EXE1_Python/Q3_no_regex.py | Q3_no_regex.py | py | 1,238 | python | en | code | 1 | github-code | 1 |
8404410120 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
ะะพะดัะปั ัะพัะผั <icCubesOLAPSrvRequestPanelProto>.
ะกะณะตะฝะตัะธัะพะฒะฐะฝ ะฟัะพะตะบัะพะผ DEFIS ะฟะพ ะผะพะดัะปั ัะพัะผั-ะฟัะพัะพัะธะฟะฐ wxFormBuider.
"""
import wx
from . import cubes_olap_srv_request_form_proto
import ic
from ic.log import log
from ic.utils import wxfunc
# ะะปั ัะฟัะฐะฒะปะตะฝะธั ะฒะทะฐะธะผะพะดะต... | XHermitOne/defis3 | analitic/analitic/olap/cubes/cubes_olap_srv_request_panel.py | cubes_olap_srv_request_panel.py | py | 17,669 | python | ru | code | 0 | github-code | 1 |
10575463562 | ##### 0 #####
def count_elements(xss):
counter = 0
for x in xss:
if isinstance(x,list):
counter += count_elements(x)
else:
counter += 1
return counter
# TEST CASES
# print(count_elements([]))
# print(count_elements([1,2,2]))
# print(count_elements([1,[... | Taewan-P/python_study | exercise_2017/16th_week_finals/2017exam2-sol.py | 2017exam2-sol.py | py | 6,076 | python | en | code | 0 | github-code | 1 |
32411301844 | # Encapsulation is mechanism of hiding data implementation
class SoftwareEngineer:
def __init__(self, name, age):
# Public attributes
self.name = name
self.age = age
# Protected attributes
self._salary = None
self._num_bugs_solved = 0
def code(self):
... | ZJTAN97/learning_python | OOP/old/oop4.py | oop4.py | py | 1,080 | python | en | code | 0 | github-code | 1 |
24760105080 |
from ast import Import
from flask_app.config.mysqlconnection import connectToMySQL
from flask_app.models.ninja import Ninja
from pprint import pprint
DATABASE = 'dojos_and_ninjas'
class Dojo:
def __init__( self , data ):
self.id = data['id']
self.name = data['name']
self.ninjas = []
... | ShawnCreswell/Python | flask_mysql/Dojos_ninjas_crud/flask_app/models/dojo.py | dojo.py | py | 3,063 | python | en | code | 0 | github-code | 1 |
13116537010 | import numpy as np
import os
import gzip
import matplotlib.pyplot as plt
from tensorflow import keras
from tensorflow.keras import models
import tensorflow as tf
# ็ฝ็ปๅ ่ฝฝๆฐๆฎ้
# fashion_mnist = keras.datasets.fashion_mnist
# (train_images, train_labels),(test_images, test_labels) = fashion_mnist.load_data()
# ๅฎไนๅ ่ฝฝๆฐๆฎ็ๅฝๆฐ๏ผd... | crazySao/2021-Code | MachineLearning/FashionMNIST/FashionMNIS.py | FashionMNIS.py | py | 3,219 | python | en | code | 0 | github-code | 1 |
17659817974 | import json
import sys
import numpy
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from keras.optimizer_v2.adam import Adam
import cv2
import tensorflow
import warnings
from keras.losses import categorical_crossentropy
from keras.models import model_from_json
from faceRecognition import testFaceRecognition2
f... | qqrtos/kids-learning-platform | mirpr-emotional/main.py | main.py | py | 4,764 | python | en | code | 0 | github-code | 1 |
36620678228 | import openai
import os
engine_list = ['gpt-35-turbo', 'gpt-35-turbo-16k', 'gpt-4', 'gpt-4-32k', 'text-embedding-ada-002']
class Config:
OPENAI_API_TYPE = "azure"
OPENAI_API_BASE = "your_api_base"
OPENAI_API_VERSION = "2023-07-01-preview"
OPENAI_API_KEY = "your_api_key"
MAX_TURNS = 10
os.maked... | pooruss/ML-Framework-for-Diverse-Applications-in-Trading-and-Finance | openai_chat.py | openai_chat.py | py | 2,362 | python | en | code | 0 | github-code | 1 |
14448299607 | from .models import Teacher
from .models import Group
from .models import TeacherSubject
from .models import TypedSubject
from .models import Day
from .models import TimeTable
from .models import LessonType
import itertools
import itertools
from pulp import *
problem = LpProblem("schedule-opt", LpMaximize)
from faker... | osboo/schedule-opt | schedule_app/schedules/optimizer.py | optimizer.py | py | 9,228 | python | en | code | 0 | github-code | 1 |
23180792801 | class Solution(object):
def repeatedNTimes(self, A):
"""
:type A: List[int]
:rtype: int
"""
temp = []
for i in range(len(A)):
if A[i] in temp:
return A[i]
temp.append(A[i]) | 7Aishwarya/Data-Structures-and-Algorithms | Hashmap/N-repeated-element-in-size-2n-array.py | N-repeated-element-in-size-2n-array.py | py | 264 | python | en | code | 0 | github-code | 1 |
22080278831 | import flask
import sqlite3
from flask import jsonify, Response
from config import DEBUG, DATABASE_PATH
from models import Application, ApplicationHistory
app = flask.Flask(__name__)
app.config["DEBUG"] = DEBUG
@app.route('/<app_id>', methods=['GET'])
def application(app_id):
connection = sqlite3.connect(DATABAS... | bilelmoussaoui/flathub-stats | flathub/server.py | server.py | py | 569 | python | en | code | 3 | github-code | 1 |
9264868588 |
# import libraries
import argparse
import os
import json
import datetime
import boto3
import sagemaker
from sagemaker.tensorflow.estimator import TensorFlow
from sagemaker.tensorflow.model import TensorFlowModel
from env import *
def train():
"Train the model in SageMaker"
with open(HYPERPARAMETERS_FI... | neoxia/sagemaker-benchmark | projects/mnist_tensorflow2_scriptmode/pipeline/main.py | main.py | py | 2,940 | python | en | code | 0 | github-code | 1 |
16239766894 | import warnings
from torch.utils.data.dataloader import DataLoader
from dataloaders.datasets.cityscapes import CityscapesSegmentation
from config_utils.search_args import obtain_search_args
from utils.loss import SegmentationLosses
import torch
import numpy as np
from auto_deeplab import AutoDeeplab
model = AutoDeepla... | NoamRosenberg/autodeeplab | test.py | test.py | py | 1,467 | python | en | code | 306 | github-code | 1 |
71884000353 | from __future__ import absolute_import, division
from collections import defaultdict
from .components import Edge, Node
from .exceptions import InvalidNodeTypeError, MaxNodeError, GraphTypeError
from .utils import check_cycle
from .algorithms._search import BFS, DFS
from .algorithms._sort import topological_sort
... | Fredpwol/graphnet | graphnet/graph.py | graph.py | py | 18,096 | python | en | code | 3 | github-code | 1 |
25056266008 | import re
import gspread
import os
import json
from itertools import takewhile
consonants_bw = "['|>&<}bptvjHxd*rzs$SDTZEgfqklmnhwy]"
double_cons = re.compile('{}{}'.format(consonants_bw, consonants_bw))
CONS_CLUSTER_IMPLEM = False
POS_NOMINAL = [
'abbrev', 'adj', 'adj_comp', 'adj_num', 'adv', 'adv_interrog',
... | CAMeL-Lab/camel_morph | camel_morph/utils/utils.py | utils.py | py | 18,417 | python | en | code | 3 | github-code | 1 |
73722707555 | import os
from train import config
from unet3d.prediction import run_validation_cases
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
def main():
prediction_dir = os.path.abspath("prediction")
run_validation_cases(validation_keys_file=config["validation_file"],
... | maikia/StrokeUNET | brats/predict.py | predict.py | py | 745 | python | en | code | 1 | github-code | 1 |
23981818316 | #!/usr/bin/env python
import pydart
import logging
from simulation import Simulation
from window import Window
import utils
import sys
# from logging_tree import printout # pip install logging_tree
# printout()
root = logging.getLogger()
root.setLevel(logging.DEBUG)
root.handlers = []
ch = logging.StreamHandler(sys... | sehoonha/green_stair | main.py | main.py | py | 1,622 | python | en | code | 0 | github-code | 1 |
23395965906 | from agents.NaiveMCTS import NaiveMCTS
from games.tictactoe.TicTacToe import TicTacToeBoard
from games.Player import Player
from policies.RandomPolicy import RandomTTTPolicy
NUM_ROWS = 3
NUM_COLS = 3
def simulate(
manual_play=False,
mcts_mark="X",
opponent_mark="O",
n_tree_iters=100,
verbose=Fals... | Michael-Nath/MCTS | run.py | run.py | py | 2,706 | python | en | code | 0 | github-code | 1 |
11746337176 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 5 14:51:03 2019
@author: Benjamin
"""
import numpy as np
import pandas as pd
data_path = "/Users/Benjamin/Documents/MATHAPPLI/APST-ML/DataChallenge/DataChallengeGenerali/data/"
#Importation de X (train ou test)
filename_input = "X_train.csv"
fil... | bbeaucamp/DataChallengeGenerali | scripts/ajout_donnรฉes/chomage_revenus.py | chomage_revenus.py | py | 3,064 | python | fr | code | 0 | github-code | 1 |
20210567264 | from dtcwt_scattering import DtcwtScattering2D
import numpy as np
from copy import copy
from keras import layers
from keras.models import Sequential
from keras.optimizers import RMSprop
from time import time
from statistics import mean
class DtcwtConvClassifier:
def __init__(self, m=2):
self.transform2D =... | COMPLEX-WAVELET/complex-wavelet | conv_classifier.py | conv_classifier.py | py | 2,384 | python | en | code | 0 | github-code | 1 |
25485702994 | #!/usr/bin/env python3
from mpd import MPDClient
from requests import post
#from secrets import secrets # Get personal passwords
# NOTE: the 'secrets' module didn't exist at the time
from time import sleep, strftime
POST_URL = 'http://blog.pineman.sexy/control'
MPD_SOCKET = '/home/pineman/.config/mpd/socket'
client =... | pineman/code | old_proj/stream/mpdpostd.py | mpdpostd.py | py | 1,359 | python | en | code | 1 | github-code | 1 |
72329281635 | #contains pretrained timm model
import urllib
import os
# import gradio as gr
import torch
import timm
import numpy as np
from PIL import Image
import torchvision.transforms as T
import torch.nn.functional as F
from matplotlib.colors import LinearSegmentedColormap
from typing import Dict
from captum.attr import vis... | shilpiprd/emlo7_solution | pgd.py | pgd.py | py | 3,265 | python | en | code | 0 | github-code | 1 |
14204687745 | from django.shortcuts import render,redirect
from django.http import HttpResponse
from .models import Income, Expense
from .forms import Update_E,Update_I
def Index(request):
income = Income.objects.all()
expense = Expense.objects.all()
return render(request, "index.html", {'income': income, 'expe... | Gomolemo-M-Motlhamme/Finance-IO | Finance_IO/Index/views.py | views.py | py | 1,900 | python | en | code | 0 | github-code | 1 |
31464620825 | import logging
import os
import uuid
from typing import Tuple, Dict, Optional, Callable, Any
from nebullvm.base import (
ModelParams,
DeepLearningFramework,
QuantizationType,
Device,
)
from nebullvm.config import (
AUTO_TVM_TUNING_OPTION,
AUTO_TVM_PARAMS,
QUANTIZATION_DATA_NUM,
CONSTRAI... | MuntahaShams/nebullvm | nebullvm/optimizers/tvm.py | tvm.py | py | 12,889 | python | en | code | null | github-code | 1 |
28646418023 | from datetime import datetime
from ..schema import BaseTransformer
class Transformer(BaseTransformer):
"""Transform Utah raw data for consolidation."""
postal_code = "UT"
fields = dict(
company="Company Name",
location="Location",
notice_date="Date of Notice",
jobs="Affec... | biglocalnews/warn-transformer | warn_transformer/transformers/ut.py | ut.py | py | 784 | python | en | code | 3 | github-code | 1 |
14815941904 | import pysam
import numpy as np
import cv2
from PIL import Image
from multiprocessing import Process, Queue
import random
import glob
class Query:
def __init__(self,name,cigar,query,qual,mapq,position,indent,ref):
self.name=name
self.ref=ref
self.cigar=cigar
self.query=query
... | sylee623/GOTCHA | src/training_making/bam_array_generator_for_train.py | bam_array_generator_for_train.py | py | 14,268 | python | en | code | 0 | github-code | 1 |
1998705147 | import logging
from bloghandler import BlogHandler
from helpers.render import post_exist, blog_key
from helpers.render import vote_exist
from google.appengine.ext import db
from models.vote import Vote
class VotePost(BlogHandler):
def get(self, post_id,vote_default):
if not vote_default:
vote_d... | tloi/UdacityMultiUserBlog | handlers/votepost.py | votepost.py | py | 2,014 | python | en | code | 0 | github-code | 1 |
42366607095 | class NumMatrix:
def __init__(self, matrix: List[List[int]]):
for i in range(1, len(matrix)):
for j in range(len(matrix[0])):
matrix[i][j] = matrix[i-1][j] + matrix[i][j]
for i in range(len(matrix)):
for j in range(1, len(matrix[0])):
... | mykelbengineer/LeetCode | range-sum-query-2d-immutable/range-sum-query-2d-immutable.py | range-sum-query-2d-immutable.py | py | 976 | python | en | code | 1 | github-code | 1 |
22870057375 | import sys
def find_seq(dna,sample):
"""return number of sequences OF sample in a dna"""
#safty check
if (sample not in ['A', 'T', 'C', 'G']):
#invalid sample
return 0
point = 0
for i in range(len(dna)):
if (dna[i] == sample):
point += 1
return point ... | alisharify7/Programming-Questions | Medium-Questions/17-Repetitions/Python/Seventeen.py | Seventeen.py | py | 667 | python | en | code | 26 | github-code | 1 |
32812980636 | import yaml
import itertools
import random
from django.templatetags.static import static
import pandas as pd
from datetime import date
import json
def parse_yml(path):
with open(path, 'r', 1) as file_stream:
yml_file = yaml.load(file_stream)
return yml_file
def get_next_question_difficulty_level(que... | pkuaaron/akidzon_xblock | akidzon/utils.py | utils.py | py | 10,498 | python | en | code | 0 | github-code | 1 |
31305593402 | from django.urls import path
from .views import (
ArticulosAgregarView, ArticulosApiView, ArticulosDetalladoView, ArticulosEliminarView,ArticuloActualizarView)
urlpatterns = [
path('api/', ArticulosApiView.as_view(), name="Api"),
path('api/agregar/', ArticulosAgregarView.as_view(), name="create"),
... | AlbaBermudez/ProyectoAPI | ProyectoAPI/appAPI/urls.py | urls.py | py | 575 | python | en | code | 0 | github-code | 1 |
38267722193 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 1 00:29:59 2023
@author: 16692
"""
from sqlalchemy import Column, Integer, String, DateTime, Text
from sqlalchemy.orm import declarative_base
from datetime import datetime
Base = declarative_base()
class User(Base):
__tablename__ = "users"
user_id = Column(Int... | saurabhsathe/eikontx-backend-swe2 | database_ops/users.py | users.py | py | 903 | python | en | code | 0 | github-code | 1 |
35375175946 | from django.urls import path
from . import views
from reviews import views as reviewsViews
from .views import SearchBooks
app_name = "books"
urlpatterns = [
path("home/", views.Home, name="home_page"),
path("list/", views.ListBooks, name="list_books"),
path("list/top_ten", views.TopTen, name="top_ten"),
... | stanley-wei/CS35L-Project | books/urls.py | urls.py | py | 1,018 | python | en | code | 1 | github-code | 1 |
11814951006 | # W tym pliku bฤdฤ
znajdowaฤ siฤ waลผne funkcje dotyczฤ
ce
# Symulatora Julki. Zrobiลem to po to by nie zaลmiecaฤ
# gลรณwnego pliku wykonywalnego.
import json
configFilePath = "./config.json"
loopedAnsw = False
randomizeAnsw = False
stoppingKeywords = None
userCustomJulkaAnsw = None
def initConfig():
global config... | REMOLP/JulkaSim-Remake | julkalib.py | julkalib.py | py | 3,301 | python | pl | code | 0 | github-code | 1 |
21794665224 | from selenium import webdriver
from selenium.webdriver.firefox.service import Service
from webdriver_manager.firefox import GeckoDriverManager
import requests
driver = webdriver.Firefox(service=Service(GeckoDriverManager().install()))
driver.get("https://en.wikipedia.org/wiki/SpaceX")
wikipedia_xpath="/html/body/div... | RianNugroho/DSTakeHome | main.py | main.py | py | 923 | python | en | code | 0 | github-code | 1 |
5592598850 | from rest_framework import serializers
from api.models import OauthRecord
class OauthRecordSerializer(serializers.ModelSerializer):
class Meta:
model = OauthRecord
exclude = ('id', 'user')
def create(self, data):
instance = OauthRecord.objects.create(
user=data['user'],
... | johnny-butter/eLibrary | api/serializers/oauth_record.py | oauth_record.py | py | 421 | python | en | code | 0 | github-code | 1 |
39305314546 | #! /usr/bin/env python3
# -*- coding:UTF-8 -*-
from tkinter import *
from tkinter.messagebox import *
from winsound import *
import getpass
import os
import sys
import pickle
import _thread
import time
from win32api import *
from win32con import *
with open(r'd:\anaconda\data.pkl', 'rb') as f:
data = pickle.load(f... | XRFXRF/Data-structure | ๆธธๆ.py | ๆธธๆ.py | py | 2,658 | python | en | code | 1 | github-code | 1 |
10108780767 | # -*- coding: utf-8 -*-
'''
@Author: tanbo
@Time: 2021/12/29 10:01 ไธๅ
@File: bi_dfs_open_lock.py
'''
def minus_one(s, idx):
"""
้ๆถ้
:param s:
:param idx:
:return:
"""
s_list = list(s)
if s_list[idx] == "0":
s_list[idx] = "9"
else:
s_list[idx] = str(int(s_list[idx])-1... | LearnMF/Algorithm | bi_dfs_open_lock.py | bi_dfs_open_lock.py | py | 1,794 | python | en | code | 0 | github-code | 1 |
1823465172 | import json
from collections import defaultdict
from time import sleep
from uuid import uuid4
import pytest
import requests
from dp.protos.enodebd_dp_pb2 import CBSDRequest, CBSDStateResult, LteChannel
from dp.protos.enodebd_dp_pb2_grpc import DPServiceStub
from magma.test_runner.config import TestConfig
from magma.te... | AdityaKoranga/magma | dp/cloud/python/magma/test_runner/tests/test_active_mode_controller.py | test_active_mode_controller.py | py | 5,696 | python | en | code | null | github-code | 1 |
42229045782 | import pandas as pd
import os
path = os.path.join(os.path.curdir, 'Dataset')
cock_df = pd.read_csv(os.path.join(path, "all_drinks.csv"))
cock_df = cock_df.loc[:, ['strDrink', 'idDrink', 'strAlcoholic', 'strCategory', 'strGlass', 'strIBA']]
recipe_df = pd.read_csv(os.path.join(path, "cocktail_recipes.csv"))
print(coc... | PRADA-1541/PRADA_AI | Codes/item_select.py | item_select.py | py | 465 | python | en | code | 0 | github-code | 1 |
11960533630 | import pickle
import cv2
import dlib
import os
import numpy as np
import base64
# initialize dlib's face detector (HOG-based) and then create the facial landmark predictor
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor('models/shape_predictor_68_face_landmarks.dat')
# load the face recog... | ptlc8/zoom-visages | detect.py | detect.py | py | 4,771 | python | en | code | 1 | github-code | 1 |
23553893112 | from django.urls import path
from . import views
urlpatterns = [
path('<slug:category_name>/', views.CategoryView.as_view(), name="category"),
path('<slug:category>/<slug:slug>/', views.PostDetailView.as_view(), name="detail_post"),
path('<slug:tag_slug>/', views.TagDetailView.as_view(), name="detail_tag"... | anuarmurawski84/TestDjango2 | blog/urls.py | urls.py | py | 365 | python | en | code | 0 | github-code | 1 |
38895831805 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # ่ฆๆพๅจ import tensorflow as tf ๅ้ขๆไผ่ตทไฝ็จ ๏ผ๏ผ๏ผ
import tensorflow as tf
from tensorflow import keras
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
from data import DIV2K
class Reloader:
def __init__(self, model_path):
self.model = k... | MuyaoYuan/FSRCNN-tf | reloader.py | reloader.py | py | 1,879 | python | en | code | 0 | github-code | 1 |
28575719618 | class Simulation():
def findInterval(interval: list, val: int) -> int:
lo = 0; hi = len(interval) - 1; mid = 0
while lo < hi:
mid = (lo + hi) // 2
if lo + 1 == hi:
return hi if interval[hi] <= val else lo
if interval[mid] ... | Moenupa/Python-Archive | simulation/simulation.py | simulation.py | py | 1,662 | python | en | code | 0 | github-code | 1 |
42131468718 | import email
import csv
from fileinput import filename
from flask import Flask, render_template, url_for,request,redirect
app = Flask(__name__)
print(__name__)# is __main__ because this is main file we are running
#How to make these writing routes dynamic???
@app.route('/')
def my_home():# thats defaults
return ... | suprimregmi/Flask | Portfolio/app.py | app.py | py | 2,006 | python | en | code | 0 | github-code | 1 |
4421851764 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module to check if the DB works
===============================
Runs multiple checks to see if the database was correctly setup.
"""
import argparse
import logging
from orion.core.cli.db.test import main
log = logging.getLogger(__name__)
DESCRIPTION = "(DEPRECATED) ... | lebrice/orion | src/orion/core/cli/test_db.py | test_db.py | py | 1,067 | python | en | code | null | github-code | 1 |
30579027002 | import datetime
from cryptography.x509 import *
from cryptography.x509 import OID_COMMON_NAME
from cryptography.hazmat.primitives import serialization
from certificate_authority.database import db
from certificate_authority.models import *
from os import urandom
from utils.signing import get_default_encryption_padding,... | momvart/dns_project | certificate_authority/cert_issuer.py | cert_issuer.py | py | 2,592 | python | en | code | 0 | github-code | 1 |
24032855686 | from os import path
import random
import string
from cgi import FieldStorage
import onlinelux
STORAGE_PATH = path.abspath(path.join(path.dirname(onlinelux.__file__), 'public', 'storage'))
class StorageManager:
"""Images Storage"""
def __init__(self):
self.storage_path = STORAGE_PATH
def stor... | eteamin/onlineluxe | onlinelux/lib/store.py | store.py | py | 1,065 | python | en | code | 0 | github-code | 1 |
19327625963 | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from whatsnew.views import ChangelogView
urlpatterns = patterns(
'whatsnew.views',
url(r'^test/', TemplateView.as_view(template_name='whatsnew/test.html'),
name='whatsnew-test'),
url(r'^changelog/', ChangelogV... | saxix/django-whatsnew | whatsnew/urls.py | urls.py | py | 432 | python | en | code | 5 | github-code | 1 |
11603680922 | '''
model training pseudocode:
load dataset
transform dataset
for 100 iterations:
split dataset into 3 equal parts
assign trainingset 2/3 parts
assign testingset 1/3 part
find size n of trainingset
#perform leave-one_out cross-validation
For n iterations:
assign validationset unique ... | theohal/BfTM | sarah/assignment_slp_v1.py | assignment_slp_v1.py | py | 1,831 | python | en | code | 0 | github-code | 1 |
30114682066 | import random as rnd
rnd.seed(0)
B = [i for i in range(0, 256)]
A = [i for i in range(0, 256)]
OUT = [0] * 512
d_input = A + B
swap = 32//32
tempA = 0
tempB = 0
threadsperpair = 64 // 16
x = [32] * 32
y = [32] * 32
def seq_merge(Out, offset, A, tempA, x1, x2, B, tempB, y1, y2):
if(offset == 4 * 16):
... | AhmedAmraniAkdi/Learning-cuda-repo | sort/mergesortsmall.py | mergesortsmall.py | py | 3,094 | python | en | code | 0 | github-code | 1 |
41004428752 | """
This module defines input sets for CP2K and is a work in progress. The structure/philosophy
of this module is based on the Vasp input sets in Pymatgen. These sets are meant to contain
tested parameters that will result in successful, reproducible, consistent calculations without
need for intervention 99% of the tim... | jsyony37/pymatgen | pymatgen/io/cp2k/sets.py | sets.py | py | 48,957 | python | en | code | 1 | github-code | 1 |
28825101443 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 3 23:28:26 2016
@author: Guanhao Wu
"""
from Neuron import Neuron
from NeuronParameters import NeuronParameters
import matplotlib.pyplot as plt
import numpy as np
T=60000
V=[]
N=Neuron()
P=NeuronParameters()
P.set_RS(N)
for t in range(T):
if t>5... | higgamo/PNN | SingleNeuron.py | SingleNeuron.py | py | 471 | python | en | code | 0 | github-code | 1 |
72342027875 | from netfilterqueue import NetfilterQueue
from scapy.all import *
import re
cc = re.compile('[0-9]{4}\.[0-9]{4}\.[0-9]{4}\.[0-9]{4}')
pwd = re.compile('[0-9A-Z:;<>=?@.]+\s')
def print_and_accept(pkt):
payld = pkt.get_payload()
#temp = scapy.raw(temp)
ip = IP(payld)
if ip.haslayer(Raw):
http =... | FurkanKarakas/InfoSec-EPFL-Fall-2019 | HW4/Ex1/mitm.py | mitm.py | py | 615 | python | en | code | 0 | github-code | 1 |
18456550160 | import argparse
import sys
def foltycalc(args):
if args.c=="add":
if args.a==78 or args.a==23 and args.b==23 or args.b==78:
return print(f"{args.a}+{args.b} is :",666)
else:
return print(f"{args.a}+{args.b} is :",args.a+args.b)
elif args.c=="sub":
... | kkstech1986/kksingh_soft | fultycalculater_CMD.py | fultycalculater_CMD.py | py | 1,886 | python | en | code | 0 | github-code | 1 |
9466511067 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# load dataset
df = pd.read_csv("./project/feature_data.csv")
df.head()
# index number ์ ๊ฑฐ
df.drop(["Unnamed: 0"], axis=1, inplace=True)
X = df.drop(["ET"], axis=1)
y = df["ET"]
n_1 = np.sum(y==1)
n_0 = np.sum(y==0)
print(n_0, n_1)
r_state = 42
#... | tyami/naver-competition-study | project/02_resampling.py | 02_resampling.py | py | 2,660 | python | en | code | 0 | github-code | 1 |
26398398645 | # pylint: disable=missing-module-docstring
# pylint: disable=import-error
import json
from collections import namedtuple
from constants.isa_const import Opcode
class Term(namedtuple('Term', 'pos symbol')):
"""ะะฟะธัะฐะฝะธะต ะฒััะฐะถะตะฝะธั ะธะท ะธัั
ะพะดะฝะพะณะพ ัะตะบััะฐ ะฟัะพะณัะฐะผะผั."""
# ัะดะตะปะฐะฝะพ ัะตัะตะท ะบะปะฐัั, ััะพะฑั ะฑัะป docstring
def... | buffer404/university | year3/Computer architecture/lab3/constants/isa.py | isa.py | py | 887 | python | ru | code | 1 | github-code | 1 |
37797160663 | import re
print("Type in credit card number.")
creditcard=str(input())
# Remove hyphons to check total length based on numeric digits only
CCnumberlength=creditcard.replace("-","")
#check first number to match 4, 5 or 6 and that the number consists of four groups of four
#and that each group of four is ei... | joshbaker0212/joshbaker0212 | ccvalidator.py | ccvalidator.py | py | 1,212 | python | en | code | 0 | github-code | 1 |
18672465608 | class dev():
def __init__(self,dtype,deviceid,busy,counter):
self.dtype=dtype
self.id=deviceid
self.busy=busy
self.counter=counter
self.queue={}
def printIt(self):
if self.busy==0:
busyStr="็ฉบ้ฒ"
else:
busyStr="ๅฟ็ข"
print("่ฎพๅค็ฑปๅ๏ผ%-15s\t็ผๅท๏ผ%-4d\t %-10s"%(self.dtype,self.id,busyStr))
class devClass()... | springremember/labReports | ๆไฝ็ณป็ป/ๅฎ้ชๅ
ญ่ฎพๅคๅ้
/dev.py | dev.py | py | 4,326 | python | en | code | 0 | github-code | 1 |
71176138595 | import asyncio
import time
from random import randint
from sys import argv
import web3 as w3
from web3.middleware import geth_poa_middleware
from solcx import compile_source
class Node:
def __init__(self, addr, password, addresses, account_limit, to_send,
port):
self.web3 = w3.Web3(
... | coltonfike/e2c | testnet/contract.py | contract.py | py | 3,596 | python | en | code | 0 | github-code | 1 |
15238091678 | from django.urls import path
from . import views
urlpatterns = [
path('', views.review, name='review'),
path('post_review/', views.post_review, name='post_review'),
path('review_list/', views.review_list, name='review_list'),
path('game_reviews/<game_id>', views.game_reviews, name='game_reviews'),
] | fergabi17/gemotion | reviews/urls.py | urls.py | py | 318 | python | en | code | 1 | github-code | 1 |
8887803211 | import scipy.signal as spsig
import globalVariables as gv
import numpy as np
import os
import matplotlib.pyplot as plt
from astropy.io import fits
import scipy.special as sps
import scipy.optimize as spo
from MakeMHzScale import MHzScale
import scipy.ndimage as spni
import scipy.interpolate as spi
#analyze the big fat... | BillyTheKidPhysicist/experimentControlAndAnalysis | prettyFocusAnalzer.py | prettyFocusAnalzer.py | py | 7,213 | python | en | code | 0 | github-code | 1 |
73944562912 | import enum
import geomdl
import math
import numpy as np
import pybullet as p
import scipy.optimize
from sklearn.decomposition import PCA
import torch
import pytorch_kinematics as pk
from scipy.spatial.transform import Rotation as R
def fibonacci_sphere(samples=1):
points = []
phi = math.pi * (3. - math.sqrt... | Ericcsr/synthesize_pregrasp | utils/math_utils.py | math_utils.py | py | 18,341 | python | en | code | 8 | github-code | 1 |
18119046702 | #!/usr/bin/python3
import aiohttp_cors
import os
import aiohttp
import concurrent.futures
import asyncio
class EyesWebServer():
def __init__(self):
self.app_path="/opt/eyes"
self.web_path="/opt/eyes/web/eyes"
self.web_address="home.dayton.tech"
self.web_port=8080
self.sse_... | tagdara/eyes | server/eyes.py | eyes.py | py | 1,998 | python | en | code | 0 | github-code | 1 |
11741414478 | # Look for #IMPLEMENT tags in this file. These tags indicate what has
# to be implemented to complete the warehouse domain.
# You may add only standard python imports
# You may not remove any imports.
# You may not import or otherwise source any of your own files
import os # for time functions
import math ... | jinxtupid/CSC384-2022W | A1/solution.py | solution.py | py | 11,005 | python | en | code | 0 | github-code | 1 |
25369895893 | import os
import configparser
class ReadConfig(object):
def __init__(self):
self.project_path = None
self.config_path = None
self.config = configparser.ConfigParser()
def _set_project_path(self):
# ่ทๅ้กน็ฎๅฐๅ
try:
self.project_path = os.path.split(os.path.abspa... | weixingdemeng/weixingdemeng.github.io | autotest/read_config.py | read_config.py | py | 746 | python | en | code | 0 | github-code | 1 |
29752301321 | A = [8,5,6,3,9,8,3,9,1,8]
A = ["mah","jaz","ali"]
# res = sorted(A)#doesnt change the original list
# print(res)
# print(A)
A.sort()
print(A)
| jazib-mahmood-attainu/J-R-D_TATA | W6D5/in_built.py | in_built.py | py | 149 | python | en | code | 6 | github-code | 1 |
8529218144 | import os
import numpy as np
from netCDF4 import Dataset
from lisfloodutilities.readers import PCRasterMap
from lisfloodutilities.pcr2nc import convert
from . import TestWithCleaner
class TestPcr2nc(TestWithCleaner):
def test_convert(self):
dataset = 'tests/data/folder_d'
out = 'tests/data/pcr... | ec-jrc/lisflood-utilities | tests/test_pcr2nc.py | test_pcr2nc.py | py | 1,941 | python | en | code | 14 | github-code | 1 |
22083627803 | import pika
import sys
import time
# ่ฟ็จrabbitmqๆๅก็้
็ฝฎไฟกๆฏ
username = 'chris' # ๆๅฎ่ฟ็จrabbitmq็็จๆทๅๅฏ็
pwd = '123456'
ip_addr = '172.18.99.177'
# rabbitmq ๆฅ้ pika.exceptions.IncompatibleProtocolError: StreamLostError: (โTransport indicated EOFโ,) ไบง็ๆญคๆฅ้็ๅๅ ๆฏๆๅฐportๅๆไบ15672
# rabbitmq้่ฆ้่ฟ็ซฏๅฃ5672่ฟๆฅ - ่ไธๆฏ15672. ๆดๆน็ซฏๅฃ๏ผ่ฝฌๅ๏ผไธๅๆญฃๅธธ
port_nu... | chriskowk/PycharmProjects | PyQtTest/sendmq.py | sendmq.py | py | 1,549 | python | en | code | 0 | github-code | 1 |
32738212165 | import argparse
from colorama import init
from .common import Messages, Path, check_if_exists
from .. import Havok
def parse_args():
parser = argparse.ArgumentParser(description="Convert Havok packfile to JSON")
parser.add_argument("hkFile", type=Path, help="Path to a Havok packfile")
parser.add_argumen... | krenyy/botw_havok | botw_havok/cli/hk_to_json.py | hk_to_json.py | py | 1,112 | python | en | code | 4 | github-code | 1 |
27754634603 | f = open("day8/input8b.txt", "r")
f = f.read().split("\n")
f = [[y.strip() for y in x.split(" | ")] for x in f]
f = [x for x in f if x != ['']]
segments = [2,4,3,7]
nums = [x[1] for x in f]
count = 0
for signal in nums:
n = signal.split()
for x in n:
if len(x) in segments:
count += 1
print... | timmermansjoy/advent_of_code_2021 | day8/1.py | 1.py | py | 328 | python | en | code | 0 | github-code | 1 |
14351239029 | import requests, uuid, json, argparse, sys
import langcodes
# This is for the safety of the key
from config import AZURE_KEY
# Add your key and endpoint
key = AZURE_KEY
endpoint = "https://api.cognitive.microsofttranslator.com"
# Creating an argument parser
parser = argparse.ArgumentParser(description="Tranlate text... | SonuLohani-1/MyTranslator | project.py | project.py | py | 1,972 | python | en | code | 0 | github-code | 1 |
13006443464 | from telethon import TelegramClient, events, sync,utils
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.functions.messages import GetDialogsRequest
from telethon.tl.types import InputPeerEmpty, InputPeerChannel, InputPeerUser
from telethon.errors.rpcerrorlist import (PeerFloodError, UserNotM... | xiroshigo/TgMemberAdd | TgMemberAdder.py | TgMemberAdder.py | py | 12,767 | python | en | code | 0 | github-code | 1 |
1498857319 | #!/usr/bin/env python3
# dpw@Darryls-iMac.localdomain
# 2023-03-25 22:51:18
#
def dms2dd(d, m, s):
return d + m / 60 + s / 3600
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description="Enter an angle in degrees, minutes and seconds"
)
parser.add_argument... | darrylwest/python-play | maths/dms2dd.py | dms2dd.py | py | 645 | python | en | code | 0 | github-code | 1 |
5811290474 | import machine, sys
import network
import utime
from umqtt.simple import MQTTClient
from einstellungen import *
#TOPICS
TOPIC_SUBSCRIPTION = 'MEINE_TOPIC/TESTS/SUBSCRIBE'
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(SSID,PASSWORT)
while not wlan.isconnected() and wlan.status() >= 0:
print("Ve... | make-it-mint/mqtt-workshop | test_subscribing.py | test_subscribing.py | py | 1,077 | python | en | code | 0 | github-code | 1 |
11036914150 | from PIL import Image
import glob
import os
frontPicPaths = glob.glob(os.getcwd() + '/**/front.png', recursive=True)
backPicPaths = glob.glob(os.getcwd() + '/**/back.png', recursive=True)
files = frontPicPaths + backPicPaths
print(files)
for f in files:
try:
im = Image.open(f)
# rearrage t... | tshadowknight/proto_crystal | gfx/pokemon/swapPal.py | swapPal.py | py | 1,183 | python | en | code | 17 | github-code | 1 |
14839102625 | """
Section 1
Multithreading - Thread(1) - Basic
Keyword - Threading basic
"""
import logging
import threading
import time
# ์ค๋ ๋ ์คํ ํจ์
def thread_func(name):
logging.info(f"Sub-Thread {name}: starting")
time.sleep(3)
logging.info(f"Sub-Thread {name}: finishing")
# ๋ฉ์ธ ์์ญ
if __name__ == "__main__":
#... | taxijjang/develop_study | ๊ณ ์๊ฐ ๋๋ ํ์ด์ฌ/py_ad_1_3.py | py_ad_1_3.py | py | 929 | python | en | code | 1 | github-code | 1 |
17646806271 |
import cv2
# haarcascade ๋ถ๋ฌ์ค๊ธฐ
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_eye.xml')
# ์ด๋ฏธ์ง ๋ถ๋ฌ์ค๊ธฐ
original_num = 2
img = cv2.imread(str(original_num)+'.jpg')
gray = cv2.cvtColor... | baecci/ALPHAGO_Project22 | test1.py | test1.py | py | 1,278 | python | ko | code | 0 | github-code | 1 |
39587395835 | import time
import torch
import random
import numpy as np
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from tqdm import tqdm, trange
from torchtext import data
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
from transformers import XLMRobertaModel
... | PrasannaKumaran/ECMAG---An-Ensemble-Framework-for-Sentiment-Analysis-in-Code-Mixed-Data | main.py | main.py | py | 7,944 | python | en | code | 0 | github-code | 1 |
32039360746 | FILE_NAME = 'input17.in'
def simulate(velocity_x, velocity_y):
bounded_highest = -999
x, y = 0, 0
possible = True
while possible:
x += velocity_x
y += velocity_y
velocity_x = velocity_x + 1 if velocity_x < 0 else velocity_x - 1 if velocity_x > 0 else velocity_x
... | Jozkings/advent-of-code-2021 | 17.py | 17.py | py | 1,333 | python | en | code | 0 | github-code | 1 |
30406506542 | import json
import torch
from torch.utils.data import Dataset
from transformers import GPT2LMHeadModel, GPT2Tokenizer, DataCollatorForLanguageModeling, Trainer, TrainingArguments
from data_preprocess import *
# Load the JSON file with prompt-completion pairs
with open("prompt_completion_pairs.json", "r") as json_file:... | namandua7/Training | GPT model/csv_GPT/fine_tuning.py | fine_tuning.py | py | 2,114 | python | en | code | 0 | github-code | 1 |
15518284763 | import requests
from common import URL, GRAPHQL_URL, graph_query
def test_check_introspect_fields():
fields = ['pastes', 'paste', 'systemUpdate', 'systemDiagnostics', 'systemDebug', 'systemHealth', 'users', 'readAndBurn', 'search', 'audits', 'deleteAllPastes', 'me']
r = requests.get(URL + '/difficulty/easy')
... | dolevf/Damn-Vulnerable-GraphQL-Application | tests/test_introspect.py | test_introspect.py | py | 1,842 | python | en | code | 1,367 | github-code | 1 |
70737356834 | import paho.mqtt.client as mqtt
import json
from influxdb import InfluxDBClient
server = "54.87.52.22"
def on_connect(client, userdata, flags, rc):
print("Connected with RC : " + str(rc))
client.subscribe("cpu/2016146022/evt/light")
def on_message(client, userdata, msg):
print(msg.topic + " " + msg.payl... | ChanWhanPark/IoT_Basic | 20201123_12์ฃผ์ฐจ/sub_lab3.py | sub_lab3.py | py | 1,002 | python | en | code | 0 | github-code | 1 |
30344410584 | # This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O... | sathwikgs/Superres_GAN | first_gan.py | first_gan.py | py | 8,621 | python | en | code | 0 | github-code | 1 |
27800773574 | import numpy as np
import matplotlib.pyplot as plt
import math
def quad2(x_o=[-9.0,9.0],a=2.0,eta=0.1,threshold=0.01,maxiter=1000,alpha=0,anim = 1):
it = 0
x1 = np.linspace(-10,10,21)
x2 = np.linspace(-10,10,21)
[X,Y] = np.meshgrid(x1,x2)
Y = (a*X**2+Y**2)/2
plt.clf()
pl... | Alexandre425/aa | lab2/part3.py | part3.py | py | 1,763 | python | en | code | 0 | github-code | 1 |
70888291875 | # -*- coding: utf-8 -*-
# ํ์ฌ ๊ณต์ฅ์ ๋จ์์๋ ๋ฐ๊ฐ๋ฃจ ์๋ stock, ๋ฐ๊ฐ๋ฃจ ๊ณต๊ธ ์ผ์ (dates)๊ณผ ํด๋น ์์ ์ ๊ณต๊ธ ๊ฐ๋ฅํ ๋ฐ๊ฐ๋ฃจ ์๋(supplies)
# k ์ผ ์ ๊น์ง ๊ณต๊ธ์ ๋ฐ๋ ํ์์ ์ต์ ๊ฐ์ ๋ฐํ
# ํ๋ฃจ์ ๋ฐ๊ฐ๋ฃจ 1ํค์ฉ ์ฌ, k-1์ ์ฌ์ฉํ ์๋ ๊น์ง๋ง ํ๋ณดํ๋ฉด ๋๋ค.
# ์๋ฅผ๋ค์ด ํ์ฌ 4๊ฐ ๋จ์์๋ค๋ฉด ์ค๋, 1์ผํ, 2์ผ, 3์ผํ ๊น์ง๋ง ์ฌ์ฉํ ์ ์๋ค. 4 ์ผ์งธ์ ๊ณต๊ธ ๋ฐ์์ผ ํ๋ค.
import heapq
def solution(stock, dates, supplies, k):
answer = 0
index... | rhkddud3917/Algorithm-Practice | Programmers/level2/ํ๋ก๊ทธ๋๋จธ์ค-level2-๋ผ๋ฉด๊ณต์ฅ.py | ํ๋ก๊ทธ๋๋จธ์ค-level2-๋ผ๋ฉด๊ณต์ฅ.py | py | 1,258 | python | ko | code | 0 | github-code | 1 |
2481003217 | import numpy as np
import pandas as pd
import networkx as nx
import sys
def main(argv):
if len(argv) != 1:
raise ValueError("Must pass in graph representation input")
df = pd.read_csv(argv[0], sep="\t")
assert len(df.index) > 0
DEBUG = False
G = nx.from_pandas_edgelist(
df,
"... | FelixHohne/cuda_shortest_paths | src/correct.py | correct.py | py | 1,032 | python | en | code | 2 | github-code | 1 |
38247937244 |
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
import gif
import matplotlib.animation as animation
train = np.loadtxt('data/click.csv', delimiter=',', dtype='int', skiprows=1)
train_x = train[:, 0]
train_y = train[:, 1]
mu = train_x.mean()
sigma = train_x.std()
# zscore... | Achuan-2/machine_learning_record | 01_regression/regression1_linear.py | regression1_linear.py | py | 3,310 | python | zh | code | 2 | github-code | 1 |
7882380648 | def checkio(numbers_array: tuple) -> list:
A = list(numbers_array)
for i in range(1, len(A)):
for j in range(0, len(A)-i):
if abs(A[j]) > abs(A[j+1]):
A[j], A[j+1] = A[j+1], A[j]
return A
#comment
#These "asserts" using only for self-checking and not necessary for auto-te... | leff9f/pytest | Python/Checkio solves/Absolute storing.py | Absolute storing.py | py | 879 | python | en | code | 1 | github-code | 1 |
40061142597 | # ํ ํฉ์น๊ธฐ: ๋ ํ์ ํฉ์น๋ ์ฐ์ฐ
# ๊ฐ์ ํ ์ฌ๋ถ ํ์ธ: ํน์ ํ ๋ ํ์์ด ๊ฐ์ ํ์ ์ํ๋์ง ํ์ธํ๋ ์ฐ์ฐ
## case 1: find, union ํ์ฉ
def find_parent(x):
if team[x] != x:
team[x] = find_parent(team[x])
return team[x]
def union_parent(a, b):
a = find_parent(a)
b = find_parent(b)
if a < b:
team[b] = a
else:
team[a... | hyein99/Algorithm_python_for_coding_test | Part2/ch10_๊ทธ๋ํ ์ด๋ก /02_ํ ๊ฒฐ์ฑ.py | 02_ํ ๊ฒฐ์ฑ.py | py | 1,305 | python | en | code | 0 | github-code | 1 |
2229652486 | from sys import argv
from stenograpi import Stenograpi
from argparse import ArgumentParser
def parse_args(args):
parser = ArgumentParser(prog='stenograpi.py',
description='Document your HTTP API automatically through tests.')
parser.add_argument('hostname', type=str, help='hostname... | michaelmcmillan/Stenograpi | src/main.py | main.py | py | 849 | python | en | code | 0 | github-code | 1 |
11297389625 | """
Author: Emanuele Albini
Adapter from a counterfactual method to background generator.
"""
from typing import Union
import numpy as np
from ..base import (BaseBackgroundGenerator, BackgroundGenerator, CounterfactualMethod, MultipleCounterfactualMethod,
ListOf2DArrays)
from ..utils impo... | jpmorganchase/cf-shap | src/cfshap/background/counterfactual_adapter.py | counterfactual_adapter.py | py | 2,612 | python | en | code | 10 | github-code | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.