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
953022142
pkgname = "libqmi" pkgver = "1.34.0" pkgrel = 0 build_style = "meson" configure_args = [ "-Dqrtr=true", "-Dintrospection=true", ] hostmakedepends = [ "bash-completion", "glib-devel", "gobject-introspection", "help2man", "libgudev-devel", "libmbim-devel", "libqrtr-glib-devel", "me...
chimera-linux/cports
main/libqmi/template.py
template.py
py
869
python
en
code
119
github-code
36
37219887215
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('community', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='usergiallorosso', ...
vaquer/ilGiallorosso
ilGiallorosso/community/migrations/0002_auto_20151127_1820.py
0002_auto_20151127_1820.py
py
434
python
en
code
0
github-code
36
24060886042
date = "Monday 2019-03-18" time = "10:05:34 AM" average_astronaut_mass_kg = 80.7 fuel_mass_kg = 760000 ship_mass_kg = 74842.31 fuel_level = "100%" num_astronauts_in_crew = int(input("Enter number of astronauts in crew: ")) crew_status = input("Enter crew status, Ready or Not Ready: ") total_mass_of_crew = num_a...
SheaCooke/Python_Chapter4_Studio
Chapter4_Studio.py
Chapter4_Studio.py
py
876
python
en
code
0
github-code
36
4078600392
class Solution: def average(self,A,B,start,end): sum = 0 for i in range(start, end): sum += A[i] return sum/B def solve1(self, A, B): least_avg = 999999999 min_idx = 0 for i in range(len(A)-B+1): j = i+B temp = self.average...
VishalDeoPrasad/InterviewBit
01. Arrays/Subarray with least average.py
Subarray with least average.py
py
1,586
python
en
code
1
github-code
36
22501232171
""" Module to implement Views for all API Queries""" from rest_framework.views import APIView from rest_framework.authentication import TokenAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.authtoken.models import Token from rest_framework import serializers from rest_framework...
karthik-d/room-slot-booking
roomBookingManager/api/views.py
views.py
py
22,909
python
en
code
4
github-code
36
2884245779
# coding:utf-8 # @Time : 2019-04-28 11:13 # @Author: Xiawang from utils.util import delete_requests, get_app_header host = 'https://gate.lagou.com/v1/entry' header = get_app_header(100018934) def delete_orderId(orderIds): url = host + '/order/orderId?orderIds={orderIds}'.format(orderIds=orderIds) remark = '...
Ariaxie-1985/aria
api_script/entry/order/orderId.py
orderId.py
py
391
python
en
code
0
github-code
36
16830841390
#!/usr/bin/env python # coding: utf-8 # # Random forest DMS # # This script runs the random forest model on the data from the differences in fitness effects: deltaS_weak (S_weak - S_opt) import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.linear_model import La...
Landrylab/DfrB1_DMS_2022
Scripts/Random_forest/Random_forest_DfrB1_DMS.py
Random_forest_DfrB1_DMS.py
py
10,422
python
en
code
0
github-code
36
16185502227
import os from sanic import Sanic from sanic_session import Session, AIORedisSessionInterface from ..config import config, log_config from ..container import Container from ..adapter.blueprint import handle_exception, message_blueprint,\ post_blueprint, file_blueprint, user_blueprint os.makedirs(config['DATA_PAT...
jaggerwang/sanic-in-practice
weiguan/api/app.py
app.py
py
1,296
python
en
code
42
github-code
36
43361270196
from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import IsAuthenticated from rest_framework.request import Request from rest_framework.response import Response from django.shortcuts import get_object_or_404 from api.utils import paginate from message.models import Mess...
Hosea2003/meet-alumni-back
message/views.py
views.py
py
2,371
python
en
code
2
github-code
36
8755135805
# -*- coding: utf-8 -*- import logging from odoo import models, fields, api, _ from odoo.exceptions import UserError, ValidationError from odoo.tools.safe_eval import safe_eval _logger = logging.getLogger(__name__) class DeliveryCarrier(models.Model): _inherit = 'delivery.carrier' of_use_sale = fields.Boo...
odof/openfire
of_delivery/models/delivery_carrier.py
delivery_carrier.py
py
3,214
python
en
code
3
github-code
36
34108670875
A = [int(i) for i in open('17-4.txt')] print(A) count = 0 mini = 10001 for i in A: if (i % 31 == 0 or i % 47 == 0 or i % 53 == 0) and (i % 3 == i % 5): count += 1 if i < mini: mini = i print(count, mini)
alex3287/ege
lessons_online_1/lesson_4/task_3.py
task_3.py
py
240
python
vi
code
0
github-code
36
33826107895
from src.track_orders import TrackOrders import unittest from unittest.mock import patch, mock_open, call mock_csv = [ ["eduarda", "pizza", "sexta-feira"], ["eduarda", "rocambole", "sexta-feira"], ["joao", "rocambole", "sexta-feira"], ["eduarda", "coxinha", "segunda-feira"], ["arnaldo", "misto-quen...
EddyeBoy27/restaurant-orders
tests/test_track_orders.py
test_track_orders.py
py
2,826
python
en
code
0
github-code
36
17736050506
import re import requests import json import osascript import hashlib from bs4 import BeautifulSoup def main(): # Get browser and player data via AppleScript code, output, err = getBrowserAndPlayerData() # print(output,err) current_data = output.split(', ') # Separate output player_data = curre...
jimu-gh/Kashi
kashi.py
kashi.py
py
8,841
python
en
code
50
github-code
36
25626283123
def findReplaceString ( S: str, indexes, sources, targets) -> str: if not S or not sources or not targets: return S else: for j in range (len (sources)): if sources[j] in S: l = len (sources[j]) ind = S.index (sources[j][0]) if ind > -...
Akashdeepsingh1/project
ms/find and replace string.py
find and replace string.py
py
499
python
en
code
0
github-code
36
36132831318
""" Dialog for editing first arrivals. """ from PyQt5 import QtCore, QtGui, QtWidgets import numpy as np import pyqtgraph as qtg class FirstArrivalDlg(QtWidgets.QDialog): def __init__(self, measurement, genie, parent=None): super().__init__(parent) self._measurement = measurement self.g...
GeoMop/Genie
src/genie/ui/dialogs/first_arrival_dialog.py
first_arrival_dialog.py
py
6,825
python
en
code
1
github-code
36
25625718223
''' Given a 2D grid, each cell is either a zombie 1 or a human 0. Zombies can turn adjacent (up/down/left/right) human beings into zombies every hour. Find out how many hours does it take to infect all humans? Example: Input: [[0, 1, 1, 0, 1], [0, 1, 0, 1, 0], [0, 0, 0, 0, 1], [0, 1, 0, 0, 0]] Output: 2 Explana...
Akashdeepsingh1/project
2020/ZombieMatrix.py
ZombieMatrix.py
py
1,753
python
en
code
0
github-code
36
4876381764
import re import pandas as pd import m4i_metrics.config as config from ..Metric import Metric from ..MetricColumnConfig import MetricColumnConfig from ..MetricConfig import MetricConfig elems_non_compliant_config = MetricConfig(**{ 'description': 'The names of these elements are not structured as a sentence', ...
wombach/docker-python-rest
extra_modules/metrics/m4i_metrics/textual/ConceptLabelFormattingMetric.py
ConceptLabelFormattingMetric.py
py
4,592
python
en
code
1
github-code
36
8926252017
############################################################################################## # File: diceSim.py # Author: Sam Wareing # Description: script to determine probability of dice rolls using monte carlo simulation # # # ##################################################################################...
sjwar455/PythonCodeChallenges
diceSim.py
diceSim.py
py
1,183
python
en
code
0
github-code
36
12486902960
""" Basic Syntax, Conditional Statements and Loops - Exercise Check your code: https://judge.softuni.bg/Contests/Compete/Index/1719#7 Video: https://www.youtube.com/watch?time_continue=4&v=7sHE4HEUqi8 SUPyF2 Basic Exercise - 08. Mutate Strings (not included in final score) Problem: You will be given two strin...
SimeonTsvetanov/Coding-Lessons
SoftUni Lessons/Python Development/Python Fundamentals September 2019/Problems And Files/05 EX. B. SYNTAX, CONDITIONAL STATE. AND LOOPS - Дата 20-ти септември, 1430 - 1730/08. Mutate Strings.py
08. Mutate Strings.py
py
917
python
en
code
9
github-code
36
40420933577
# projekt Konto_bankowe, w dalszej części komentarzy referencje do obketów są nazywane obiektami: from konto import * #zaimportowanie klas i modułów z pliku konto.py konto1 = Konto(1000) #utworzenie obiektu klasy Konto -> stan_konta = 1000 konto2 = KontoBankowe("...
TheItaroshi/Studies
konto_bankowe/venv/main.py
main.py
py
7,308
python
pl
code
0
github-code
36
626133283
import os from collections import OrderedDict import tensorflow as tf class KBest(tf.keras.callbacks.Callback): """ A subclass of the callback preset class which implements the functionality to keep only the best k checkpoints of the execution (instead of the best one implemented in Tf). Attributes...
BNN-UPC/ignnition
ignnition/custom_callbacks.py
custom_callbacks.py
py
2,203
python
en
code
40
github-code
36
18034417237
class Solution: def numRollsToTarget(self, d: int, f: int, target: int) -> int: # Let dp(d, f, target) be the number of possible dice rolls for the given parameters # dp(d, f, target) = dp(d-1, f, target-1) + dp(d-1, f, target-2) + ... + dp(d-1, f, target-f) # The base case occur wh...
LittleCrazyDog/LeetCode
1155-number-of-dice-rolls-with-target-sum/1155-number-of-dice-rolls-with-target-sum.py
1155-number-of-dice-rolls-with-target-sum.py
py
987
python
en
code
2
github-code
36
28678725652
from selenium import webdriver from selenium.webdriver.common.by import By from webdriver_manager.firefox import GeckoDriverManager browser = webdriver.Firefox(executable_path=GeckoDriverManager().install()) codigos = ['22316', '21897', '22469', '22192', '22567', '22153', '21778', '22281', '22941', '22882', '21603', ...
DaviRamosUC/web_scraping_redmine
index.py
index.py
py
1,001
python
en
code
0
github-code
36
72774382185
import tkinter as tk from tkinter import messagebox from pymongo import MongoClient from UserInterface.GlobalResources.GuiObjectsFactories import \ MessageBox, \ ImagedButtonWithText from UserInterface.MainMenu.MonitoredLeagues.ManageMonitoredLeagues.ManageMonitoredLeagues import \ manage_monitored_leagues ...
SigmaFireFox/SigmaFox
apps/eleven10ths/src/app/11sixteen-desktop-app/UserInterface/MainMenu/MonitoredLeagues/MonitoredLeagues.py
MonitoredLeagues.py
py
4,954
python
en
code
0
github-code
36
25798887132
grade = ['A+','A0','A-','B+','B0','B-','C+','C0','C-'] t = int(input()) for case in range(1,t+1): n,k = map(int, input().split()) grade_unit_num = n/10 student_score = [] for i in range(1,n+1): middle,final,project = map(int, input().split()) score = round(middle*0.35 + final*0.45 + project*0.2) st...
00purplecandy00/Algorithm-Test-03
2200072/조교의성적매기기.py
조교의성적매기기.py
py
569
python
en
code
null
github-code
36
14029690592
from django import forms from . models import Contact class ContactForm(forms.ModelForm): name = forms.CharField(label = "",widget = forms.TextInput(attrs={ 'class':'form-control', 'placeholder' : 'Full Name', 'required' : 'required', })) email = forms.EmailField(label= '',widget =...
IbrahimFarukInce/Django-Course-App
smartedu_con/pages/forms.py
forms.py
py
996
python
en
code
0
github-code
36
1828127496
import json import os from pathlib import Path from typing import List, Tuple import numpy as np from arch import arch_model from systems_util import get_futures_list, get_settings, normalize_weights def myTradingSystem(DATE: List[int], CLOSE: np.ndarray, settings) -> Tuple[np.ndarray, dict]: print(f"Predi...
weixue123/quantiacs_algo_trading
systems/garch_system.py
garch_system.py
py
2,506
python
en
code
0
github-code
36
71193874663
#Importing the Dependencies import tensorflow as tf from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.applications import MobileNetV2 from tensorflow.keras.layers import AveragePooling2D from tensorflow.keras.layers import Dropout from tensorflow.keras.layers import Flatten from...
OmololaOkebiorun/Face_Mask_Detection
training.py
training.py
py
4,037
python
en
code
0
github-code
36
19913113172
def main(): file = 'Greeting.txt' displaywithForLoop(file) print() displaywithcomprehensionside(file) createdictionary(file) createDictionary(file) def displaywithForLoop(file): infile = open(file, 'r') for line in infile: print(line, end= '') infile.close def displaywithco...
rongliaoo/2-23
practice/processingdata.py
processingdata.py
py
881
python
en
code
0
github-code
36
15062690781
from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider cloud_config= { 'secure_connect_bundle': 'C:/Users/Damian/Documents/leren-programmeren/python/databasestuff/secure-connect-signup.zip' } auth_provider = PlainTextAuthProvider('ckjSgHZotmWyYFbJXRYYcYxU', 'FwJ1SjYdckK26ur43y...
damianslavenburg/leren-programmeren
python/databasestuff/connect_database.py
connect_database.py
py
668
python
en
code
0
github-code
36
6007494490
import json import unittest from datetime import date from first_config import Config from first_data import FirstData from first_distance import FirstDistance from first_pace import FirstPace from first_plan import FirstPlan from first_race import FirstRaceType, FirstRace from first_runner import FirstRunner from fir...
bendaten/first_trainer
test/test_plan.py
test_plan.py
py
10,937
python
en
code
1
github-code
36
15947746512
''' 用于将dea模型中的构件拆分到单独的dae文件中 ''' def process(dae_path, base_output_dae_path): ''' 将dae文件中的一个个构件分开到多个dae文件中 ''' import xml.dom.minidom import os import time if not os.path.exists(dae_path): print('路径%s不存在' % dae_path) # 文件夹路径 output_dir = base_output_dae_path + '\\' + dae_path[dae_path.rfind('\\') + 1: da...
XinJack/UsefulScripts
daeProcessor_python/daeProcessor.py
daeProcessor.py
py
4,418
python
en
code
0
github-code
36
26446464278
from django.contrib.auth import login, authenticate from django.contrib.auth.decorators import login_required from django.http import JsonResponse from .forms import SignUpForm, ProfileForm, LoginForm from django.shortcuts import render, redirect from .models import Profile, Search from product.models import Product im...
RunarVestmann/verklegtnamskeid2
captain_console/user/views.py
views.py
py
6,004
python
en
code
0
github-code
36
7752973710
from fastapi import FastAPI, Request, Form, HTTPException from fastapi.templating import Jinja2Templates from fastapi.responses import HTMLResponse, RedirectResponse, JSONResponse from pydantic import BaseModel import psycopg2 import datetime from uuid import uuid4 from fastapi.responses import StreamingResponse from i...
ksindy/qrfood
qr_food_app/main.py
main.py
py
9,400
python
en
code
0
github-code
36
26415954202
# This file runs the websockets. import string, cgi, time import sys sys.path.insert(0, 'PyWebPlug') from wsserver import * from time import sleep def setupMessages(): return class Client: def __init__(self, socket): self.socket = socket self.needsConfirmation = True def handle(se...
ChrisFadden/PartyTowers
webrouter.py
webrouter.py
py
4,597
python
en
code
1
github-code
36
43298706244
import pypy.module.micronumpy.constants as NPY from nditer import ConcreteIter, parse_op_flag, parse_op_arg from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter.gateway import interp2app from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.module.micronumpy import support fro...
mozillazg/pypy
pypy/module/micronumpy/broadcast.py
broadcast.py
py
4,124
python
en
code
430
github-code
36
34087887942
# def takeRGBValues(): # print("Enter the values of channels:") # channel1 = int(input( # "Enter the value of 1st Channel: ")) # channel2 = int(input( # "Enter the value of 2nd Channel: ")) # channel3 = int(input( # "Enter the value of 3rd Channel: ")) # return channe...
arshactually/Multi_simulator2.0
src/values_input.py
values_input.py
py
1,527
python
en
code
0
github-code
36
18407340005
import os import tensorflow as tf from smart_compose.utils import parsing_utils from smart_compose.utils.parsing_utils import InputFtrType from smart_compose.utils.testing.test_case import TestCase class TestParsingUtils(TestCase): """Unit test for parsing_utils.py""" atol = 1e-3 def testIterateItemsWi...
linkedin/detext
test/smart_compose/utils/test_parsing_utils.py
test_parsing_utils.py
py
1,685
python
en
code
1,249
github-code
36
74134918182
from cmath import nan import re from types import NoneType from django.shortcuts import render, redirect from django.http import JsonResponse from mensajeria.models import ( Archivos, Destinatarios, Personas, Maestras, Peticion, Paises, Areas, Secciones, Grupos ) from mensajeria.form...
YilberthAndres/masivo
mensajeria/views/carga/carga_distribucion.py
carga_distribucion.py
py
16,140
python
es
code
0
github-code
36
73421284263
import tensorflow as tf import keras as K from keras import callbacks, optimizers from keras import backend as KB from keras.engine import Layer from keras.layers import Activation from keras.layers import LeakyReLU, Dense, Input, Embedding, Dropout, Reshape, Concatenate, MaxPooling1D, Flatten from keras.layers impor...
Chucooleg/CapsNet_for_NER
code/buildCapsModel.py
buildCapsModel.py
py
12,144
python
en
code
10
github-code
36
10500012306
thunderstorm = '\U0001F4A8' # Code: 200's, 900, 901, 902, 905 drizzle = '\U0001F4A7' # Code: 300's rain = '\U0001F327' # Code: 500's snowflake = '\U00002744' # Code: 600's snowflake snowman = '\U000026C4' # Code: 600's snowman, 903, 906 atmosphere = '\U0001F301' # Code: 700's foogy clearSky = '\U00002600' # Cod...
lotrik84/get_the_weather_bot
emoji.py
emoji.py
py
1,400
python
en
code
0
github-code
36
14438218202
import psycopg2 update_sql = "UPDATE test SET data = %s WHERE num = %s" conn = None try: # connect to the PostgreSQL database conn = psycopg2.connect( dbname='spacedys', host='localhost', user='spacedys', password='password') # create a new cursor cur = conn.cursor() ...
nicolacammillini/spacedys
docs/demos/db/update-pg.py
update-pg.py
py
694
python
en
code
0
github-code
36
23216322875
"""Add season_bet table Revision ID: 8076a0692fc3 Revises: Create Date: 2023-03-12 10:53:35.538988 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '8076a0692fc3' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands au...
rbikar/f1-guessing-game-app
migrations/versions/8076a0692fc3_add_season_bet_table.py
8076a0692fc3_add_season_bet_table.py
py
962
python
en
code
0
github-code
36
20798421821
# coding: utf-8 # In[1]: import os import re # In[2]: # reads lines from a text file given by filename def readlines(filename): file = open(filename, "r") return file.readlines() # In[3]: def parse_generation_line(line): regex = r"(\d+) generations" match = re.search(regex, line) return mat...
blogscot/travelling-salesman
tools/munge.py
munge.py
py
1,649
python
en
code
3
github-code
36
15872415911
import torch import numpy as np from falkon import Falkon from falkon.kernels import GaussianKernel from falkon.options import FalkonOptions from falkonhep.models import HEPModel class FalkonHEPModel(HEPModel): def create_labels(self, ref_size, data_size): ref_labels = np.zeros(ref_size, dtype=np.floa...
FalkonHEP/falkonhep
falkonhep/models/flkhep_model.py
flkhep_model.py
py
1,858
python
en
code
1
github-code
36
28068819422
# 숫자 문자열과 영단어 # https://programmers.co.kr/learn/courses/30/lessons/81301 def solution(s): answer = '' _dict = {'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9} alpha = '' for i in s: if i.isalpha(): alpha += i ...
hwanginbeom/algorithm_study
2.algorithm_test/21.07.11/21.07.11_wooseok.py
21.07.11_wooseok.py
py
544
python
en
code
3
github-code
36
34212066405
# https://www.acmicpc.net/problem/14502 # solution # 1) 임의로 3개의 벽을 세운다(dfs) # 2) 바이러스를 퍼뜨린다(bfs) # 3) 안전구역의 크기를 구해서 최대값을 갱신한다 # 4) 1)로 돌아가 모든 경우에 대해 반복한다 # 5) 안전구역 크기의 최대값을 출력한다 # TIL # 2차원 배열에서 가능한 모든 조합을 재귀적으로 탐색하는 코드( line:60~66 ) ## -> 몫(i//m)과 나머지(i%m)를 이용한 탐색과 재귀함수 내에 반복문 있는 형태 import copy from collections i...
chankoo/problem-solving
graph/14502-연구소.py
14502-연구소.py
py
2,358
python
ko
code
1
github-code
36
22377349542
import pandas as pd import matplotlib.pyplot as plt import os # file muveletek import datetime from datetime import date import time import copy import numpy as np class nHop: time_stamp = '' next_hop = '' count = 0 per8 = 0 adv_range = 0 def __init__(self): self.time_stamp = '' self.next_hop = '' self....
Tomikaze/IP-stats-trends
venv/nexthop.py
nexthop.py
py
2,796
python
en
code
0
github-code
36
13483905571
import numpy as np from numpy import random BIT_WIDTH = 20 NUM_CLASS = 4 class FizzBuzzDataSet(object): TOTAL_DATA = 0 CURRENT_I = 0 def __init__(self, size): if size < 0: size = 0 self.TOTAL_DATA = size self.CURRENT_I = 0 @staticmethod def _encode(num): ...
BrianPin/fbitf
data_set.py
data_set.py
py
1,588
python
en
code
0
github-code
36
23536887489
import numpy as np from collections import deque import gymnasium as gym from stable_baselines3.common.atari_wrappers import ( ClipRewardEnv, EpisodicLifeEnv, FireResetEnv, MaxAndSkipEnv, NoopResetEnv, ) class Agent: def __init__(self, eval_env): self.eval_env = eval_env def eval...
ZangZehua/rlatari
utils/random_atari.py
random_atari.py
py
2,894
python
en
code
2
github-code
36
20078510579
from flask import Blueprint, render_template, url_for, request, send_from_directory from flask_login import login_required, current_user from werkzeug.utils import redirect from crm import db from ..utils.images_handler import save_image_uploads, get_image_list, load_image_uploads, delete_images from .forms import Ne...
tomasz-rzesikowski/crm
crm/note/views.py
views.py
py
2,354
python
en
code
0
github-code
36
12575982154
from distutils.log import INFO from multiprocessing.sharedctypes import Value from dash import Dash, html, dcc, Input, Output, State, dash_table import dash import dash_bootstrap_components as dbc import LoraLogger import pandas as pd import json import plotly.io as pio pio.templates.default = "plotly_dark" logger = ...
adrwong/FAI
app.py
app.py
py
10,096
python
en
code
0
github-code
36
23256745509
from flask import Flask, render_template, request, session, redirect, flash, url_for from flask_hashing import Hashing import random import secrets from .utils import * app = Flask(__name__) app.config.from_object('config') hashing = Hashing(app) def before_request(): """fonction qui initialise les sessions de ...
Tezay/conjug
conjugFR/views.py
views.py
py
27,625
python
en
code
6
github-code
36
1938554685
import sys from typing import List from kclvm.tools.lint.reporters.base_reporter import BaseReporter from kclvm.tools.lint.message.message import Message class FileReporter(BaseReporter): def __init__(self, linter, output=None, encoding=None): self.name = "file_reporter" self.output_file = linter...
kcl-lang/kcl-py
kclvm/tools/lint/reporters/file_reporter.py
file_reporter.py
py
968
python
en
code
8
github-code
36
264212609
""" https://portswigger.net/web-security/cross-site-scripting/contexts/lab-onclick-event-angle-brackets-double-quotes-html-encoded-single-quotes-backslash-escaped """ import sys import requests from bs4 import BeautifulSoup site = sys.argv[1] if 'https://' in site: site = site.rstrip('/').lstrip('https://') s = ...
brandonaltermatt/penetration-testing-scripts
cross-site-scripting/contexts/onclick-event-angle-brackets-double-quotes-html-encoded-single-quotes-backslash-escaped.py
onclick-event-angle-brackets-double-quotes-html-encoded-single-quotes-backslash-escaped.py
py
1,149
python
en
code
0
github-code
36
71205780264
from setuptools import setup, find_packages from apache_spark import __version__ tests_require = [ 'mock', 'nose', 'coverage', 'yanc', 'preggy', 'tox', 'ipdb', 'coveralls', 'sphinx', ] setup( name='apache_spark', version=__version__, description='Computational tools for...
yosoyubik/ApacheSpark_02817
setup.py
setup.py
py
1,598
python
en
code
0
github-code
36
14248737193
# 특정 원소가 속한 집합을 찾기 def find_parent(parent, x): if parent[x] != x: parent[x] = find_parent(parent, parent[x]) return parent[x] return parent[x] def union_parent(parent, a, b): a = find_parent(parent, a) b = find_parent(parent, b) if a < b: parent[b] = a else: par...
vmfaldwntjd/Algorithm
BaekjoonAlgorithm/파이썬/그래프/[백준 2887]행성 터널/Baekjoon_2887.py
Baekjoon_2887.py
py
1,709
python
ko
code
0
github-code
36
18262811618
import requests import json import os import pyperclip from wox import Wox,WoxAPI class Main(Wox): def query(self,key): results=[] key=key.split(' ') servers={ '1':"LuXingNiao",'2':"MoGuLi",'3':"MaoXiaoPang", } worlds={ 'HongYuHai':"红玉海", ...
ShiomiyaRinne/FFXIV-Market-Query
main.py
main.py
py
3,542
python
en
code
1
github-code
36
28613364026
from PySide import QtCore, QtGui, QtSql import connection def initializeModel(model): model.setTable("employee") model.setEditStrategy(QtSql.QSqlTableModel.OnManualSubmit) model.setRelation(2, QtSql.QSqlRelation('city', 'id', 'name')) model.setRelation(3, QtSql.QSqlRelation('country', 'id', 'name'))...
pyside/Examples
examples/sql/relationaltablemodel.py
relationaltablemodel.py
py
1,963
python
en
code
357
github-code
36
30753498437
from __future__ import absolute_import, division, print_function, unicode_literals import os import tensorflow as tf from tensorflow.keras import datasets, layers, models import matplotlib.pyplot as plt CHECKPOINT_PATH = "model/lab2.h5" def main(): (train_images, train_labels), (test_images, ...
sontuphan/deep-learning-labs
labs/lab2.py
lab2.py
py
1,755
python
en
code
0
github-code
36
34316494896
''' Created on Mar 6, 2014 @author: kerem ''' from random import randint from random import random as rnd class InteractionBox(object): center = None width = None height = None depth = None is_valid = None def __init__(self): pass def set(self, box): self.center = box.cen...
keryil/leaparticulatorqt
leaparticulator/data/frame.py
frame.py
py
4,847
python
en
code
0
github-code
36
24390093684
import argparse import os import re import subprocess from . import tool from .common import check_which, Command, guess_command, make_command_converter from .. import log, options as opts, shell from ..exceptions import PackageResolutionError, PackageVersionError from ..file_types import Directory, HeaderDirectory fr...
jimporter/bfg9000
bfg9000/tools/pkg_config.py
pkg_config.py
py
10,628
python
en
code
73
github-code
36
71023850983
from vues.vue_joueurs import VueJoueur from models.joueur import Joueur import utilitaires.menu as menu class ControllerJoueur: def __init__(self, db_table_joueur, requete): self.table = db_table_joueur self.user = requete def creer_joueur(self): """ Cree un joueur et l'ajoute a la d...
pnt983/P_4_OpenClassRooms
controllers/controller_joueurs.py
controller_joueurs.py
py
3,987
python
fr
code
0
github-code
36
571623190
from pymed import PubMed """In MEDLINE/PubMed, every journal article is indexed with about 10–15 subject headings, subheadings and supplementary concept records, with some of them designated as major and marked with an asterisk, indicating the article's major topics. When performing a MEDLINE search via PubMed, ent...
MarTnquesada/tfg
tfg/evaluation/pubmed_queries.py
pubmed_queries.py
py
1,223
python
en
code
0
github-code
36
9262633989
from tts_websocketserver.tts_pipeline import get_pipeline from rgws.interface import WebsocketServer import json, asyncio class TTSPipelineManager: def __init__(self): self.state = "Setup" self.pipeline = get_pipeline() self.pipeline.build() self.state = "Ready" as...
TheSoundOfAIOSR/rg_text_to_sound
tts_websocketserver/src/tts_websocketserver/tts_server.py
tts_server.py
py
1,659
python
en
code
4
github-code
36
1495371874
import numpy as np def compute_cost(X, y, theta): m = y.size h = np.dot(X, theta) return 1 / (2 * m) * ((h - y) ** 2).sum() def gradient_descent(X, y, theta, alpha, iterations): m = y.size for i in range(iterations): h = np.dot(X, theta) error = h - y theta -= (alpha / m...
takehilo/coursera-machine-learning-python
ex1/functions.py
functions.py
py
993
python
en
code
1
github-code
36
495434407
from __future__ import print_function import os import string import mock import pytest from click import UsageError from click.testing import CliRunner from dagster import ( DagsterInvariantViolationError, PartitionSetDefinition, RepositoryDefinition, ScheduleDefinition, lambda_solid, pipeli...
helloworld/continuous-dagster
deploy/dagster_modules/dagster/dagster_tests/cli_tests/test_cli_commands.py
test_cli_commands.py
py
31,036
python
en
code
2
github-code
36
14029268104
import typing import discord from discord.ext import commands from .general import is_staff, free_category, free_category_create class FreeCategory(commands.Cog): __slots__ = ('client', 'name', 'staff',) permissions_jp = { # 'create_instant_invite': '招待を作成', 'manage_channels': 'チャンネルの管理', ...
Kesigomon/Skyline_py
cogs/freecategory.py
freecategory.py
py
13,622
python
en
code
7
github-code
36
5032205330
import os import sys import numpy as np import matplotlib.pyplot as plt import getdist #from getdist import plots, MCSamples sys.path.append( "{}/utils".format(os.environ["GitHub"]) ) import list_utils as list_utils import directory_utils as directory_utils # NOTE: A LOT NEED TO CHANGE HERE ... # TODO: The sampl...
Sketos/utils
autolens_utils/autolens_directory_utils.py
autolens_directory_utils.py
py
5,540
python
en
code
0
github-code
36
28508588527
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE from numpy import float32, arcsin, sqrt from numpy import ma from opus_core.variables.variable import Variable from biocomplexity.land_cover.variabl...
psrc/urbansim
biocomplexity/land_cover/pwa.py
pwa.py
py
3,171
python
en
code
4
github-code
36
11837397080
'''test_board.py - unit tests for board.py''' # pylint: disable=E0401, W0621 from src.py import board from src.py.player import Player from src.py.card import Card def test_get_player_name(monkeypatch): '''test get_player_name with mock inputs''' # Given inputs = iter(['Bryan', 'y']) monkeypatch.seta...
dariustb/GoFish
tests/unit_tests/test_board.py
test_board.py
py
1,883
python
en
code
0
github-code
36
74978102183
import os import random from captcha import image import numpy as np import PIL.Image as PILImage import cv2 import shutil def create_train_dataset(output_dir: str, width: float, height: float, captcha_count=4, count=2000): if not os.path.exists(output_dir): os.mkdir(output_dir) number_sets = lambda o...
SquarePants1991/LearnTensorFlow
验证码识别/dataset_util.py
dataset_util.py
py
1,701
python
en
code
0
github-code
36
23297961850
#Criando a tupla notas = {} #Perguntando os dados aos usuários i=1 while i <= 5: aluno = input(str("Insira o nome do aluno: ")) nota = input("Insira a nota de {} no formato X.X: ".format(aluno)) notas[aluno] = nota i= i + 1 #Dicionário com os alunos e as respectivas notas print(notas) #...
BrunoArivabene/NaviSummer2021
Questao3.py
Questao3.py
py
592
python
pt
code
0
github-code
36
28225180956
from typing import List import unittest class Solution: def carFleet(self, target: int, position: List[int], speed: List[int]) -> int: records = [ (pos, spd) for pos, spd in zip(position, speed) ] records.sort(key=lambda x: x[0]) for i in rang...
HomayoonAlimohammadi/Training
Leetcode/853_CarFleet.py
853_CarFleet.py
py
1,349
python
en
code
2
github-code
36
75097166503
#UPDATED PAINT/ORGANISED #calvin and hobbes by Andy Liu """ FEATURES buttons: -red highlight on hover -green highlight on click tools: -Pencil, only black and thin -Line, drag and drop -Oval, drag and drop, left click for filled,right click for unfilled -Rectangle, see above -Brush, variable color and...
andy-liuu/Paint-Project
updatedpaint.py
updatedpaint.py
py
37,567
python
en
code
0
github-code
36
1165604872
# https://leetcode.com/problems/subsets/ # Total subsets for an arr of len n is 2 power n # Each subset is represented by binary representation of this total # for ex. if n = 3 # total subsets is 8 viz. 2 power 3 # subset0 would be 000, subset1 = 001, subset2 = 010, subset3 = 011 and so on. # if one is found in b...
acharyarajiv/leetcode
medium/subsets.py
subsets.py
py
1,423
python
en
code
0
github-code
36
11695978241
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time    : 2020/3/27 16:43 # @Author  : TanLHHH # @Site    : # @File    : tieba.py # @Software: PyCharm import requests,re url = "https://tieba.baidu.com/f?kw=%E6%96%B0%E5%9E%8B%E5%86%A0%E7%8A%B6%E7%97%85%E6%AF%92&ie=utf-8&pn=0" headers = { "User-Agent": "Mozilla/...
TanLHHHH/Spiders
测试文件夹/tieba.py
tieba.py
py
1,112
python
en
code
3
github-code
36
14086957906
import json import networkx as nx import matplotlib.pyplot as plt def get_topology(edges): g = nx.Graph() l3edges_json = json.loads(edges.to_json(orient="index")) for k in l3edges_json: neighbor = l3edges_json[k] node_id = neighbor["Interface"]["hostname"] remote_node_id = neighb...
martimy/Bat-Q
pages/common/plotting.py
plotting.py
py
756
python
en
code
1
github-code
36
9659540801
# -*- coding: utf-8 -*- """ Created on Tue Jul 23 14:40:11 2019 @author: hoangt1 """ #ANSWER: 748317 #NOTE: 1 is not prime def reversed_num(n): reversed_n=0 while(n>0): remainder=n%10 reversed_n=reversed_n*10+remainder n=n//10 return reversed_n def is_prime(n): if n==1: return...
trung-hn/Project-Euler
Solution/prob37.py
prob37.py
py
1,089
python
en
code
1
github-code
36
37071867440
from flask import Flask,render_template,redirect,url_for from flask_bootstrap import Bootstrap from detail_collector import DetailCollector app = Flask(__name__) app.config['Secret_KEY'] = '83hs293C0926jcw2FJ893Bd3E' Bootstrap(app) detail = DetailCollector() @app.route("/") @app.route("/home") def home(): retu...
Amari-17/portfolio
app.py
app.py
py
370
python
en
code
0
github-code
36
14263045240
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import Account, UserProfile, RefundRequests, FavoriteItem, Preferences # Register your models here. class AccountAdmin(UserAdmin): list_display = ('email', 'first_name', 'last_name', 'username', 'phone_number', 'last_lo...
jeffjcb/southcartel-app
southcartel/accounts/admin.py
admin.py
py
1,150
python
en
code
1
github-code
36
70894649064
from queue import PriorityQueue class Solution: def splitNum(self, num: int) -> int: a=[int(x) for x in str(num)] pq=PriorityQueue() num1="" num2="" for i in a: pq.put(i) while not pq.empty(): num1+=str(pq.get()) if not...
VanshBhargava/Leetcode-Biweekly-Contest-99-Solutions
Split with minimum Sum.py
Split with minimum Sum.py
py
421
python
en
code
1
github-code
36
32901525311
import csv import itertools import os.path import sys if __name__ == "__main__": #Create ontology dictionary from MEGARes ontology file #megares_ontology = {} #ontology_filename = "/home/noyes046/jsettle/argmobrich/MEGARESONTOLOGY.tsv" #with open(ontology_filename, 'r') as ontology_tsv: #ontolo...
settj/argmobrich_analysis
colocalization/gen_overlap.py
gen_overlap.py
py
2,748
python
en
code
0
github-code
36
31571764321
# _ __ _ __ # | | /| / /| | /| / / GREEN ANALYTICAL INDEX GENERATOR # | |/ |/ / | |/ |/ / W.Wojnowski 2020 # |__/|__/ |__/|__/ v.0.3 (alpha) # # from tkinter import * import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg ...
Casivelaunus/Green_index
Main_window.py
Main_window.py
py
62,363
python
en
code
0
github-code
36
6674627865
import torch from dace.transformation import transformation from dace.properties import make_properties from dace.sdfg.utils import node_path_graph from dace import nodes, SDFG, SDFGState, registry, Memlet from typing import Dict, Union from daceml import onnx as donnx from daceml.transformation.constant_folding impor...
spcl/daceml
daceml/transformation/pad_conv_fusion.py
pad_conv_fusion.py
py
3,630
python
en
code
69
github-code
36
26648319096
import os import sys from glob import glob from json2mongo import WriteToDataBase import argparse import configparser filename = "last_run_context_numbers.txt" # argument to be provided to the process manager parser = argparse.ArgumentParser( description="process manager" ) # need this to read the ini file config = co...
ShanJ35/XOM_master
backend/write_json_to_db.py
write_json_to_db.py
py
6,424
python
en
code
0
github-code
36
16126384094
import pandas as pd import glob path = r'/Users/gonzalovaldenebro/Library/CloudStorage/OneDrive-DrakeUniversity/STAT 190/Project 1/Data/Fault_Codes_Time_Series/merged_csv.csv' all_files = glob.glob(path + "/*.csv") column_names = ['Turbine', 'Time', 'Date', 'error_id', 'status_code', 'error_message', 'error_category...
meetkpatel20/Stat-190-Project-1
csv_merger/setColumn_names.py
setColumn_names.py
py
545
python
en
code
1
github-code
36
39804054613
import os from django.urls import resolve, reverse from django.shortcuts import redirect from django.http import HttpResponseForbidden from internal_users.models import InternalUser from firebase_auth_app.models import FirebaseUser from customer_users.models import CustomerUser class InternalUserMiddleware: # De...
zjgcainiao/new_place_at_76
internal_users/middlewares.py
middlewares.py
py
3,585
python
en
code
0
github-code
36
37000757290
T = int(input()) for tc in range(1, T+1): N = int(input()) # 1 4 7 8 0 number_list = list(map(int, input().split())) count_list = [0] * (max(number_list)+1) #최댓값보다 1개 큰 값 sort_list = [0] * len(number_list) for num in number_list: count_list[num] += 1 #count_list = [1, 1, 0, 0, 1, 0,...
ejuun/SWEA
swea0202_1966.py
swea0202_1966.py
py
1,216
python
en
code
0
github-code
36
37716628062
# Module Imports import mariadb import sys import socket import threading import time # Connect to MariaDB Platform try: db = mariadb.connect( user="user", password="password", host="mariadb", port=3306, database="info801" ) except mariadb.Error as e: print(f"Error ...
visarsylejmani/architecture-logicielle-info801
server/server.py
server.py
py
3,523
python
en
code
0
github-code
36
5668667396
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib.offsetbox import OffsetImage, AnnotationBbox from PIL import Image as pil_image from mosaic impor...
joshloyal/Mosaic
mosaic/histogram.py
histogram.py
py
5,809
python
en
code
0
github-code
36
74797071465
import scrapy from scrapy.spiders import CrawlSpider, Rule from scrapy.http import Request import re class MySpider(CrawlSpider): name = 'author_scrape' author_name = 'الكندي يعقوب' author_eng = 'al-Kindi' start_urls = ['https://ablibrary.net/books/?offset=0&limit=50&author={}&sort=name,asc'.f...
maeirnoam/scrapers
ABLibrary/ablib_scraper/ablib_scraper/spiders/ABLibCrawler.py
ABLibCrawler.py
py
2,051
python
en
code
0
github-code
36
71798506343
#!/usr/bin/python # python images_for_deep_learning_sv02_create_non_white_space_mapping_file.py -i input_bed -o output_mapping_file # python images_for_deep_learning_sv02_create_non_white_space_mapping_file.py -i non_white_out_all_mgrb_and_isks.txt -o non_white_out_all_mgrb_and_isks_map_350x350.txt # Sort input bed fi...
emmamrath/gene_annotation_of_structural_variants
create_images_for_deep_learning/images_for_deep_learning_sv02_create_non_white_space_mapping_file.py
images_for_deep_learning_sv02_create_non_white_space_mapping_file.py
py
6,428
python
en
code
1
github-code
36
26736973424
import json import re from PyQt5.QtGui import QColor from PyQt5.QtWidgets import QFileDialog, QListWidgetItem, QColorDialog from models.const import * from models import util from uis.main_window import Ui_MainWindow class SettingsController(object): def __init__(self, app=None, ui: Ui_MainWindow = None, main_cont...
freedy82/Comic-Toolbox
models/controllers/settings_controller.py
settings_controller.py
py
14,876
python
en
code
13
github-code
36
20322614716
import machine import time class AHT21: """ Lightweight class for communicating with an AHT21 temperature and humidity sensor via I2C. AHT21 Datasheet: http://www.aosong.com/userfiles/files/media/AHT21%20%E8%8B%B1%E6%96%87%E7%89%88%E8%AF%B4%E6%98%8E%E4%B9%A6%20A0%202020-12-8.pdf Code insp...
TimHanewich/Air-Quality-IoT
src/AHT21.py
AHT21.py
py
1,880
python
en
code
0
github-code
36
18174515063
import os import sys import pathlib import pandas as pd import pymrio as pym import pickle as pkl import logging import argparse import json import re from pymrio.core.mriosystem import IOSystem SEC_AGG_ODS_FILENAME = "exiobase3_aggregate_to_7_sectors.ods" PARAMS_ODS_FILENAME ="exiobase3_7_sectors_params.ods" EXIO3_MO...
spjuhel/BoARIO
scripts/generate-example-files.py
generate-example-files.py
py
10,120
python
en
code
6
github-code
36
36839090820
import moviepy.editor as me import numpy as np from bm_analyze import * import time t=open('!r_data.txt') M=t.read().split('\n') t.close() del t M[0]='[empty]' start=36000 end=37000 speed=16 time.sleep(120) render=me.VideoClip(lambda t:np.zeros([1080,1920,3]),duration=(end-start)/speed)#+3*(q+1==k)) clips=[render] prin...
dr2xmillion371/stuff
matrix.py
matrix.py
py
1,876
python
en
code
0
github-code
36
36891693929
# a waf tool to add extension based build patterns for Samba import Task from TaskGen import extension from samba_utils import * from wafsamba import samba_version_file def write_version_header(task): '''print version.h contents''' src = task.inputs[0].srcpath(task.env) tgt = task.outputs[0].bldpath(task....
RMerl/asuswrt-merlin
release/src/router/samba-3.6.x/buildtools/wafsamba/samba_patterns.py
samba_patterns.py
py
861
python
en
code
6,715
github-code
36
10179826987
#!/usr/bin/python3 """ Number of subscribers(not active users,total subscribers) for a given subreddit """ import requests def number_of_subscribers(subreddit): """ Number of subscribers for a given subreddit from the Reddit API """ if subreddit is None or not isinstance(subreddit, str): ret...
jamesAlhassan/alx-system_engineering-devops
0x16-api_advanced/0-subs.py
0-subs.py
py
646
python
en
code
0
github-code
36
30218578553
# %% from urllib import request from urllib import error import os import csv import codecs import pandas as pd import numpy as np # %% initial_date = '2018-01-01' final_date = '2018-01-01' url = "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/New%20York/" + initial_dat...
FabianTatum/GRUPO-14-TAXIS-TRIPS
API weather/apiWeather.py
apiWeather.py
py
2,964
python
en
code
1
github-code
36