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
18294098339
from flask import Flask import nltk nltk.download('vader_lexicon') from nltk.sentiment.vader import SentimentIntensityAnalyzer from flask import jsonify sid = SentimentIntensityAnalyzer() app = Flask(name) def analysis(input1): output=sid.polarity_scores(input1) if output['compound']>0: return "positive",out...
AdityaSolanki189/PythonProjects
WebTranscript_SentimentAnalysis/SentimentAnalysis.py
SentimentAnalysis.py
py
865
python
en
code
0
github-code
13
72467371219
# Returns True if the given CSP solution dictionary csp_sol satisfies all # the constraints in the friendship graph, and False otherwise. def check_teams(graph, csp_sol): # iterate through graph for person in graph: friends = graph[person] for friend in friends: # person is on the ...
emilychen98/aima-python
a2_q2.py
a2_q2.py
py
441
python
en
code
0
github-code
13
73212294416
from imports_nps import * class ProcessROI: """ Calculate NPS and create files with results. Attributes ---------- workbook_series : XlsxWriter's Workbook object Workbook containing NPS info for each image in current series. Each worksheet (except the last one) contains NPS info f...
HombreOso/NPS_PyQt
ProcessROI.py
ProcessROI.py
py
76,899
python
en
code
0
github-code
13
33371505383
import pandas as pd FILEPATH = "TaipeiMRTStationList.csv" STATION_ADDED = [] def read_and_slice_station_csv(filepath): df = pd.read_csv(filepath) df_slice = df[["stationNameEng", "stationName", "startDate"]] return df_slice def generate_station_sql_inject(column_inject, row): datas = "" data =...
ker07/downloadMRTData
generate_inject_sql_for_station.py
generate_inject_sql_for_station.py
py
920
python
en
code
0
github-code
13
18712032773
# 写法一 def rob(nums: [int]) -> int: if not nums: return 0 n = len(nums) if n < 3: return max(nums) for i in range(2, n): nums[i] += max(nums[:i - 1]) return max(nums) def rob2(nums: [int]) -> int: if not nums: return 0 size = len(nums) if size == 1: ...
russellgao/algorithm
dailyQuestion/2020/2020-05/05-29/python/solution.py
solution.py
py
645
python
en
code
3
github-code
13
74564789458
from builtins import object import unittest import WMCore.Database.CouchUtils as CouchUtils from WMQuality.TestInitCouchApp import TestInitCouchApp class CouchUtils_t(unittest.TestCase): def setUp(self): self.testInit = TestInitCouchApp(__file__) self.testInit.setupCouch("wmcore-acdc-couchutils"...
dmwm/WMCore
test/python/WMCore_t/Database_t/CouchUtils_t.py
CouchUtils_t.py
py
3,318
python
en
code
44
github-code
13
1491938597
import random def GameResult(prev_coords, new_coords, player, dimensions, width, part_runs): diff = [] # Displacement diff2 = [] # Displacement as a multiple or fraction of the first diff3 = [] # Displacement as a multiple or fraction of the first diff4 = [] # Displacement as a multiple or fractio...
JonathanDelaney/TryTrickThatThough
tictactoe.py
tictactoe.py
py
8,892
python
en
code
0
github-code
13
24425057460
from rez.packages_ import get_latest_package from rez.vendor.version.version import Version from rez.vendor.distlib import DistlibException from rez.vendor.distlib.database import DistributionPath from rez.vendor.distlib.markers import interpret from rez.vendor.distlib.util import parse_name_and_version from rez.vendor...
ColinKennedy/tk-config-default2-respawn
vendors/rez-2.23.1-py2.7/rez/pip.py
pip.py
py
14,168
python
en
code
10
github-code
13
35784906048
import os import pickle import numpy as np import imageio import scipy.signal as sig from torch.utils.data import Dataset import rf.organizer as org from rf.proc import create_fast_slow_matrix, find_range class RGBData(Dataset): def __init__(self, datapath, datapaths, recording_str="rgbd_rgb", ppg_str="rgbd", ...
UCLA-VMG/EquiPleth
nndl/data/datasets.py
datasets.py
py
22,111
python
en
code
6
github-code
13
2856005308
from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from absl import flags from absl import logging from valan.framework import actor from valan.framework import common from valan.framework import eval_actor from valan.framework import hyper...
google-research/valan
r2r/actor_main.py
actor_main.py
py
2,165
python
en
code
69
github-code
13
38924394285
from perf.kube_watcher.event.logged.logged_event import LoggedEvent class NodeLoggedEvent(LoggedEvent): def __init__(self, type, node_name, data, cluster_time, local_time, raw_event): super(NodeLoggedEvent, self).__init__(type) self.node_name = node_name self.data = data self.clust...
dirtyValera/svoe
data_feed/perf/kube_watcher/event/logged/node_logged_event.py
node_logged_event.py
py
540
python
en
code
12
github-code
13
14858699423
from django.urls import path from . import views app_name = 'cart' urlpatterns = [ path('', views.CartView.as_view(), name='summary'), path('shop/', views.ProductListView.as_view(), name='product-list'), path('shop/<slug>/', views.ProductDetailView.as_view(), name='product-detail'), path("increase-q...
sudarshanmestha/ecom_simple_website
cart/urls.py
urls.py
py
731
python
en
code
1
github-code
13
28833642079
# -*- coding: utf-8 -*- """ Created on Tue Jan 24 11:34:12 2017 @author: GrinevskiyAS """ from __future__ import division import numpy as np from numpy import pi, sin, cos, tan import matplotlib.pyplot as plt from matplotlib import cm data_input=np.loadtxt(r"E:\Aspir_data\SynModel1\aniso_model_UsedInProje...
antongrin/AniBox
MesgagRugerAppr.py
MesgagRugerAppr.py
py
6,408
python
en
code
1
github-code
13
14893222883
import requests import pandas as pd import os api_key = os.getenv('api_key') companies = ['AMZN','AAPL','MSFT', 'TSLA'] BS_over_time = '' BS_companies = '' def balance_sheet(quarter,company,type_analysis): #api_key = 'bbb11c6dd9e2948898d127f3f08d94c9' BS = requests.get(f'https://financialmodelingprep.com/api/v3/b...
PvrpleBlvck/Escuela
blvckfinance/balance_sheet_ratios/main.py
main.py
py
4,980
python
en
code
2
github-code
13
17040281354
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayEcoEprintTaskSubmitModel(object): def __init__(self): self._client_id = None self._client_secret = None self._content = None self._eprint_token = None ...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/AlipayEcoEprintTaskSubmitModel.py
AlipayEcoEprintTaskSubmitModel.py
py
3,442
python
en
code
241
github-code
13
26057750464
# Imports from PyQt5.QtWidgets import QToolBar, QComboBox, QAction, QLineEdit from PyQt5.QtGui import QDoubleValidator # Classes class ObjectSelector(QToolBar): def __init__(self, object_controller, overlay_controller): super().__init__() self._object_controller = object_controller self._...
Benjymack/video-tracker
video_tracker/object_model/object_selector.py
object_selector.py
py
4,454
python
en
code
2
github-code
13
27250609439
# projet_calcul # crée une calculatrice en phyton import tkinter as tk WIDTH, HEIGHT = 300, 50 pad_x = 50 pad_y = 0 root = tk.Tk() root.title(" Calculatrice ") # ajoute un titre canvas = tk.Canvas(root, bg="red", height=HEIGHT, width=WIDTH) # Variables globales nb1 = "" nb2 = "" op = 0 cpt = 0 # les f...
uvsq22011110/projet_calcul
projet_calcul.py
projet_calcul.py
py
5,601
python
en
code
1
github-code
13
11659124463
# checks that users enter a valid response (e.g. yes / no # cash/credit) based on the list of options def string_checker(question, num_letters, valid_responses): error = "Please choose {} or {}".format(valid_responses[0], valid_responses[1]) while True: response = input(question).lower() ...
arthurbykov/programming
07_string_checker.py
07_string_checker.py
py
886
python
en
code
0
github-code
13
39804000080
#!/usr/bin/env python #!/usr/bin/env python # coding: utf-8 # In[1]: # Fill in your name using the given format your_name = "Patni, Nikhil" # In[2]: # For use in colab from IPython import get_ipython if 'google.colab' in str(get_ipython()): get_ipython().system('pip install openml --quiet') get_ipython()...
nikhil-96/ML-Assignment2
submit/solution.py
solution.py
py
37,730
python
en
code
1
github-code
13
40343102973
# -*- coding: utf-8 -*- import socket, time, random import sys, os, struct import traceback import select import getpass host = '' # Bind to all interfaces MachineInterface_onFindInterfaceAddr = 1 MachineInterface_startserver = 2 MachineInterface_stopserver = 3 MachineInterface_onQueryAllInterfaceInfos = 4 MachineIn...
kbengine/kbengine
kbe/tools/server/pycommon/Machines.py
Machines.py
py
11,756
python
en
code
5,336
github-code
13
12178730245
from typing import * from sklearn.cluster import AgglomerativeClustering, k_means from spherecluster import SphericalKMeans from utility_functions import get_clus_config # ---------------------------------------------------------------------- # type definitions data_type = List[Iterator[float]] # a list of vectors...
jagol/BA_Thesis
pipeline/clustering.py
clustering.py
py
2,376
python
en
code
2
github-code
13
3875319135
import requests import os import logging import sys import json import base64 logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) def get_consul_svc(svc_endpoint, request_params, service): """ Since consul does not have concept of prefix for service, so we are using tags for this purpose. ...
synup/ji
consul_pyconfig/consul_pyconfig/config.py
config.py
py
9,492
python
en
code
7
github-code
13
29246664576
import pandas as pd import os #Purges all rows where the name matches the specified purgeTarget from all data files with the specified prefix. #Useful for removing bad or modded games :-) #PurgeTarget needs to match the row exactly targetPath = "../../reaperCSVs/cluster data 40k/" filePrefix = "" purgeRows = False p...
JohnSegerstedt/DATX02-19-81
clustering/Utilities/csvpurge.py
csvpurge.py
py
1,413
python
en
code
4
github-code
13
39740126027
import sys import numpy as np from xml import sax from xml.sax.saxutils import escape from math import sqrt, sin, cos, radians, atan2 from functools import partial def lat_lon_elevation_from_gpx( gpx ): class GPXTrackHandler( sax.handler.ContentHandler ): def __init__( self, *args, **kwargs ): super().__init__...
esitarski/RaceDB
core/gpx_util.py
gpx_util.py
py
5,720
python
en
code
12
github-code
13
14577446472
import csv import requests from requests.auth import HTTPBasicAuth import json import psycopg2 import time def open_database_connection(postgres_config): """ Open a database connection with autocommit property. Args: postgres_config : dictionary of postgres configuration Returns: conne...
dwtcourses/financial-advisor
intrinio/tools/company_database_insert.py
company_database_insert.py
py
3,923
python
en
code
0
github-code
13
27074621569
import subprocess, os class MemoryMonitor(object): def __init__(self): """Create new MemoryMonitor instance.""" self.pid = os.getpid() def usage(self): """Return int containing memory used by user's processes.""" self.process = subprocess.Popen("ps -p %s -o rss | awk '{sum+=$1...
entone/GeriCare
Shared/system/memory_monitor.py
memory_monitor.py
py
619
python
en
code
1
github-code
13
17041177037
from sklearn.datasets import fetch_20newsgroups from sklearn.metrics import f1_score, classification_report from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.linear_model import Perceptron ###### ### This one downloads a large dataset, so it may take a while categories = ['rec.sport.hockey', 'r...
rupendrab/pyutil
Perceptron_01.py
Perceptron_01.py
py
1,382
python
en
code
0
github-code
13
30365546051
import logging import voluptuous from tornado.options import options from tornado.httputil import url_concat, responses from tornado.web import RequestHandler, HTTPError from tornado import escape class APIError(Exception): pass def get_error_message(ex): if isinstance(ex, (list, tuple)): ex = ex[0]...
chenjian525/dm
dm/controllers/__init__.py
__init__.py
py
3,150
python
en
code
0
github-code
13
34055045058
from rest_framework import serializers from advertisment.models import Advertisment def valid_transaction_number(transaction_number): trsct_num = str(transaction_number) if trsct_num[2] != '-' or trsct_num[6] != '-' or trsct_num[9] != '/': raise serializers.ValidationError("invalid transaction_numbe...
holeksii/python-projects
restfulapi/advertisment/serializers.py
serializers.py
py
1,909
python
en
code
0
github-code
13
15244214081
import numpy as np import xlwings as xw from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib import cm def vtk_visualization(k_grids, t_grids, k, t, v_values): ## VTK plot fig = plt.figure() ax = fig.gca(projection = '3d') ax.plot_surface(k, t, v_values, cmap=cm.co...
cycbill/Local-Vol-Calibration
source/vtk_visualization.py
vtk_visualization.py
py
1,699
python
en
code
2
github-code
13
10299074103
import matplotlib.pyplot as pt import pandas as pd data = pd.read_csv('/Users/shuchitamishra/Desktop/Prod-Migration/Cron Job 15_03-Table 1.csv') print(data) result = data.groupby('Status')['Status'].count() print(result) pt.axis('equal') pt.pie(result, colors = ['red','yellow','green'], labels = ['Failure','Ski...
shuchita28/Migration_Demo
piechart.py
piechart.py
py
397
python
en
code
0
github-code
13
72087529298
from typing import Callable import jax import jax.numpy as jnp from jax.flatten_util import ravel_pytree from newton_smoothers.base import MVNStandard, FunctionalModel from newton_smoothers.batch.utils import ( log_posterior_cost, residual_vector, block_diag_matrix, line_search_update, ) def _gn_bfg...
hanyas/second-order-smoothers
newton_smoothers/batch/ls_gn_bfgs.py
ls_gn_bfgs.py
py
3,123
python
en
code
3
github-code
13
24994899184
import configparser from datetime import datetime import os from pyspark.sql import SparkSession from pyspark.sql.functions import udf, col from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format, dayofweek import pandas as pd from pyspark.sql.functions import monotonically_increasing_i...
edwards158/UdacityDataEngineering
datalakes/project4/etl.py
etl.py
py
4,538
python
en
code
0
github-code
13
2276388320
from typing import Callable from ipywidgets import IntProgress import numpy as np import copy class MultiDimGA: def __init__(self): self.f = None self.h = None self.n = None self.dim = None self.intervals = None self.max_iter = None self.max_no_conv_iter = N...
vseredovych/genetic-algorithms
multi-dim-ga/multidimga.py
multidimga.py
py
7,558
python
en
code
0
github-code
13
3424531626
#!/usr/bin/env python import os import time from setuptools import find_packages, setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def r...
AButenko/selenium_tests
setup.py
setup.py
py
1,046
python
en
code
0
github-code
13
26203147465
from http import HTTPStatus as HTTP_Status from utils.log import Log class HTTPMethod(object): """Constants representing various HTTP request methods.""" GET = "get" PUT = "put" POST = "post" DELETE = "delete" code_priority_order = cpo = { HTTP_Status.OK: 1, HTTP_Status.CREATED: 2, ...
guard-project/cb-manager
lib/http.py
http.py
py
1,654
python
en
code
1
github-code
13
73718734736
import numpy as np from prtp.Grating import Grating from prtp.Combination import Combination from prtp.Rays import Rays import prtp.transformationsf as trans import astropy.units as u class GratingStack(Combination): ''' Class GratingStack: A special kind of combination that specifically handles a group of...
bjmyers/prtp
GratingStack.py
GratingStack.py
py
11,200
python
en
code
0
github-code
13
71528955218
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sensors', '0001_initial'), ] operations = [ migrations.CreateModel( name='SensorData', fields=[ ...
Fransan/hal0001
hal_env/hal/sensors/migrations/0002_sensordata.py
0002_sensordata.py
py
712
python
en
code
0
github-code
13
41388296989
import common import time import redis import re from uuid import uuid4 r = redis.StrictRedis() def reimport(): print("Flushing all redis contents") r.flushall() import_start = time.time() total_count = 0 for lines_buffer in common.chunk_lines(10000): total_count += len(lines_buffer) ...
mfenniak/log-tool-comparison
import_redis.py
import_redis.py
py
3,604
python
en
code
0
github-code
13
33394152496
def mergeSortedArray(A, m, B, n): # write your code here def sort_quick(lst): if len(lst) == 0: return lst pivot = lst[0] left = [] right = [] for i in range(1, len(lst)): if lst[i] <= pivot: left.append(lst[i]) else: ...
mx11Code/pythoncode
lintcode/64.py
64.py
py
549
python
en
code
0
github-code
13
27282120100
from django.conf.urls import url from . import views urlpatterns = [ url(r'^login$', views.login, name='login'), url(r'^timeinout$', views.timeinout, name='timeinout'), #<--------------DIRECTORIES------------> #<--ADMIN--> #Dashboard url(r'^Admin$', views.AdminDashboard, name='Admin/Dashboard'...
pmija/ARC-DJANGO
ARC/urls.py
urls.py
py
5,878
python
en
code
0
github-code
13
74859824976
class Solution: def mergeSort(self, data, head, rear): if head >= rear - 1: return 0 mid = (head + rear) >> 1 left = self.mergeSort(data, head, mid) right = self.mergeSort(data, mid, rear) current = 0 i, j = head, mid tempdata = [] while i ...
colinsongf/JianZhiOffer
数组中的逆序对.py
数组中的逆序对.py
py
1,003
python
en
code
0
github-code
13
26535712159
# from M1.list_49_键盘操作 import mouse_move # mouse_move() ###package测试成功 # class Employee(object): # pass # employee1 = Employee() # employee1.first = 'Harry' # employee1.surname = 'Portter' # employee1.salary = 4000 # employee1.email = 'Harry@163.com' # print('{}, {}, {}'.format(employee1.first+'' +employee1.sur...
ghfuidy/Hello-World
list_54_test_package.py
list_54_test_package.py
py
3,108
python
en
code
0
github-code
13
37690001602
import app.api.templates.DC_CV_Config_AIDC_L3_INTERNET_MED_template_TELEPAC.services.interfaces as interfaces_service; import app.api.templates.DC_CV_Config_AIDC_L3_INTERNET_MED_template_TELEPAC.services.services as services_service; import app.api.templates.DC_CV_Config_AIDC_L3_INTERNET_MED_template_TELEPAC.commom.uti...
icpmtech/Mastering-Python-in-the-Cloud-API-Development-with-AWS
Hands-on Coding/Hands-On-Projects-and-Case-Studies/Hands-On Projects/FastAPI-API-Solution-Init/app/api/templates/book/commom/builders/service_interface.py
service_interface.py
py
1,336
python
en
code
0
github-code
13
4511132910
# # @lc app=leetcode.cn id=75 lang=python # # [75] 颜色分类 # # https://leetcode-cn.com/problems/sort-colors/description/ # # algorithms # Medium (57.26%) # Likes: 761 # Dislikes: 0 # Total Accepted: 166.8K # Total Submissions: 291.4K # Testcase Example: '[2,0,2,1,1,0]' # # 给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜...
lagoueduCol/Algorithm-Dryad
08.Sort/75.颜色分类.mergesort.py
75.颜色分类.mergesort.py
py
2,061
python
zh
code
134
github-code
13
13644548907
import csv def write_csv(): """Method used to write in csv """ file_name=input("enter the name of file") list_element=input('Enter the element of list') list_1=list_element.split(",") for i in range(0,len(list_1)): if list_1[i].isdigit(): list_1[i]=int(list_1[i]) try: ...
Abhinavk1243/python-learning
scripts/Fileoperations/csv_1.py
csv_1.py
py
1,844
python
en
code
0
github-code
13
13321533891
import os import sys if sys.version_info[0]<3: # require python3 raise Exception("Python3 required! Current (wrong) version: '%s'" % sys.version_info) activate_this = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'venv', 'bin', 'activate_this.py') BASE_DIR = os.path.dirname(os.path.absp...
nicc777/flask-webservice-wsgi-python3-demo
opt/fwsdemo/app.wsgi
app.wsgi
wsgi
877
python
en
code
3
github-code
13
4193018706
import numpy as np import torch import torchvision import torch.nn.functional as F from torch.utils.data import DataLoader from torchvision import transforms, models, datasets import matplotlib.pyplot as plt # Created the Class for the custom dataset class CustomDataset(torch.utils.data.Dataset): ...
arp95/mask_rcnn_instance_segmentation
Code/custom_dataset.py
custom_dataset.py
py
2,950
python
en
code
3
github-code
13
73492588496
# Heap Sort # Time Complexity: O(nlogn) # Space Complexity: O(1) def Heapify(i,n,arr): smallest=i left=2*i+1 right=2*i+2 if left<n and arr[left]<arr[smallest]: smallest=left if right<n and arr[right]<arr[smallest]: smallest=right if smallest!=i: arr[i],arr[smallest]=ar...
Ayush-Tiwari1/DSA
Days.29/Python/2.Heap-Sort.py
2.Heap-Sort.py
py
772
python
en
code
0
github-code
13
73958544976
from date_handler import date_normalizer, compute_days def compute_and_print_result(date): # Calcula o número de dias e printa o resultado date_1, date_2 = date_normalizer(date) n_days = compute_days(date_1, date_2) print(f"\n- Data: {date.strip()}" ) print(f"- Há {n_days} dias entre as duas d...
LeonardoAleee/Teste_LP
program.py
program.py
py
822
python
pt
code
0
github-code
13
42546855887
# -*- coding: utf-8 -*- __all__ = ('Player', 'CardBattlePlayer', ) import kivy kivy.require(r'1.10.0') from kivy.lang import Builder from kivy.factory import Factory from kivy.utils import get_color_from_hex # from kivy.factory import Factory from kivy.properties import ( NumericProperty, StringProperty, ListPro...
gottadiveintopython/wildwar-old-version
wildwar/cardbattle_client/cardbattleplayer.py
cardbattleplayer.py
py
4,852
python
en
code
6
github-code
13
41590614584
import configparser import functools from itsdangerous import Serializer, BadSignature from main.db import get_db from flask import ( Blueprint, render_template, flash, redirect, url_for, session, g, current_app, request ) from main.db import get_db bp = Blueprint('manage', __name__, url_prefix='/manage') @bp.b...
szkarpinski/staszic-zapisy
main/manage.py
manage.py
py
2,631
python
pl
code
3
github-code
13
4321756831
############################################################################### # Copyright (C) 2018, 2019, 2020 Dominic O'Kane # Guillaume Lefieux ############################################################################### import numpy as np from financepy.models.black import Black from financepy.utils.glo...
domokane/FinancePy
tests_golden/TestFinModelBlack.py
TestFinModelBlack.py
py
3,679
python
en
code
1,701
github-code
13
19242581573
from urllib import request,parse from http import cookiejar import requests import os #urlopen # re = request.urlopen("http://www.baidu.com") # print(re.read()) #urlencode #re = request.urlopen("http://www.baidu.com/s?wd=新型冠状病毒") # q = {"wd":"新型冠状病毒"} # url = "http://www.baidu.com/s?" # # n_q = parse.urlencode(q) # pr...
zhweiwei/python-
爬虫学习/test_request.py
test_request.py
py
1,240
python
en
code
0
github-code
13
7724421215
# -*- coding: utf-8 -*- from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QMessageBox, QFileDialog from PyQt5.QtCore import QThread, pyqtSignal import openpyxl as xl from openpyxl.styles import Font, Alignment, PatternFill, Border, Side import sys import os import datetime from ui.main import Ui_MainW...
Josefina-Hernandez/DIV5_SALES_RECORD_TOOL
main_app.py
main_app.py
py
25,205
python
en
code
0
github-code
13
71611904978
"""Calculate two two-tuples ali-metric.""" # pylint: disable= from typing import Tuple # import math def twotuple_metric(vec1: Tuple[int, int], vec2: Tuple[int, int]) -> float: """Calculate two two-tuples ali-metric. Args: vec1: two-tuples of int vec2: two-tuples of int Return: ...
ffreemt/text-alignment-benchmarks
align_benchmark/twotuple_metric.py
twotuple_metric.py
py
1,209
python
en
code
0
github-code
13
70336848978
from itertools import combinations import numpy as np import pandas as pd def read_calc_event_into_df(event_file: str, types: [str]) -> pd.DataFrame: """ Function to read in fixation gaze data CSV file generated by Tobii Eye Tracker, aggregates fixation events, remove timezone and shift x coordinates ...
im-ethz/CHI-2023-paper-Leveraging-driver-vehicle-and-environment-interaction
eye_feature_engineering/eye_feature_utils/calc_utils.py
calc_utils.py
py
5,031
python
en
code
2
github-code
13
7800066704
# With em conjunto com o open é uma função de python que permite abrir um arquivo "as file" # Em seguida, dentro do operador with, o arquivo é lido dentro de uma variável chamada contents # Após, o conteúdo da variável é transformado em um array print('Giovanni Oliveira da Silva') print('Guilherme Castilho') print('Gu...
Guilherme-Maciel/FATEC_Projeto_Vendas
N2A.py
N2A.py
py
1,915
python
pt
code
0
github-code
13
24595049515
import connexion import six from flask_sqlalchemy import SQLAlchemy from swagger_server.models.api_response import ApiResponse from swagger_server.models.order import Order # noqa: E501 from swagger_server.models.position_in_order import PositionInOrder # noqa: E501 from swagger_server import util from swagger_server...
Serafimka2705/flask_open_api
flask_open_api/swagger_server/controllers/store_controller.py
store_controller.py
py
3,640
python
en
code
0
github-code
13
27242270356
from io import BytesIO from django.http import HttpResponse from django.template.loader import get_template from django.core.mail import send_mail,EmailMultiAlternatives from movintrendz.settings import EMAIL_HOST_USER from xhtml2pdf import pisa def render_to_pdf(template_src, context_dict={}): template = get...
just-get-it/JGI4
userdetail/utils.py
utils.py
py
10,125
python
en
code
0
github-code
13
32564502499
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read().replace('.. :changelog:', ...
shelper/pypeline
setup.py
setup.py
py
1,327
python
en
code
0
github-code
13
30000757758
# -*- coding: utf-8 -*- from repo import store from util import file from util.tool import to_list, to_time, pre_process, sort_coo, extract_topn_from_vector from analysis.algorithm import community_detection as cd from sklearn.feature_extraction import stop_words class ClusterAnalysis(): """ initializ...
jhs9396/pyTest
analysis/cluster_analysis.py
cluster_analysis.py
py
11,076
python
en
code
1
github-code
13
29712158310
from rest_framework import mixins, generics from rest_framework.response import Response from django.http import Http404 from service_user.models import UserModel from .serializer import ProfileSerializer from utils import log, ParameterKeys, get_serializer_error_code class ProfileAPI(generics.GenericAPIView, mixins....
yseiren87/jellicleSpace
server/service_user/views/profile/view.py
view.py
py
2,601
python
en
code
0
github-code
13
6427354417
#!/usr/bin/env python import numpy as np import pickle import torch from torch import nn from torch import optim from torch.nn import functional as F def load_dataset(fn): """ Load the dataset from "fn" (generated by mkdataset.py and modified by gethandpos.py) returns the list of all data """ # ...
yzihan/AR-Gesture-Semantic
test.py
test.py
py
4,950
python
en
code
0
github-code
13
27832623036
#!/usr/bin/env python3 import re import io PEERING_BASE = "../peeringDB/rawdumps/dump" ASNRE = re.compile("ClearDataTD\"\>([0-9]+)\&nbsp") BWRE = re.compile("\>(.+)\&nbsp;") def main(): fullMap = {} for i in range(1, 465): tmpMap = parseFile(PEERING_BASE + str(i) + ".txt") for tASN in tmpMap...
pendgaft/cash-nightwing
trafficModel/scripts/extraPeeringDB.py
extraPeeringDB.py
py
1,438
python
en
code
0
github-code
13
14122513479
from telegram.ext import Updater, CommandHandler from gtts import gTTS import re import uuid import os TOKEN = os.environ['TELEGRAM_TOKEN'] updater = Updater(token=TOKEN) dispatcher = updater.dispatcher def start(bot, update): bot.sendMessage(chat_id=update.message.chat_id, text="I'm bot please talk to me!") def ...
DevilsNightsix/gopcer
bot.py
bot.py
py
1,011
python
en
code
0
github-code
13
25949327135
import torch.nn as nn import torch from typing import Optional import copy import random import dgl.function as fn from sklearn import preprocessing as sk_prep from gnn_modules import setup_module class model_ggd(nn.Module): def __init__( self, in_dim: int, num_hidden: int, ...
CladernyJorn/SSL-GNN-Project
models/ggd.py
ggd.py
py
4,490
python
en
code
2
github-code
13
311932532
import sys import requests import pprint import ast from nltk.sentiment.vader import SentimentIntensityAnalyzer def classify_all_comments_sentiment(input_file, output_file): ''' calculates the sentiment of each comment in given input_file ''' sia = SentimentIntensityAnalyzer() file = open(in...
jshiohaha/redditCommentsAndPresidentialElection
src/comment_classifier.py
comment_classifier.py
py
2,376
python
en
code
3
github-code
13
43298745859
from OpenGL.GL import * from OpenGL.GLU import * from glfw.GLFW import * attributes = [ # x y z R G B A ((-0.866, -0.75, 0), (1, 0, 0, 1)), (( 0.866, -0.75, 0), (1, 1, 0, 1)), (( 0, 0.75, 0), (0, 0, 1, 1)) ] if glfwInit() == GLFW_FALSE: raise Exception("error: init g...
Rabbid76/graphics-snippets
example/python/opengl_hello_triangle/hello_triangle_glfw_begin_end.py
hello_triangle_glfw_begin_end.py
py
2,395
python
en
code
172
github-code
13
41863256946
#!/usr/bin/env python3 # Author:Tanaya Jadhav # Uses a list of known barcodes to find them in a fastq file and # create 10 fastq files # all sequences in 1 fastq file contain the same barcode from itertools import islice def main(): barcodes = ['ATGAGATCTT', 'AGCTCATTTC', 'TGAAAATCTT', 'TATCCAGCCA', 'AGGCAGGCAG'...
tanaya-jadhav/Python
barcodesorter.py
barcodesorter.py
py
1,188
python
en
code
0
github-code
13
11630860732
#!/usr/bin/python # -*- coding: latin-1 -*- import re import sys # Exemplo de programa (programa (c) da pagina 20 com a macro GOTO expandida) program = """ [A2] S1 = S1 - 1 if (S1 != 0): GOTO A2 [A] if (S2 != 0): GOTO B K = K + 1 if (K != 0): GOTO C [B] S2 = S2 - ...
DaviChavesPinheiro/teoria-da-computacao
Tarefa01 - Ultima Questão.py
Tarefa01 - Ultima Questão.py
py
2,564
python
en
code
0
github-code
13
2625085145
# -*- coding: utf-8 -*- import logging import pytz import datetime from pyramid.httpexceptions import HTTPServerError, HTTPOk from pyramid.view import view_config from stalker.db.session import DBSession from stalker import Project, StatusList, Status, Sequence, Entity, Studio import stalker_pyramid from stalker_py...
eoyilmaz/stalker_pyramid
stalker_pyramid/views/sequence.py
sequence.py
py
6,777
python
en
code
6
github-code
13
19067987020
# A deck with 26 red and 26 black. # Payoff: Red = +1, Black = -1 # Can stop any time. # Find the best strategy # Stop when payoff reach k and remaining cards only x left import random class Deck: def __init__(self, plus, minus): self.plus_cards = plus self.minus_cards = minus def draw(self...
laichunpongben/machine_learning
deck.py
deck.py
py
1,280
python
en
code
0
github-code
13
35897092393
##Perceptron Gate import pandas as pd import matplotlib as plt import matplotlib.pylab as plt import numpy as np def AND(x1,x2) : b = -0.7 if ((x1!=1)&(x1!=0))|((x2!=1)&(x2!=0)) : print("invalid input") else : w = np.array([0.5, 0.5]) x = np.array([x1,x2]) std = np.sum(w*x)...
popper6508/just_practice
Data_Processing_Practice/Deep Learning base.py
Deep Learning base.py
py
1,866
python
en
code
0
github-code
13
70293427858
from fastapi import HTTPException, status from app.repository.route_repository import RouteRepository from app.repository.user_repository import UserRepository from app.model.route import RouteRequestDTO, Route from app.model.email import Email from app.utils.mail_sender import MailSender class RouteService...
sorenowy/codetaintransportationappication
app/service/route_service.py
route_service.py
py
2,237
python
en
code
0
github-code
13
20239996000
# coding: utf-8 """ - Classe Principal - Controla entrada/saida dos widgets na tela principal conforme as ações principais da aplicação: - Novo Registro - Pesquisa - Alterar - Apagar """ # ----- Importações ----- # import sqlite3 import PyIntroDados import PyPesquisa from kivy.uix.floatlayout i...
Antonio-Neves/Arquivo-Passivo
PyPrincipal.py
PyPrincipal.py
py
5,616
python
pt
code
6
github-code
13
18416442121
first_player_name = input() second_player_name = input() player1card = input() player2card = '' winner = '' player1_total_points = 0 player2_total_points = 0 Number_wars = False while player1card != 'End of game': player2card = input() player1card = int(player1card) player2card = int(player2car...
MiroVatov/Python-SoftUni
Python Basic 2020/Number wars ver 03.py
Number wars ver 03.py
py
1,444
python
en
code
0
github-code
13
22426027191
#website scapping import requests def getHTML(url): try: r = requests.get(url,timeout=30) r.raise_for_status() r.encoding = r.apparent_encoding return (r.text) except: return ("ERROR") if __name__== "__main__": url = "http://www.duq.edu" print(getH...
YaleYe/HOPPYTIME
Scaping/webscapping.py
webscapping.py
py
341
python
en
code
0
github-code
13
22322378608
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import unicodedata from urllib.parse import urlparse, urlunparse import piexif import requests import scrapy URL = "http://my.yoolib.com/mht/collection/?esp=0" DATA_DIR = "/home/jean-baptiste/mht_files" WIDTH = 1024 HEIGHT = 640 TRANSLATE_TABLE = { "\xa0": "Dime...
spanska/yoolib-scrapper
spiders/thumbnails_spider.py
thumbnails_spider.py
py
3,639
python
en
code
0
github-code
13
38829786885
cpf = '11245257401' new_cpf = cpf[:-2] reverso = 10 total = 0 for index in range(19): if index > 8: index -= 9 total += int(new_cpf[index]) * reverso reverso -= 1 if reverso < 2: reverso = 11 d = 11 - (total % 11) if d > 9: d = 0 total = 0 ...
Thiago18l/Python-Projects
src/Advanced/cpf.py
cpf.py
py
479
python
en
code
0
github-code
13
31753282082
# Get the loan details money_owed = float(input("How much do you owe?\n")) interest_rate = int(input("What is the interest rate?\n")) payment = float(input("What is the monthly payment?\n")) months = int(input("How many months do you want to calculate?\n")) monthly_rate = interest_rate / 100 / 12 for i in range(mont...
palaniappa/dummy
python-learning/loan.py
loan.py
py
586
python
en
code
0
github-code
13
3947193048
# -*- coding: utf-8 -*- import time import glob import datetime import traceback import itertools from threading import Thread from xiyouhelper.tray import SysTrayIcon from xiyouhelper.disable_system_proxy import disable_proxy from xiyouhelper.hide_window import hide_self, show_self def show_window(sysTrayIcon): ...
shapled/xiyou-helper
run.py
run.py
py
1,608
python
en
code
0
github-code
13
26791751843
from replit import clear from art import logo #HINT: You can call clear() to clear the output in the console. print(logo) print("Welcome to the Secret Auction Program.") repeat = "yes" bidding = {} while repeat == "yes": key = input("\nWhat is your name? ") value = int(input("What's your bid? $")) bidding[key] = ...
nilayhangarge/100-Days-of-Code-Challenge
Project/Day-09 Blind Auction/main.py
main.py
py
566
python
en
code
0
github-code
13
19123118765
""" This module detects the word given the audio file using HMM techniques 1. We need to train 3 HMMs to detect 3 words: go, down, stop 2. Create obs for each file for all files from each directory for go, down, stop 3. Using the observations and some N states, train the corresponding model 4. Given a new file, compute...
AnshulRanjan2004/PyHMM
detect_word.py
detect_word.py
py
3,720
python
en
code
0
github-code
13
4818739790
def solution(gems): kind = len(set(gems)) size = len(gems) answer = [0, size - 1] dic = {gems[0]:1} start = end = 0 while end < size: if len(dic) < kind: end += 1 if end == size: break dic[gems[end]] = dic.get(gems[end], 0) + 1 else: ...
gilbutITbook/080338
11장/보석_쇼핑.py
보석_쇼핑.py
py
591
python
en
code
32
github-code
13
20681349681
from flask import Flask, request, jsonify app = Flask(__name__) cidades = [ { 'id': 1, 'nome': 'Houston', 'prefeito': 'Sylvester Turner (D)', }, { 'id': 2, 'nome': 'Chicago', 'prefeito': 'Brandon Johnson', }, { 'id': 3, 'nome': 'Los a...
Andrezada/API-Cidades
api.py
api.py
py
1,412
python
pt
code
0
github-code
13
10992257429
from mpi4py import MPI import time from sys import argv comm = MPI.COMM_WORLD rank = comm.Get_rank() host = MPI.Get_processor_name() payload_size = 32 size = comm.Get_size() msg_tot = int(float(argv[1])) file_name = 'rank_' + str(rank) + '.csv' sent_time = {} msg_num = 0 beg = 0.0 delta = 0.0 if rank == 1: data =...
folkpark/MPI_Benchmarking
exp10/exp10_3n/mpi_ch_size.py
mpi_ch_size.py
py
1,726
python
en
code
0
github-code
13
26559284824
import cv2 import numpy as np import random import os import os.path from PIL import Image import matplotlib.pyplot as plt import fnmatch #переменная - словарь классов label_dict = {0: 'anger', 1: 'contempt', 2: 'disgust', 3: 'fear', 4: 'happy', 5: 'neutral', 6: 'sad', 7: 'surprise', 8: 'uncertain'} #этот класс делае...
sanchelo2006/EMOTION_RECOGNITION
Preprocessing.py
Preprocessing.py
py
13,836
python
ru
code
0
github-code
13
35428203974
import datetime import cdflib import numpy as np from matplotlib import dates from sunpy.net import Fido from sunpy.net import attrs as a # # define start and end date # start_time="2012-5-26 10:30" # end_time="2012-5-28 15:40" # # specify spacecraft 'ahead'/'behind' # spacecraft = 'ahead' def get_swaves(start_time...
serpentine-h2020/SEPpy
seppy/tools/swaves.py
swaves.py
py
3,139
python
en
code
5
github-code
13
39426606530
import math import random import sqlite3 import asyncio import time import aioschedule from telebot import types from telebot.async_telebot import AsyncTeleBot from sqlalchemy import create_engine, and_ from sqlalchemy import MetaData, Table, Column, Integer, String from sqlalchemy.ext.declarative import declarative_...
nikalebed/deep_python_hw
hw4/main.py
main.py
py
7,306
python
en
code
0
github-code
13
11942868545
from Mapping.Map import Map from Mapping.Square import Square from Mapping.Terrain import average_distribution from operator import itemgetter class Region: def __init__(self, world, squares): self.squares = squares self.world = world def square_in_region(region, square): return any([x.x_pos...
Cal1ban/CreaturesGA
Mapping/Areas.py
Areas.py
py
2,290
python
en
code
0
github-code
13
14851121695
#rules #1. a...k first character must be an alphabet b/w a-k #2. second must be a digit divisible by 3 #3. followed by any number of charecters #fullmatch() function is used to find exact match from re import * varname=input("enter variable name:") rule="[a-k][369][a-zA-Z0-9]*" matcher=fullmatch(rule,varname) if ma...
rizniyarasheed/python
regularExpression/regex_prgrm4.py
regex_prgrm4.py
py
407
python
en
code
0
github-code
13
35661790125
import sys import os from sklearn.feature_extraction.text import CountVectorizer def main(): sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from keras_en_parser_and_analyzer.library.dl_based_parser import ResumeParser from keras_en_parser_and_analyzer.library.utility.io_utils import read_p...
mohancm/android_kernel_wiko_fever
demo/dl_based_parser_predict.py
dl_based_parser_predict.py
py
2,089
python
en
code
2
github-code
13
40967148094
import streamlit as st import app2 st.set_page_config( page_title="Blog Generator", page_icon="🐾", layout="centered") # Pages as key-value pairs PAGES = { "Blog Generator": app2 } st.sidebar.title('Go to:') selection = st.sidebar.radio("", list(PAGES.keys())) page = PAGES[selection]...
RajanGoyal1002/Blog_GPT-3
gpt_app.py
gpt_app.py
py
338
python
en
code
0
github-code
13
24619359045
""" Implement CORDEX specific DRS scheme. """ import re import os from drslib.drs import BaseDRS, DRSFileSystem, _ensemble_to_rip, _rip_to_ensemble from drslib import config from drslib.exceptions import TranslationError class CordexDRS(BaseDRS): DRS_ATTRS = [ 'activity', 'product', 'domain', 'institu...
ESGF/esgf-drslib
drslib/cordex.py
cordex.py
py
5,005
python
en
code
1
github-code
13
35514297324
from django.contrib.auth import authenticate, login, logout from django.db import IntegrityError from django.http import HttpResponse, HttpResponseRedirect # I want to use the "redirect" function (source: https://youtu.be/8kBo91L8JTY ) from django.shortcuts import render, redirect from django.urls import reverse # Th...
eduardoluis11/commerce
auctions/views.py
views.py
py
78,265
python
en
code
0
github-code
13
31045830723
#-*- codeing=utf-8 -*- #@time: 2020/9/29 15:45 #@Author: Shang-gang Lee from sklearn.ensemble import RandomForestClassifier from sklearn.datasets import load_iris import matplotlib.pyplot as plt from sklearn.model_selection import GridSearchCV import pandas as pd data,label=load_iris(return_X_y=True) RFC=RandomForest...
shanggangli/Machine-learning
fine-tuning-ensemble/fine-tuning-max_feature-RFC.py
fine-tuning-max_feature-RFC.py
py
1,532
python
en
code
0
github-code
13
73640665937
from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver import ChromeOptions from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service from time import sleep class Data : def __init__(self,url): self.url =...
ChoukriLach/Github-Scraping
Data.py
Data.py
py
1,581
python
en
code
0
github-code
13
4249333857
from typing import Optional, Any, List, Type, TypeVar, Union from app.exceptions import * from aiogoogle import Aiogoogle from app.core.config import settings from app.providers.google.utills import build_client_creds, build_aiogoogle from bson.objectid import ObjectId from app.database import get_db from app.services....
Grinnbob/g_theclone
app/services/admin_dashboard_service.py
admin_dashboard_service.py
py
9,631
python
en
code
0
github-code
13
40430963649
def adunare2(): print("Introduceti va rog un numar de doua cifre:") a = int(input()) z = a // 10 u = a % 10 print("Numarul rezultat prin adunarea zecilor si a unitatilor este:", z+u) def adunare3(): print("Introduceti va rog un numar de trei cifre:") a = int(input()) ...
Gabi273/python
proiecte-main/exercitii.py
exercitii.py
py
1,478
python
ro
code
0
github-code
13