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
74738491234
"""Add multimention table Revision ID: 003 Revises: 002 Create Date: 2016-04-08 10:53:44.115348 """ # revision identifiers, used by Alembic. revision = '003' down_revision = '002' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated b...
belak/python-seabird
migrations/versions/003_add_multimention_table.py
003_add_multimention_table.py
py
859
python
en
code
0
github-code
1
17287527269
from fleet import Fleet from grid import Grid from playerai import PlayerAi from playerhuman import PlayerHuman WIDTH = 1024 HEIGHT = 768 TITLE = "Battleships" # Start of your grid (after labels) YOUR_GRID_START = (94,180) # Start of enemy grid ENEMY_GRID_START = (544,180) GRID_SIZE = (38,38) player = "player1setup...
Apress/beginning-game-programming-with-pygame-zero
Chapter 10/battleship2/battleship.py
battleship.py
py
6,368
python
en
code
11
github-code
1
20800064791
from selenium import webdriver from time import sleep import os from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from bs4 import BeautifulSoup import urllib.request import random import pandas as pd browser = webdriver.Chrome(executable_path="./chromedriver.exe") browser.m...
hongha0111/CS232_LAB1_Crawler_Text
crawl_image.py
crawl_image.py
py
1,789
python
en
code
0
github-code
1
10579008900
import logging import json from application.service import ClubService from flask import Blueprint from flask import request, Response from application.auth.google_auth import auth_required, get_token_info log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) # Variable declaration application_json = "appl...
SoamyaAgrawal17/SAVS
application/controller/ClubsController.py
ClubsController.py
py
3,734
python
en
code
0
github-code
1
19104388153
import unittest class TestDotfile(unittest.TestCase): def setUp(self): self.maxDiff = None def test_dotfile_consistency(self): # Drake's bindings/pydrake/.clang-format file should be a prologue atop # the root .clang-format file. with open(".clang-format") as f: ro...
GTLIDAR/safe-nav-locomotion
motion_planner/drake/bindings/pydrake/test/dot_clang_format_test.py
dot_clang_format_test.py
py
834
python
en
code
21
github-code
1
35596840111
# !/usr/bin/env python # coding=utf-8 """ author: yonas """ import argparse import torch import numpy as np from pathlib import Path from transformers import BertTokenizer, AutoTokenizer, RobertaTokenizer from datautils import NerExample, Any2Id, file2list import time, copy, os # import ipdb try: from prefetch_g...
Qznan/QizNER
data_reader.py
data_reader.py
py
22,118
python
en
code
2
github-code
1
27867302737
"""Prepare entry and gone transactions from comparing local hierarchy with proxy data.""" import datetime as dti import pathlib import random from typing import Union from kiertotie import ( BASE_URL, DASH, EASING, ENCODING, ESP, HTTP_404_BYTES_TOKEN, HTTP_404_BYTES_TOKEN_LENGTH, HTTP_4...
sthagen/kiertotie
kiertotie/update.py
update.py
py
10,067
python
en
code
3
github-code
1
18836706246
from django.shortcuts import render, redirect from .forms import CreateUserForm from .forms import ProduitForm from .forms import * from .models import * from django.contrib.auth.forms import UserCreationForm from django.contrib.auth import authenticate , login, logout from django.contrib import messages from django....
KOFFIHO/Ampoule-Rouge
blog/views.py
views.py
py
10,339
python
fr
code
0
github-code
1
39212060141
#import tensorflow as tf #import numpy as np #import pandas as pd #import networkx as nx #import matplotlib.pyplot as plt #from mpl_toolkits.mplot3d import Axes3D #from pathlib import Path #import random,math,sympy #import re,request #from turtle import * #import time,datetime #import argparse #F2:tree F3:tagbar F4:添加...
774799513/learngit
class/t_class.py
t_class.py
py
575
python
en
code
0
github-code
1
191426034
import numpy from chainer import cuda from chainer import function from chainer.utils import type_check class Accuracy(function.Function): def check_type_forward(self, in_types): type_check.expect(in_types.size() == 2) x_type, t_type = in_types type_check.expect( x_type.dtyp...
jem0101/BigSwag-SQA2022-AUBURN
TestOrchestrator4ML-main/resources/Data/supervised/GITLAB_REPOS/jamieoglindsey0@chainer/chainer/functions/accuracy.py
accuracy.py
py
1,320
python
en
code
2
github-code
1
71377801634
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Extended minimal pygimli example to simulate Darcy velocity, mass transport and time-lapse ERT measurements """ import numpy as np import pygimli as pg import pygimli.meshtools as mt import pygimli.physics.ert as ert import pygimli.physics.petro as petro # Cr...
gimli-org/gimli
doc/paper/cg17/example-2_modelling.py
example-2_modelling.py
py
4,992
python
en
code
312
github-code
1
70270731235
import unittest from executor.executor import tree, execute from executor.memscan import MemScan from executor.selection import Selection class TestSelection(unittest.TestCase): """ Test the selection plan node, which is effectively a filter operation. """ def test_select_various_predicates(self): ...
Bradfield/braddb
tests/unittests/test_selection.py
test_selection.py
py
887
python
en
code
6
github-code
1
43534691253
import requests from bs4 import BeautifulSoup import sys import re import numpy as np import sys import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) ## 找出表特版2017第一篇文的文章列表url (2017/12/31) def find_first_url(start_date, start_year, url): ''' input: start_date: 1/01 (str), ...
30stomercury/ptt_crawler
ptt_crawler.py
ptt_crawler.py
py
10,538
python
en
code
0
github-code
1
9557658847
import ssl import re import json import requests import csv import urllib3 import argparse import sys urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) STR_POST_SERVICE_TEMPLATE_OK = '[->] service %s for template %s was created with status code %s' STR_POST_SERVICE_TEMPLATE_NOK ...
versa-networks/devops
python/VOS Framework/object-create/service-create.py
service-create.py
py
5,606
python
en
code
6
github-code
1
37402723277
from warnings import warn from statsmodels.sandbox.distributions.extras import ACSkewT_gen from .check_nd_array_for_bad import check_nd_array_for_bad def fit_skew_t_pdf( _1d_array, fit_fixed_location=None, fit_fixed_scale=None, fit_initial_location=None, fit_initial_scale=None, ): _1d_array...
UCSD-CCAL/ccal
ccal/fit_skew_t_pdf.py
fit_skew_t_pdf.py
py
1,775
python
en
code
0
github-code
1
28919536409
import matplotlib.pyplot as plt f = open("biggest_cities.txt", "r") plt.plot([int(x.split(",")[3]) for x in f.readlines()][:15]) plt.ylabel("City size") plt.xlabel("City rank") plt.show() f.close()
nicholasz2510/zipf-from-text
just_list.py
just_list.py
py
201
python
en
code
0
github-code
1
8604083530
import math import numpy as np import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt from Model import Individual from Model import FitnessFunction import time from Model.PrintModule import PrintModule import multiprocessing import pygmo as pg import itertools from Model.DisplayHandler import Displ...
jurrutiag/Robotic-Manipulator
Model/GeneticAlgorithm.py
GeneticAlgorithm.py
py
31,658
python
en
code
0
github-code
1
70137787875
import asyncio class CommentExecutor: def __init__(self): self.work_queue = asyncio.Queue() async def add_video(self, new_vids): for vid in new_vids: await self.work_queue.put(vid) async def execute(self, task, num_workers=5): tasks = [asyncio.create_task(task(sel...
ZutrixPog/youtube-comments-extractor
comments/executor.py
executor.py
py
402
python
en
code
6
github-code
1
34214467939
import torch import torch.nn as nn import pdb import logging class rnn_net(nn.Module): def __init__(self, dim_embeddings, num_classes, similarity="inner_product", hidden_size=128, num_layers=1, rnn_dropout=0.2, clf_dropout=0.3, bidirectional=False): super(rnn_net, self).__init__() self...
hsinlichu/Customer-Service-Data-Analysis-with-Machine-Learning-Technique
src/modules/net.py
net.py
py
1,528
python
en
code
1
github-code
1
23551628136
# General references: # 0. https://github.com/lttkgp/youtube_title_parse # 1. https://tinyurl.com/y5pewlw3 # 2. https://developers.google.com/youtube/v3/getting-started # 3. https://developers.google.com/youtube/v3/quickstart/python # 4. https://github.com/TheComeUpCode/SpotifyGeneratePlaylist/blob/master/create_playli...
LongPhan1912/Youtube-Playlist-Extractor
main-extractor.py
main-extractor.py
py
9,415
python
en
code
0
github-code
1
17408789863
# https://www.codewars.com/kata/525c7c5ab6aecef16e0001a5 def parse_int(input): single_digit = {'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9} double_digit = {'ten': 10, 'eleven': 11, 'twelve': 12, 'thirteen': 13, 'fourteen': 14...
JanisGoldmanis/CodeWars
[4kyu] parseInt.py
[4kyu] parseInt.py
py
1,467
python
en
code
0
github-code
1
15305050980
# features.py import glob, os, sys, math, warnings, copy, time, glob, logging import numpy as np from scipy.optimize import linear_sum_assignment from scipy.spatial import distance import pandas as pd from scipy.stats import multivariate_normal from hmmlearn import hmm logging.basicConfig(format='%(asctime)s | %(level...
samshipengs/Coordinated-Multi-Agent-Imitation-Learning
code/hidden_role_learning.py
hidden_role_learning.py
py
7,125
python
en
code
37
github-code
1
86663640809
from django.urls import path,include,re_path from django.conf.urls import url from . views import * from . import views app_name="home" urlpatterns = [ path("", views.home, name="home"), path("projectadd", views.addproject, name="addproject"), path("projectadded", views.projectadded, name="projectadded")...
sourabh-art/ufaber
projects/urls.py
urls.py
py
901
python
en
code
1
github-code
1
12664985547
# given two strings str1 and str2, write a function that prints all interleavings # of the given two strings. # we may assume that all characters in both strings are different. # Example: Input :str1 = "AB", str2 = "C2" and output : ABCD ACBD CABD CADB CDAB. # An intterleaved string of given two # strings preserves the...
khanarslaan7861/private
Python/Infytq/interleaved.py
interleaved.py
py
861
python
en
code
1
github-code
1
33092721708
import solution class Solution(solution.Solution): def solve(self, test_input=None): source, target, allowedSwaps = test_input return self.minimumHammingDistance(list(source), list(target), [x[:] for x in allowedSwaps]) def minimumHammingDistance(self, source, target, allowedSwaps): "...
QuBenhao/LeetCode
problems/1722/solution.py
solution.py
py
2,350
python
en
code
8
github-code
1
73501756834
""" Author: Brian Mascitello Date: 12/15/2017 Websites: http://adventofcode.com/2017/day/14 Info: --- Day 14: Disk Defragmentation --- """ import copy from functools import reduce def construct_dense_hash(sparse_hash): constructed_hash = list() groups_of_sixteen = [sparse_hash[index:index +...
Brian-Mascitello/Advent-of-Code
Advent of Code 2017/Day 14 2017/Day14Q1 2017.py
Day14Q1 2017.py
py
3,327
python
en
code
0
github-code
1
16557291805
# https://www.acmicpc.net/problem/2529 # Solved Date: 20.05.02. import sys import itertools read = sys.stdin.readline def check_inequality(sign, ans_num, select_num): if (sign == '<' and ans_num < select_num) or \ (sign == '>' and ans_num > select_num): return True else: return F...
imn00133/algorithm
BaekJoonOnlineJudge/CodePlus/500BruteForce/PermutationPractice/baekjoon_2529.py
baekjoon_2529.py
py
2,251
python
en
code
0
github-code
1
24752099819
# -*- coding: utf-8 -*- import scrapy from scrapy.spiders import Spider from justiaspider.items import JustiaItem from scrapy import Request from time import sleep class ToScrapeSpiderXPath(scrapy.Spider): name = 'justia' headers = { 'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N...
oerdem19/justiaspider
spider/justiaspider/justiaspider/spiders/justia.py
justia.py
py
3,902
python
en
code
0
github-code
1
20648101318
#!/usr/bin/env python # coding: utf-8 # In[2]: import pandas as pd import numpy as np import matplotlib.pyplot as plt # In[3]: df=pd.read_csv(r"C:\Users\lenovo\Downloads\CarDataSet.csv") # In[4]: df # In[5]: df=df.drop('New_Price',axis=1) # In[6]: df=df.dropna() # In[7]: df # In[8]: df['Milea...
HardeshPratap/Used-car-sales-analysis
ML Project.py
ML Project.py
py
4,208
python
en
code
0
github-code
1
28410209117
from typing import Optional import unittest class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def isValidBSTHelper( self, root: Optional[TreeNode], min=float("-inf"), max=float("inf") ) -> ...
teimurjan/leetcode
is-valid-bst.py
is-valid-bst.py
py
1,783
python
en
code
0
github-code
1
32053631377
import csv import json import sys import traceback from bs4 import BeautifulSoup from time import sleep import os from get_restaurants_list import check_element_by_xpath, wait_to_display, load_restaurants, save_restaurants from utils import VERSION, log, launch_driver, save_file # 主方法 def get_restaurant_info(r): ...
djangommq/ifood
src_v0/get_restaurants_info.py
get_restaurants_info.py
py
12,563
python
en
code
0
github-code
1
31050124182
"""rank_text.py For a given document, process and prepare scoring. """ import pandas as pd import matplotlib.pyplot as plt import os import re from snownlp import SnowNLP from string import punctuation, whitespace from os import path class Snippet: def __init__(self, text, meta): # meta includes author, t...
jyesawtellrickson/mandarin
app/snippet.py
snippet.py
py
5,631
python
en
code
2
github-code
1
29039233511
import unittest import sys, os testdir = os.path.dirname(__file__) srcdir = '../yrevocnu' sys.path.insert(0, os.path.abspath(os.path.join(testdir, srcdir))) import yrevocnu as yre class GameTest(unittest.TestCase): def setUp(self): self.game = yre.Game() self.game.load_bounty_metadata(os.path.ab...
yrevocnu/infinite-score
tests/test_yrevocnu.py
test_yrevocnu.py
py
2,741
python
en
code
0
github-code
1
28545941316
import pandas as pd import sys import os import shutil # from threading import Thread """ Take text file showing damaged files and move them to folders by camera.""" # You can get a list of damaged .jpg files from running badpeggy, selecting # all, exporting to text file, putting it in folder with images to be clean...
plorch/CameraTrapImagePreprocessPython
CopyDamagedImagesToCameraFolders.py
CopyDamagedImagesToCameraFolders.py
py
2,506
python
en
code
1
github-code
1
18323419280
import itertools def combsum(thelist,serchednum): res = 0 for n in range(2,len(thelist),1): for eachcomb in itertools.combinations(thelist,n): if round(sum(eachcomb),2) == round(serchednum,2): res = eachcomb break # # ...
costiagur/comsum
combsum.py
combsum.py
py
429
python
en
code
0
github-code
1
24242037981
from random import randrange from sys import argv, exit def main(size, name): with open("{}".format(name), 'w') as file: for _ in range(size): _to_write = str(randrange(size)) + " " file.write(_to_write) print("Done") if __name__ == "__main__": if (len(argv) < 3) : print("Usage: {} ARRAY_SIZE FILE_NAME"...
Araggar/BucketSort-C
random_array.py
random_array.py
py
362
python
en
code
0
github-code
1
12496357516
import json from dataclasses import asdict from datetime import datetime from typing import List from unittest import mock import hypothesis import pytest from hypothesis.strategies import ( dictionaries, integers, just, lists, sampled_from, text, ) from pydantic import ConfigDict from pydantic...
NHSDigital/nrlf-converter
nrlf_converter/convert_nrl_to_r4/tests/test_nrl_to_r4.py
test_nrl_to_r4.py
py
7,324
python
en
code
0
github-code
1
70242278435
from node import Node, NodeContainer class ParentContainer(NodeContainer): def _set_content(self, content): """Sets content of the container. Note that the new content has to be a TreeNode. >>> node1, node2 = TreeNode(), TreeNode() >>> node2.parent._set_content(node1) >>>...
bebraw/pynu
pynu/tree.py
tree.py
py
2,240
python
en
code
2
github-code
1
933911592
import sys input = sys.stdin.readline N = int(input()) dp = [0 for _ in range(N+3)] arr = [0 for _ in range(N+3)] for k in range(1,N+1): arr[k] = int(input()) print(arr) dp[1] = arr[1] dp[2] = arr[1] + arr[2] dp[3] = max(arr[1] + arr[3] ,arr[2] + arr[3]) for i in range(4, N+1): dp[i] = max(dp[i-3] + arr[i-1]...
jjs0211/problem-solving-with-study
Baekjoon/Class03/2579_계단오르기.py
2579_계단오르기.py
py
644
python
ko
code
0
github-code
1
73510344352
from argparse import ArgumentParser from Common.HttpFileManager.webApplication import app as application def parse_args(): parser = ArgumentParser() parser.add_argument( "-i", "--hostname", dest="HOSTNAME", default='localhost', help="ip of server host.") parser.add_argument( "-p", "--port", dest="PORT", def...
msm3858/Bottle
Common/HttpFileManager/httpFileManager.py
httpFileManager.py
py
523
python
en
code
0
github-code
1
8087151518
import os from .forms import PostForm, EditProfileAdminForm, CommentForm from sqlalchemy.exc import IntegrityError from . import main from .. import db from ..models import User, Role, Post, Permission, Comment from flask import render_template ,redirect, url_for, request, current_app, jsonify, flash, abort, make_respo...
manyrices/look
app/main/views.py
views.py
py
10,249
python
en
code
0
github-code
1
8595389362
import re def check_byr(inputString): intValue = int(inputString) return intValue >= 1920 and intValue <=2002 def check_iyr(inputString): intValue = int(inputString) return intValue >= 2010 and intValue <=2020 def check_eyr(inputString): intValue = int(inputString) return intValue >= 2020 and...
JibblyC/AdventOfCode2020
AOC_Q4/AOC_Q4_P2_Helper.py
AOC_Q4_P2_Helper.py
py
2,145
python
en
code
0
github-code
1
32043715950
#For Google Collab #try: # # %tensorflow_version only exists in Colab. # %tensorflow_version 2.x #except Exception: # pass # Program gave an error trying to load the MNIST data # This fix was found at: https://github.com/tensorflow/tensorflow/issues/33285 import ssl try: _create_unverified_https_context = ssl...
JacobCuke/machine-learning-assignment
Part 1/MNISTStarter.py
MNISTStarter.py
py
1,640
python
en
code
0
github-code
1
37157061629
import pygame import ui import art import utilities class Inventory(object): def __init__(self): self.items = {"Weapon": [], "Armor": [], "Commodity": [], "Misc": []} def add_item(self, item_to_add): category = item_to_add.item...
z-van-baars/embark
inventory.py
inventory.py
py
17,855
python
en
code
0
github-code
1
41054476106
""" Unit tests for config_rules.py. """ import boto3 from botocore.exceptions import ClientError import pytest from config_rules import ConfigWrapper @pytest.mark.parametrize("error_code", [None, "TestException"]) def test_put_config_rule(make_stubber, error_code): config_client = boto3.client("config") con...
awsdocs/aws-doc-sdk-examples
python/example_code/config/test/test_config_rules.py
test_config_rules.py
py
2,567
python
en
code
8,378
github-code
1
11616512317
import numpy as np import pandas as pd import math dataset=pd.read_csv('Dataset1.csv') row_index=input("please enter the index number you want to choose as test point") row_index=int(row_index) target=dataset.loc[row_index][1:6] def gaussian_kernel(x, x0, c, a=1.0): x=np.mat(x) diff = x - x0 dot_product ...
vishwajeetk1160/LocallyWeightedLinearRegression
Locally_weighted_regression.py
Locally_weighted_regression.py
py
1,752
python
en
code
0
github-code
1
69905459873
"""Support for myUplink sensors.""" from __future__ import annotations import logging from homeassistant.components.number import ( NumberEntity, NumberDeviceClass, ) from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform im...
jaroschek/home-assistant-myuplink
custom_components/myuplink/number.py
number.py
py
2,209
python
en
code
11
github-code
1
15702759585
import collections tasks = collections.OrderedDict() tasks[8031] = "Backup" tasks[4027] = "Scan email" tasks[5733] = "Build system" tasks[8031] = "Denni zaloha" print(list(tasks.keys())) unsorted = dict() unsorted[8031] = "Backup" unsorted[4027] = "Scan email" unsorted[5733] = "Build system" unsorted[8031] = "Denni za...
zabojnikp/study
Python_Projects/python3_selfstudy/lekce_3/usporadany_slovnik.py
usporadany_slovnik.py
py
355
python
en
code
0
github-code
1
24061391126
from openpyxl.worksheet.worksheet import Worksheet from utilities import format_cell, get_named_value class Table: class Item: pass def __init__(self, sheet: Worksheet, table_name: str) -> None: self.sheet = sheet self.columns, self.items = Table.read_excel_table(self.sheet, table_na...
flolbr/InvoiceGenerator
table.py
table.py
py
1,662
python
en
code
0
github-code
1
39998651204
import copy from links import Links from distance import distance from ROOT import TVector3 def merge_clusters(elements, layer): merged = [] elem_in_layer = [] elem_other = [] for elem in elements: if elem.layer == layer: elem_in_layer.append(elem) else: elem_ot...
cbernet/heppy
heppy/papas/pfalgo/merger.py
merger.py
py
828
python
en
code
9
github-code
1
12839162951
#!/usr/bin/env python # coding: utf-8 # <a href="https://colab.research.google.com/github/pratikunterwegs/elemove/blob/master/temp_kruger.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # In[ ]: import subprocess try: import geemap except Im...
pratikunterwegs/elemove
python/02_get_landsat_data.py
02_get_landsat_data.py
py
2,842
python
en
code
8
github-code
1
30453705281
#! /usr/bin/env python #! -*- coding: utf-8 -*- import sqlite3, copy, datetime from pathlib import Path root_path = '../databases' dbfile = 'call_calibrations.db' agentdb = Path(root_path,dbfile) def get_details(func): def wrapper(_search_name): con = sqlite3.connect(agentdb) with con: ...
alan1world/call_calibrations
call_calibrations/test.py
test.py
py
2,880
python
en
code
0
github-code
1
15708526773
def get_vowel_frequency(corpus): """ Returns a list of frequency percentages for a corpus's vowels. :param corpus: Any valid Python string :return: List of frequency percentages """ num_a = 0 num_e = 0 num_i = 0 num_o = 0 num_u = 0 temp = "" for x in range(len(corpus)): ...
casuallysentient/lab_07
vowel_frequency.py
vowel_frequency.py
py
1,529
python
en
code
0
github-code
1
32935036695
import email.utils import smtplib from email.mime.application import MIMEApplication from tkinter import messagebox from string import Template from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from time import sleep import os import csv import configparser """ autor: Pedrozo Juan Mar...
FZMartin/mailing_app
common_services.py
common_services.py
py
8,609
python
en
code
0
github-code
1
15696919512
import pandas as pd from Base.common import rename_header import seaborn as sns import numpy as np from StatisticalTests.Column_Converter import * from matplotlib import pyplot as plt def get_stats(dataframe, column1, column2, percentage=False, dump=False, only_max=False): table = pd.crosstab(dataframe[column1], ...
partha117/A-Comparative-Study-of-Software-Development-Practices-in-the-Context-of-an-Emerging-Country
Scripts/StatisticalTests/Gender_VS_All_STATS.py
Gender_VS_All_STATS.py
py
5,115
python
en
code
0
github-code
1
36191816908
from aiohttp import web from chessviz import main async def handle(request): gid = request.match_info.get("gid") ans = main(gid) return web.Response(body=ans, content_type="image/svg+xml") async def make_app(): app = web.Application(client_max_size=10 * 1024**2) app.add_routes([web.get("/{gid}"...
louisabraham/chessviz
api.py
api.py
py
418
python
en
code
1
github-code
1
15252733263
import os import sys import random from os.path import dirname, basename, isfile import glob import inspect import re import copy import numpy as np from collections import deque, defaultdict from string import Formatter import generatorUtils as gu CUR_DIR = os.path.dirname(__file__) CODEORG_DIR = os.path.join(CUR_D...
malik-ali/generative-grading
src/rubricsampling/engine.py
engine.py
py
8,838
python
en
code
5
github-code
1
13763204850
# [백준]1904번-동적계획법-01타일-S3 # https://github.com/irishNoah/Algorithm-Study # https://www.acmicpc.net/problem/1904 ''' 00인 타일을 'X'로, 1인 타일을 'Y'로 치환해서 N이 1~6일 때의 경우의 수를 각각 구하다보면 N이 증가할 때마다 발생할 수 있는 경우의 수가 피보나치 수열을 형성한다는 것을 파악할 수 있다. ''' def tile(n): if n == 1: return tableFib[1] for cnt in range(2, n...
irishNoah/Algorithm-Study
알고리즘/파이썬(Python)/002-동적계획법(DP)/002-[백준]1904번-동적계획법-01타일-S3.py
002-[백준]1904번-동적계획법-01타일-S3.py
py
1,799
python
ko
code
4
github-code
1
29756061947
import scipy.special as spe import numpy as np from bessel import rj,rh,d_rh, d_rj ################################################################################## ### Script for the caclulation of coefficient for the internal field ### ####################################################################...
GabrielGaugain/MiePyScatt
coeff_int.py
coeff_int.py
py
1,658
python
en
code
0
github-code
1
7388324669
import sys dp={} def minCoins(coins, m, V): if V==0: return 0 if V<0: return 999999 res=999999 if V in dp: return dp[V] for i in range(m): if V>=coins[i]: if (V-coins[i]) in dp: a=dp[V-coins[i]] else: a=minCoins(...
parvatalaprasanth/Practice-Python
minimum_coins.py
minimum_coins.py
py
592
python
en
code
0
github-code
1
26562189978
USER_TYPE_CHOICE = ( ("COACH", "Mentor"), ("STUDENT", "Mentee"), ) GENDER_TYPE_CHOICES = ( ("MALE", "Male"), ("FEMALE", "Female"), ("OTHER","Other"), ) ETHNICITY_TYPE_CHOICES = ( ("BRITISH", "British"), ("OTHER", "Other"), ) LANGUAGE_TYPE_CHOICE = ( ...
bijay-shres123/mentor_matching
backend/profiles_api/choices.py
choices.py
py
1,522
python
en
code
0
github-code
1
70405322913
def solution(N): # write your code in Python 3.6 binary = bin(N).replace("0b", "") gap = [] lis = [int(s) for s in binary] # import pdb;pdb.set_trace() for i in range(0,len(lis)): if lis[i] == 0: continue elif lis[i] == 1: if i == len(lis) -1: ...
git-lijo/codility-python
binarygap.py
binarygap.py
py
892
python
en
code
0
github-code
1
25877808240
''' @author: jmc ''' from setuptools import setup, find_packages version = '1.3.0' setup( name='odn-ckancommons', version=version, description=""" CKAN's commons for development of ODN related extensions """, long_description=""" """, classifiers=[], # Get strings from http://pypi.pyth...
OpenDataNode/odn-ckancommons
setup.py
setup.py
py
657
python
en
code
0
github-code
1
14913214995
#!/usr/bin/env python """Distutils setup file""" import ez_setup ez_setup.use_setuptools() from setuptools import setup # Metadata PACKAGE_NAME = "BytecodeAssembler" PACKAGE_VERSION = "0.6.1" PACKAGES = ['peak', 'peak.util'] def get_description(): # Get our long description from the documentation f = open('RE...
PEAK-Legacy/BytecodeAssembler
setup.py
setup.py
py
1,176
python
en
code
1
github-code
1
8523668579
import pickle from pathlib import Path import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as ptc from nicpy import nic_misc, nic_pic import a_star from geometry import Square, SquareGrid def algo_animation(history_directory, fps=2, frame_skip=1): matplotlib.use('Agg') # Gets rid of p...
niceholgate/pathfinding
py_pathfinding/plotting.py
plotting.py
py
4,143
python
en
code
0
github-code
1
72108183075
from mininet.topo import Topo from mininet.net import Mininet from mininet.log import setLogLevel, info from mininet.link import TCLink from mininet.node import RemoteController from mininet.node import Node from mininet.cli import CLI import os import sys num = int(sys.argv[1]) class Topo(Topo): Hs = [] Ss ...
EnvyusKennys/tele4642
project/topo2.py
topo2.py
py
2,264
python
en
code
0
github-code
1
22020730306
from . import app from .models import Survey from flask import url_for, session, request from twilio.twiml.messaging_response import MessagingResponse from sms_app.send_sms import client from sms_app.scan_email import survey_prompt, welcome_message import datetime @app.route('/message') def sms_survey(): response ...
picsul/short-message-survey
sms_app/survey_view.py
survey_view.py
py
2,680
python
en
code
1
github-code
1
42152321690
"""Defines functions for standard shell operations that are common on Unix but are not readily available on Windows in a cross platform way; this is intended to replace shutil which is less usable for copying and removing trees.""" import cx_Logging import os import stat import sys def CopyFile(source, targe...
anthony-tuininga/cx_PyGenLib
cx_ShellUtils.py
cx_ShellUtils.py
py
2,734
python
en
code
3
github-code
1
24605712534
from HoG_SVM_SlidingWindow import * from define_parameter_dict import params_dict from moviepy.editor import VideoFileClip import numpy as np with open(params_dict['svm_pickel_file_for_video'],'rb') as fp: [cl_svm_vid, std_scaler_vid] = pickle.load(fp) scale_list = params_dict['detection_scales'] consecutive_appea...
skbhat/SDC-P5
process_video.py
process_video.py
py
2,857
python
en
code
0
github-code
1
13969667729
import sys #sys.stdin = open("in1.txt","r") grid = list(list(map(int,input().strip().split())) for _ in range(9)) t = {1,2,3,4,5,6,7,8,9} result = True def test(grid): #행 / 열끼리 비교 for i in range(9): ch1 = [0]*9 ch2 = [0]*9 for j in range( 9): ...
mateo0604/Inflearn_algorithme
섹션 3/10. 스도쿠 검사/AA.py
AA.py
py
850
python
en
code
0
github-code
1
18994907838
from collections import defaultdict try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest _NONE_TYPE = type(None) _EMPTY_TYPE = type('', (object,), {}) _MIXED_TYPE = type('<mixed-type>', (object,), {}) class AttrDict(dict): """A dict with keys access...
agroce/cs562w16
projects/xujing/hw4&5/examine.py
examine.py
py
8,372
python
en
code
2
github-code
1
35987328488
import aiohttp from furl import furl from typing import Optional class PapaJohnsClient: def __init__(self, url: str, city_id: int, restaurant_id: int): self.base_url = url self.city_id = city_id self.restaurant_id = restaurant_id @staticmethod async def _query( url: furl, ...
Fisab/foodtech_clients
foodtech_clients/papa_johns.py
papa_johns.py
py
2,361
python
en
code
0
github-code
1
29893442836
import datetime from django.conf import settings from django.utils.timezone import now from celery import shared_task from monascaclient import client as monasca_client from decouple import config from core.conf import conf_file from nova.models import Hypervisors, Servers monasca = monasca_client.Client( api_ver...
whasley/lsd-billing
monasca/tasks.py
tasks.py
py
4,939
python
en
code
0
github-code
1
24666498556
from django.shortcuts import render from .models import * from django.http import HttpResponse # Create your views here. def parent_views(request): return render(request, 'parent.html') def child_views(request): return render(request, 'child.html') def add_author_views(request): obj = Author(name='jianai...
smakerm/list
pyweb/django/my_project/day4/index/views.py
views.py
py
2,825
python
en
code
0
github-code
1
33051190896
""" PyCSP3 Model (see pycsp.org) Data can come: - either directly from a JSON file - or from an intermediate parser Examples: python Nonogram.py -data=Nonogram_example.json python Nonogram.py -data=Nonogram_example.json -variant=table python Nonogram.py -data=Nonogram_example.txt -dataparser=Nonogram_Parser.p...
csplib/csplib
Problems/prob012/models/Nonogram.py
Nonogram.py
py
2,617
python
en
code
79
github-code
1
14891452818
from rest_framework import serializers from django_redis import get_redis_connection from redis.exceptions import RedisError import logging logger = logging.getLogger('django') class CheckImageCodeSerializer(serializers.Serializer): """ 图片验证码校验序列化器 """ image_code_id = serializers.UUIDField() text...
potatoxinxin/store
meiduo_mall/meiduo_mall/apps/verifications/serializers.py
serializers.py
py
1,970
python
zh
code
0
github-code
1
42994859188
import re NUM_OR_DOT_REGEX = re.compile(r"^[0-9.]$") CODECS = ( ("MP4", "libx264"), ("WEBM", "libvpx"), ("MOV", "mov"), ("MPEG-1", "mpeg1video"), ("MPEG-2", "mpeg2video"), ("MPG", "mpeg2video"), ("MPEGPS", "mpeg2video"), ("MPEG4", "mpeg4"), ("AVI", "msmpeg4"), ("WMV", "wmv2"), ...
edududs/video_converter
PySide_6/utils.py
utils.py
py
1,743
python
en
code
0
github-code
1
72660230113
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
edersonbrilhante/coleta-assinaturas
contador/migrations/0001_initial.py
0001_initial.py
py
3,169
python
en
code
0
github-code
1
4554888307
def open_file(file_name): ''' Opens file ''' try: file_object = open(file_name, "r") return file_object except FileNotFoundError: print("File", file_name, "not found") def read_file_parts(file_object): ''' Reads and processes grade parts from file 1 ''' list_of_parts = [] ...
arnoringi/forritun
Skilaverkefni/course_grades.py
course_grades.py
py
4,099
python
en
code
0
github-code
1
70983035873
# data_loader.py import os import torch import numpy as np from torchvision import datasets, transforms from torch.utils.data import DataLoader, Subset def load_and_split_dataset(num_classes, num_clients, alpha, non_iid=False): transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5,), (0....
Twinte/FedAVG_with_Entropy_Selection
data_loader.py
data_loader.py
py
2,567
python
en
code
0
github-code
1
25478464200
BACKGROUND_COLOR = (0, 0, 0) # Colors.black DATETIME_FORMAT = "%Y%m%d_%H%M%S_%f" DEFAULT_IMAGE_SIZE = (1080, 1080) IMAGE_DIRECTORY_NAME = 'files' IMAGE_FORMAT_COLOR_MODE = 'RGB' IMAGE_FORMAT = 'jpeg' IMAGE_EXTENSION = 'jpeg' # Video settings BITRATE = 3000 FRAMES_PER_SECOND = 30 VIDEO_EXTENSION = 'mp4' VIDEO_CODEC =...
josvromans/python_shapes
settings.py
settings.py
py
362
python
en
code
7
github-code
1
74374471392
import subprocess import json def cacheMissHit(): try: api = json.loads(subprocess.check_output("varnishstat --json", shell=True, text=True)) except: return {"cacheHits": 0, "cacheMiss": 0, "hitRatio": 0, "backendFetches": 0, "backendFailures": 0, "backendFailRatio": 0} hit = api["counters"...
trentwiles/BARTAPI
varnishStat.py
varnishStat.py
py
1,413
python
en
code
1
github-code
1
26520589208
#Escribe un programa que pida dos números y que conteste cuál es el menor y #cuál el mayor o que escriba que son iguales. n1= int(input("Da el primer numero: ")) n2= int(input("Da el segundo numero: ")) if n1>n2: print("Mayor: ",n1, "Menor: ", n2) elif n1<n2: print("Mayor: ",n2, "Menor: ", n1) else...
JUANPABLO99YYDUS/18460609-Ejercicios-Python
Ejercicios-02/Condiciones-03.py
Condiciones-03.py
py
360
python
es
code
0
github-code
1
11481832162
from zope.interface import Attribute, Interface from zope.interface.interfaces import IObjectEvent from zope.lifecycleevent import IObjectCreatedEvent from zope.schema import ASCIILine, Bool, Choice, Dict, Field, Object, Text, TextLine, Tuple, URI from pyams_form.interfaces import DISPLAY_MODE, IContentProviders, IFie...
Py-AMS/pyams-form
src/pyams_form/interfaces/form.py
form.py
py
13,055
python
en
code
0
github-code
1
26904398226
import sys from collections import deque input = sys.stdin.readline n = int(input()) lst = [] for _ in range(n): lst.append(list(input().strip())) visited = [] count = 0 dx = [1, -1, 0, 0] dy = [0, 0, 1, -1] for i in range(n): for j in range(n): if (i, j) not in visited and lst[i][j] != '0': ...
habaekk/Algorithm
boj/2667.py
2667.py
py
1,423
python
en
code
0
github-code
1
25271406830
import numpy as np FIGURE_STYLE = {"rows": 720, "cols": 1280, "fontsize": 1.0} AX_SPAN = [0.2, 0.2, 0.75, 0.75] AX_SPAN_WITH_COLORBAR_PAYLOAD = [0.2, 0.2, 0.55, 0.75] AX_SPAN_WITH_COLORBAR_COLORBAR = [0.8, 0.2, 0.025, 0.75] SOURCES = { "diffuse": { "label": "area $\\times$ solid angle", "unit": "...
cherenkov-plenoscope/starter_kit
plenoirf/plenoirf/summary/figure.py
figure.py
py
3,004
python
en
code
0
github-code
1
44612251281
from poly.polygon import Polygon from poly.point import Point from poly.util import value,computeAngleSign from math import degrees, acos, sqrt """ Implement Convex Polygon Intersection algorithm [O'Rourke, Chien, Olson, Naddor, 1982] https://pdfs.semanticscholar.org/3a68/0593c409eb0d86a9c436113581df970554ba.pdf No...
heineman/python-polygon-intersection
Polygon/poly/convex_intersect.py
convex_intersect.py
py
5,006
python
en
code
15
github-code
1
8543674282
# -*- coding: UTF-8 -*- """ @Project : leetcode @File : 17-迭代构造二叉树.py @IDE : PyCharm @Author : Peter @Date : 06/12/2021 11:52 @Brief : 使用前序和中序遍历结构构造二叉树 """ from typing import List class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left ...
JinkaiGUAN/Python-Office
1-DataStructure/leetcode/17-迭代构造二叉树.py
17-迭代构造二叉树.py
py
1,446
python
en
code
0
github-code
1
21457893362
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys options = webdriver.ChromeOptions() options.add_experimental_option("detach", True) driver = webdriver.Chrome(options=options) url = "https://www.wikipedia.org/" driver.get(url) search_bar = driv...
Know-Thyself/python-exercises
web_scraping/selenium-driver/interacting.py
interacting.py
py
744
python
en
code
0
github-code
1
11324370328
from __future__ import annotations from typing import List, TYPE_CHECKING, Optional from . import utils from .asset import Asset from .flags import ApplicationFlags from .permissions import Permissions if TYPE_CHECKING: from .guild import Guild from .types.appinfo import ( AppInfo as AppInfoPayload, ...
Rapptz/discord.py
discord/appinfo.py
appinfo.py
py
11,623
python
en
code
13,719
github-code
1
3686994958
import json colnames = ['cylinders','mpg']; editable_vars = ['numchar','nature']; preprocess_json = { "$schema":"http://(link to eventual schema)/jsonschema/1-0-0#", "self":{ "description":"TwoRavens metadata generated by ....", "created":"..time stamp.....
TwoRavens/raven-metadata-service
preprocess/raven_preprocess/tests/test_data/sampleTest.py
sampleTest.py
py
6,988
python
en
code
0
github-code
1
43512977578
''' 347. 前 K 个高频元素 给定一个非空的整数数组,返回其中出现频率前 k 高的元素。 示例 1: 输入: nums = [1,1,1,2,2,3], k = 2 输出: [1,2] 示例 2: 输入: nums = [1], k = 1 输出: [1] 说明: 你可以假设给定的 k 总是合理的,且 1 ≤ k ≤ 数组中不相同的元素的个数。 你的算法的时间复杂度必须优于 O(n log n) , n 是数组的大小。 ''' from collections import Counter import heapq class...
km1994/leetcode
topic10_queue/T347_topKFrequent/interview.py
interview.py
py
1,036
python
zh
code
24
github-code
1
43687386238
# -*- coding: utf-8 -*- from PyQt4 import QtGui from modules.classes.custom.QTableWidgetItem import QCustomTableWidgetItem as QCI def setItemArmEvEsChtbGcscGcsmCscfsCspSpdQty(form, itemIndex, dataPropertiesImplicitExplicitLinesList, typeName): if dataPropertiesImplicitExplicitLinesList: temp = dataProperti...
Doberm4n/POEStashJsonViewer
modules/items/armEvEsChtbGcscGcsmCscfsCspSpdQty.py
armEvEsChtbGcscGcsmCscfsCspSpdQty.py
py
4,057
python
en
code
0
github-code
1
29107903755
n = int(input("Enter number of values : ")) a_dict = {} for i in range(n): text = input().split() a_dict[text[0]] = int(text[1]) def removeDuplicates(a_dict): b_dict = {} n = 0 m = 0 first = 0 for key1 in a_dict: if first == 0: b_dict[key1] = a_dict[key1] ...
georgaras753/Lab1_Exercises
Lab1_Exercise2.py
Lab1_Exercise2.py
py
980
python
en
code
0
github-code
1
25985233479
# -*-coding:utf-8 -* """ 基于dqn的agent """ import numpy as np import random from agent import Agent import sys sys.path.append(sys.path[0].replace("agent","")) from config import args from policy_learning import DQN_dis class AgentDQN(Agent): def __init__(self, slot_set, disease_set, disease_symptom): super(...
Ccccandy/20211208
model3/agent/agent_dqn.py
agent_dqn.py
py
3,355
python
en
code
0
github-code
1
22062675299
# -*- coding: utf-8 -*- """ Project: Psychophysics_exps Creator: Miao Create time: 2020-12-20 21:07 IDE: PyCharm Introduction: preprocessed data of crowding and numerosity exp3a (online pilot) """ from src.analysis.exp3a_pilot_analysis import insert_is_resp_ref_more, insert_probeN, insert_refN, insert_probeCrowding, \ ...
miaoli-psy/numerosity_exps
src/preprocess/preprocess_exp3a_pilot.py
preprocess_exp3a_pilot.py
py
3,061
python
en
code
0
github-code
1
4175644136
import rclpy import time import datetime import numpy as np from rclpy.node import Node from sensor_msgs.msg import Imu, BatteryState from sensor_msgs.msg import LaserScan from rclpy.qos import qos_profile_sensor_data class SensorsSubscriber(Node): def __init__(self): super().__init__('sensors_subscriber') s...
PatchouliPatch/robots
topics/sensor_topics/sensor_topics/sensors.py
sensors.py
py
3,920
python
en
code
0
github-code
1
373802572
import copy import warnings from typing import Optional, Tuple from vyper import ast as vy_ast from vyper.lll import compile_lll, optimizer from vyper.old_codegen import parser from vyper.old_codegen.global_context import GlobalContext from vyper.semantics import set_data_positions, validate_semantics from vyper.typin...
webanck/GigaVoxels
lib/python3.8/site-packages/vyper/compiler/phases.py
phases.py
py
9,003
python
en
code
23
github-code
1
6248797453
import numpy as np import networkx as nx import random import timeit import gym import matplotlib.pyplot as plt from utils import get_node_values from utils import interventional_selection env = gym.make('Taxi-v3') n_actions = env.action_space.n n_states = env.observation_space.n qtable = np.zeros((n_states,n_actions...
atagade/Causal-RL
taxi_causal_greedy.py
taxi_causal_greedy.py
py
2,081
python
en
code
0
github-code
1
16921762500
from random import randint, shuffle import discord import modules.math.strmath as strmath import modules.math.wolfram as wolfram import modules.math.latex as latex from command import command from util import client, theme_color, error_color from logger import log # import urllib.parse @command('math') async def ...
ComedicChimera/Null-Discord-Bot
modules/math/commands.py
commands.py
py
2,980
python
en
code
0
github-code
1