seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
42775151544
from .models import ( ActionList, Action, ExpectList, Expect, ExportDict, SkipIfList, SkipIf, ) from .validators import validate_boolean, validate_conditionals,validate_export_dict class ArgType: type = lambda value: value # noqa value = None class UsingArgType(ArgType): typ...
rochacbruno/ansible-test
ansible-test/plugins/module_utils/arg_types.py
arg_types.py
py
4,795
python
en
code
2
github-code
36
[ { "api_name": "models.ActionList", "line_number": 41, "usage_type": "name" }, { "api_name": "models.Action.Config", "line_number": 63, "usage_type": "attribute" }, { "api_name": "models.Action", "line_number": 63, "usage_type": "name" }, { "api_name": "models.Acti...
32422202346
import wolframalpha import pprint import json class WolframAlpha: def __init__(self, appId): self.__client = wolframalpha.Client(appId) self.__prettyPrinter = pprint.PrettyPrinter() self.__pp = self.__prettyPrinter.pprint def question(self, query): if len(query.strip()) == 0: return "Ask me a question...
IntercraftMC/InterCraftBot_Deprecated
src/modules/wolframalpha.py
wolframalpha.py
py
1,122
python
en
code
0
github-code
36
[ { "api_name": "wolframalpha.Client", "line_number": 8, "usage_type": "call" }, { "api_name": "pprint.PrettyPrinter", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 26, "usage_type": "call" } ]
42366591652
from email.mime import base from AES_encipher import CTR_Mode from OAEP import * from RSA_key_gen import AES_key_gen from utility import bit_size import base64 from math import ceil class data_msg: """ Class that holds the values used in the data transfer. """ def __init__(self, signature: bytes = None, msg: ...
Cezari0o/Gerador-Assinaturas-RSA
data_msg.py
data_msg.py
py
3,301
python
en
code
0
github-code
36
[ { "api_name": "base64.b64decode", "line_number": 27, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 36, "usage_type": "call" }, { "api_name": "utility.bit_size", "line_number": 36, "usage_type": "call" }, { "api_name": "base64.b64encode", "l...
75220903145
import argparse from . import test_data from .. import music from .. import key_recognition def parse_args(): parser = argparse.ArgumentParser( description='Test getting key from sounds') parser.add_argument('--verbose_factor_threshold', '-Vft', required=False, ...
JakubBilski/tonations-recognition
src/tests/key_from_sounds_test.py
key_from_sounds_test.py
py
2,381
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" } ]
23403442036
import random import pygame from pygame.locals import * import logging import numpy as np import itertools # logging.basicConfig(filename = 'Result.log', level=logging.INFO) # copy Rohit Agrawal's work and modify for py_game version. It doesn't work really well but the concept has been applied. pygame.init() BLUE =...
nguyenkhanhhung91/Python_ReinforcementLearning
HumanVsQlearningBot.py
HumanVsQlearningBot.py
py
6,564
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.font.SysFont", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pygame.display.set_m...
73065938023
# Script: 14 - Python Malware Analysis # Author: Robert Gregor # Date of latest revision: 302030FMAR23 # Objectives # Perform an analysis of the Python-based code given below # Insert comments into each line of the script explaining in your own words what the virus is doing on this line # Insert co...
RobG-11/Ops301-Code-Challenges
14_malware_analysis.py
14_malware_analysis.py
py
4,617
python
en
code
0
github-code
36
[ { "api_name": "os.listdir", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", "line_number": 43, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_num...
30332494769
import streamlit as st import pandas as pd import numpy as np import re import emoji import io from collections import Counter import datetime import plotly.express as px from numpy import random from multiprocessing.dummy import Pool as ThreadPool from wordcloud import WordCloud, STOPWORDS from vaderSentiment.vaderSen...
RawRapter/Chat-Analytics-Dashboard
chat_analyze.py
chat_analyze.py
py
11,100
python
en
code
0
github-code
36
[ { "api_name": "streamlit.set_page_config", "line_number": 18, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 31, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 33, "usage_type": "call" }, { "api_name": "streamli...
37760975497
from rest_framework import renderers from teslacoil.encoders import TeslaEncoder class TeslaRenderer(renderers.JSONRenderer): encoder_class = TeslaEncoder def render(self, data, accepted_media_type=None, renderer_context=None): model = renderer_context['view'].model model_admin = renderer_co...
celerityweb/django-teslacoil
teslacoil/renderers.py
renderers.py
py
614
python
en
code
5
github-code
36
[ { "api_name": "rest_framework.renderers.JSONRenderer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.renderers", "line_number": 5, "usage_type": "name" }, { "api_name": "teslacoil.encoders.TeslaEncoder", "line_number": 7, "usage_type": "name...
39056132329
from numpy import genfromtxt,linspace, meshgrid,c_,where from mudpy.view import plot_grd from matplotlib import pyplot as plt from scipy.interpolate import griddata fault=genfromtxt('/Users/dmelgar/Slip_inv/Melinka_usgs/output/inverse_models/models/gsi_vr2.6.0011.inv.total') grdfile='/Users/dmelgar/code/GMT/Melinka/l...
Ogweno/mylife
Melinka/get_avg_locking.py
get_avg_locking.py
py
1,173
python
en
code
0
github-code
36
[ { "api_name": "numpy.genfromtxt", "line_number": 6, "usage_type": "call" }, { "api_name": "mudpy.view.plot_grd", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.cm", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotli...
5216881963
#!/usr/bin/env python3 import sys from functools import reduce import math def sum(nums): return reduce(lambda x, y: x + y, nums, 0) def avg(nums): return sum(nums) / len(nums) def stddev(nums): numerator = reduce(lambda x, y: (y - avg(nums))*(y - avg(nums)) + x, nums, 0) return math.sqrt(numerator / (len(n...
lawrencetheabhorrence/Data-Analysis-2020
hy-data-analysis-with-python-2020/part02-e05_summary/src/summary.py
summary.py
py
759
python
en
code
0
github-code
36
[ { "api_name": "functools.reduce", "line_number": 8, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 14, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.argv", "line_numbe...
34983405141
#!/usr/bin/env python3 import pyowm from pyowm.exceptions import OWMError import sys, argparse from datetime import datetime import os #os.environ['OPENWEATHER_API_KEY'] = 'aa1ab6974298fc6bf7303d6a22e073f9' #os.environ['CITY_NAME'] = 'Honolulu' def main(argv): parser = argparse.ArgumentParser() parser.add_arg...
vasooo/pannet
exercise_1/getweather.py
getweather.py
py
1,169
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pyowm.OWM", ...
16098074633
from selenium import webdriver from webdriver_manager.firefox import GeckoDriverManager # The Webdriver import pyautogui # To Click import time # To wait and all custom_site = input("Enter The Website to Download Video...") # Take the youtube video link as the input driver = webdriver.Firefox(executa...
JhaRishikesh/Projects
YouTube Downloader.py
YouTube Downloader.py
py
1,902
python
en
code
0
github-code
36
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "webdriver_manager.firefox.GeckoDriverManager", "line_number": 6, "usage_type": "call" }, ...
34102793225
import pyperclip, shelve, sys mcbShelf = shelve.open('mcb') #сохранятся содержимое буфера обмена if len(sys.argv)==3 and sys.argv[1].lower() == 'save': mcbShelf[sys.argv[2]] = pyperclip.paste() print(sys.argv) elif len(sys.argv) == 2: if sys.argv[1].lower() == 'list': pyperclip.copy(str(list(mcbS...
alex3287/PyCharmProjects
a_b_s/bufer.py
bufer.py
py
555
python
ru
code
1
github-code
36
[ { "api_name": "shelve.open", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pyperclip.paste", "line_numb...
33293843048
import pandas as pd import requests from io import StringIO import plotly.express as px import plotly.graph_objects as go import seaborn as sns import streamlit as st from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split from sklearn.svm import SVC from sklearn....
Tudor1415/mlsandbox
main.py
main.py
py
8,562
python
en
code
0
github-code
36
[ { "api_name": "sklearn.model_selection.train_test_split", "line_number": 38, "usage_type": "call" }, { "api_name": "streamlit.cache", "line_number": 33, "usage_type": "attribute" }, { "api_name": "streamlit.slider", "line_number": 41, "usage_type": "call" }, { "ap...
14075716492
import matplotlib matplotlib.rc('text', usetex = True) from pylab import * import os #Use the dt distributions from Crescent City #tide gauge to make example plots d = loadtxt('cumulative_probs.yearly.100.txt') figure(1,(12,9)) clf() axes((.1,.1,.8,.38)) #Add 1.13 to get s referenced to MSL s = d[:,0] - 2. +1.13 p...
rjleveque/pattern-method-paper
programs/tidepofzeta_dt.py
tidepofzeta_dt.py
py
1,796
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.rc", "line_number": 2, "usage_type": "call" } ]
37662096318
from PyQt5.QtWidgets import QLineEdit, QToolButton, QWidget, QFileDialog, QDialog, QTreeWidget, QRadioButton, QTreeWidgetItem, QTabWidget, QLabel, QCheckBox, QPushButton, QMessageBox from pulse.utils import error from os.path import basename from PyQt5.QtGui import QIcon from PyQt5.QtGui import QColor, QBrush from PyQt...
atbrandao/OpenPulse_f
pulse/uix/user_input/plotAcousticFrequencyResponseInput.py
plotAcousticFrequencyResponseInput.py
py
13,604
python
en
code
null
github-code
36
[ { "api_name": "numpy.max", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.searchsorted", "line_number": 38, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.legend", "line_number": 46, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
6689931275
import json import os from signal import SIGKILL from statistics import mean from typing import List, Optional from sebs.cache import Cache from sebs.local.function import LocalFunction from sebs.storage.minio import Minio, MinioConfig from sebs.utils import serialize, LoggingBase class Deployment(LoggingBase): ...
spcl/serverless-benchmarks
sebs/local/deployment.py
deployment.py
py
4,773
python
en
code
97
github-code
36
[ { "api_name": "sebs.utils.LoggingBase", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.List", ...
27632896757
import socket import gui.main_gui as main_gui import configparser import lib.package from PyQt5 import QtWidgets from PyQt5.QtWidgets import QMessageBox from game_class import Game_class """ Загрузка параметров """ config = configparser.ConfigParser() config.read("config.ini") #Главное окно class MainApp(QtWidgets.QM...
Arrakktur/game
client_game/main_class.py
main_class.py
py
4,540
python
ru
code
0
github-code
36
[ { "api_name": "configparser.ConfigParser", "line_number": 10, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 14, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 14, "usage_type": "name" }, { "api_na...
70188062823
#animation ICMECAT rose scatter plot with HI CME circles and in situ data from scipy import stats import scipy.io from matplotlib import cm import sys import os import matplotlib import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np import sunpy.time import time import pickle import sea...
cmoestl/heliocats
scripts/icmecat_anim_circles_insitu_final_full.py
icmecat_anim_circles_insitu_final_full.py
py
23,948
python
en
code
10
github-code
36
[ { "api_name": "scipy.io.readsav", "line_number": 22, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 22, "usage_type": "attribute" }, { "api_name": "scipy.io.readsav", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.io", "line_...
30494220256
import pandas as pd import numpy as np import tensorflow as tf import time import os import csv from sklearn.preprocessing import MinMaxScaler from keras.layers import Input from keras.layers import Dense, LSTM, Dropout, Embedding, Input, Activation, Bidirectional, TimeDistributed, RepeatVector, Flatten from k...
MeichenBu/2018-2019-SURF
CNN+LSTM/LSTM_old.py
LSTM_old.py
py
7,596
python
en
code
0
github-code
36
[ { "api_name": "keras.optimizers.Adam", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
4724184190
import sys sys.path.append('/usr/local/lib/python3.7/site-packages') import mido import time outport = mido.open_output('VirtualDevice Bus 1') note_sequence = [57, 59, 60, 62, 57, 59, 55, 57] for note in note_sequence: time.sleep(0.25) outport.send(mido.Message('note_on', note=note, velocity = 100)) tim...
krispenney/midi
test.py
test.py
py
404
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "mido.open_output", "line_number": 7, "usage_type": "call" }, { "api_name": "time.sleep", "line_nu...
14640804692
import logging import logging.handlers from flask import Flask, render_template, redirect, request from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, UserMixin, login_user, login_required, logout_user, current_user from forms import LoginForm, PaymentForm, PasswordForm, OccalcForm, ApikeyForm...
realname0000/torn_game_metrics
flask_graph_work/app.py
app.py
py
84,701
python
en
code
0
github-code
36
[ { "api_name": "re.numeric", "line_number": 22, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 22, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 23, "usage_type": "call" }, { "api_name": "re.compile", "line_number":...
4833398186
import re import json import numbers import numpy as np class Composition(): __atom_mass = { # From NIST, "https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=&all=all&isotype=some" 'neutron': 1.00866491595, 'proton': 1.007276466621, 'electron': 0.000548579909065, ...
AmadeusloveIris/GraphNovo
genova/utils/BasicClass.py
BasicClass.py
py
10,351
python
en
code
6
github-code
36
[ { "api_name": "re.findall", "line_number": 26, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 29, "usage_type": "call" }, { "api_name": "numbers.Integral", "line_number": 69, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_nu...
15719814735
from PyQt5.QtWidgets import QCheckBox, QDialog, QDialogButtonBox, QTextEdit from PyQt5.QtCore import Qt from PyQt5.QtGui import QFont from src.logic import QFrameBase, error_dialog from src.frames.default import Ui_FrameDefault from src.frames.utils.info import Ui_FrameInfo from src.frames.utils.kde import Ui_FrameKd...
qooteen/health-weather_correlation-master
src/logic/utils.py
utils.py
py
17,580
python
ru
code
0
github-code
36
[ { "api_name": "src.logic.QFrameBase", "line_number": 21, "usage_type": "name" }, { "api_name": "src.frames.default.Ui_FrameDefault", "line_number": 21, "usage_type": "name" }, { "api_name": "src.logic.QFrameBase.__init__", "line_number": 79, "usage_type": "call" }, { ...
40943557380
from ruamel.yaml import YAML from datetime import datetime from common import * import sys def main(): fn = 'data/races.yaml' if len(sys.argv) > 1: fn = sys.argv[1] yaml = YAML(typ='safe') with open(fn, 'r') as fi: ydat = yaml.load(fi) prev_date = None for race in ydat['races...
pkdawson/workrobot
print_schedule.py
print_schedule.py
py
717
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "ruamel.yaml.YAML", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.fromiso...
70471621543
# TODO : TRANSFORM INTO A CLASS AND CREATE A REPORT OF REGION TRIMMED #~~~~~~~GLOBAL IMPORTS~~~~~~~# # Standard library packages import from os import remove, path import gzip from time import time from sys import stdout # Third party package import from Bio import SeqIO # Local library packages import from pyDNA.U...
a-slide/pyDNA
RefMasker.py
RefMasker.py
py
3,819
python
en
code
1
github-code
36
[ { "api_name": "pyDNA.Utilities.mkdir", "line_number": 51, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
1239251599
from django.shortcuts import render from django.views.generic import View from django.http import JsonResponse from application.chart.models.chart import TopPosts_MH, TopPosts_WH, TopPosts_PVN, TopPosts_RW, TopPosts_BI, TopPosts_ROL, TopPosts_WE class GetTopPosts(View): def get(self, request): models_map =...
jialinzou/DjangoDashboard
application/chart/views/get_top_posts.py
get_top_posts.py
py
1,005
python
en
code
7
github-code
36
[ { "api_name": "django.views.generic.View", "line_number": 6, "usage_type": "name" }, { "api_name": "application.chart.models.chart.TopPosts_WH", "line_number": 9, "usage_type": "name" }, { "api_name": "application.chart.models.chart.TopPosts_MH", "line_number": 10, "usage...
43639712257
import os from hashlib import md5 from bson.objectid import ObjectId import datetime as dt import re def all_files(path): files = [] with os.scandir(path) as entries: for entry in entries: entry_path = os.path.abspath(entry) if entry.is_file() and os.path.splitext(entry_path)[...
blry/docker-flask-mongodb-uwsgi-nginx
parser/project/utils.py
utils.py
py
1,316
python
en
code
3
github-code
36
[ { "api_name": "os.scandir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "line_...
21618567791
from __future__ import absolute_import import logging import time import unittest from hamcrest.core.core.allof import all_of from nose.plugins.attrib import attr from apache_beam.examples import wordcount from apache_beam.testing.pipeline_verifiers import FileChecksumMatcher from apache_beam.testing.pipeline_verifi...
a0x8o/kafka
sdks/python/apache_beam/examples/wordcount_it_test.py
wordcount_it_test.py
py
2,483
python
en
code
59
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "apache_beam.examples.wordcount.run", "line_number": 29, "usage_type": "attribute" }, { "api_name": "apache_beam.examples.wordcount", "line_number": 29, "usage_type": "name" ...
9454038158
# coding: utf-8 # Credits : https://gist.github.com/jason-w/4969476 from typing import List, Dict, Any from mongoengine import ( Document, ListField, EmbeddedDocumentField, DictField, EmbeddedDocument, FloatField, DateTimeField, ComplexDateTimeField, IntField, BooleanField, ...
nicolasjlln/lbc-challenge
app/database/utils.py
utils.py
py
3,396
python
en
code
0
github-code
36
[ { "api_name": "mongoengine.QuerySet", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.List", "line_...
23966001733
# coding=utf-8 import pytest from mockito import expect, mock, verify, verifyNoUnwantedInteractions, verifyStubbedInvocationsAreUsed, when # noinspection PyProtectedMember from elib_run._run import _run @pytest.mark.parametrize( 'mute', [True, False] ) def test_exit(mute, caplog): caplog.set_level(10, ...
theendsofinvention/elib_run
test/test_run.py
test_run.py
py
3,523
python
en
code
0
github-code
36
[ { "api_name": "mockito.mock", "line_number": 17, "usage_type": "call" }, { "api_name": "mockito.mock", "line_number": 21, "usage_type": "call" }, { "api_name": "mockito.when", "line_number": 24, "usage_type": "call" }, { "api_name": "pytest.raises", "line_numb...
14838347473
import re import nltk import spacy from nltk import Tree from nltk.corpus import brown sentence = "A solution of piperidin-4-ol (100 mg, 0.989 mmol) and 3-((phenylsulfonyl)methylene)oxetane (prepared according to a published literature procedure: Wuitschik et al. J. Med. Chem. 53(8) 3227-3246, 2010, 416 mg, 1.977 mmo...
arrafmousa/generate_code
custom_tags.py
custom_tags.py
py
2,826
python
en
code
0
github-code
36
[ { "api_name": "re.findall", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.Tree", "line_number": 34, "usage_type": "call" }, { "api_name": "nltk.Tree", "line_number": 37, "usage_type": "call" }, { "api_name": "nltk.Tree", "line_number": 38, ...
72774806185
from typing import Any, Dict, List, TypedDict import torch as th from tango.integrations.torch import DataCollator from tango.integrations.transformers import Tokenizer from dreambooth.steps.transform_data import PreprocessedExample class BatchExample(TypedDict): input_ids: th.Tensor pixel_values: th.Tensor...
shunk031/tango-dreambooth
dreambooth/integrations/torch/data_collator.py
data_collator.py
py
1,556
python
en
code
0
github-code
36
[ { "api_name": "typing.TypedDict", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.Tensor", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tango.integratio...
39665406570
import gzip import sys from SPARQLWrapper import SPARQLWrapper, JSON import gzip from bs4 import BeautifulSoup import re import spacy from spacy import displacy from collections import Counter import en_core_web_md import difflib import requests import json from elasticsearch import Elasticsearch nlp = en_core_web_md.l...
SummerXIATIAN/wdps_asg1_group27
code_es.py
code_es.py
py
5,220
python
en
code
0
github-code
36
[ { "api_name": "en_core_web_md.load", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 49, "usage_type": "call" }, { "api_name": "re.split", "line_number": 54, "usage_type": "call" }, { "api_name": "re.sub", "line_num...
35798383779
from time import perf_counter import numpy as np import matplotlib.pyplot as plt #The program uses the Velocity Verlet method to simulate the #perihelion percession of Mercury over TT years divided into n #time steps. In order to avoid problems with insuficient compter #memory, one year at the time is simulated. When...
abjurste/A19-FYS4150
Project5/Project5g.py
Project5g.py
py
7,275
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
22355127515
import ast import os import pathlib import tempfile from typing import Tuple from mlrun import MLClientCtx from mlrun.package.packagers.python_standard_library_packagers import ( BoolPackager, BytearrayPackager, BytesPackager, DictPackager, FloatPackager, FrozensetPackager, IntPackager, ...
mlrun/mlrun
tests/package/packagers_testers/python_standard_library_packagers_testers.py
python_standard_library_packagers_testers.py
py
27,189
python
en
code
1,129
github-code
36
[ { "api_name": "tests.package.packager_tester.PackagerTester", "line_number": 50, "usage_type": "name" }, { "api_name": "mlrun.package.packagers.python_standard_library_packagers.NonePackager", "line_number": 55, "usage_type": "call" }, { "api_name": "tests.package.packager_tester...
40851263636
import json def help(): helpprint = print(""" addcoins: plus Your coins. minuscoins: minus Your coins. help: shows this list. coins: Shows how many coins do you have """) main() def checkbalance(): with open('coins.json','r') as f: get_balance = json.loads(f....
hahayeslol12/CoinScript
main.py
main.py
py
1,455
python
en
code
0
github-code
36
[ { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 35, "usage_type": "call" }, { "api_name": "json.load", "line_number": 42, ...
29654851332
""" A python program that scrapes news articles, classifies their sentiment, and creates a time series of sentiment over time """ import os import openai # Set OpenAI API key from environment openai.api_key = os.environ.get('OPENAI_API_KEY', '') def classify(query, search_model="ada", model="davinci"): openai.Cla...
candiceevemiller/company-sentiment-analysis
main.py
main.py
py
752
python
en
code
0
github-code
36
[ { "api_name": "openai.api_key", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "openai.Classification...
74470182182
import unittest import mock import openstack.common.context from openstack.common.middleware import context class ContextMiddlewareTest(unittest.TestCase): def test_process_request(self): req = mock.Mock() app = mock.Mock() options = mock.MagicMock() ctx = mock.sentinel.context...
emonty/openstack-common
tests/unit/middleware/test_context.py
test_context.py
py
2,329
python
en
code
1
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "mock.Mock", "line_number": 13, "usage_type": "call" }, { "api_name": "mock.Mock", "line_number": 14, "usage_type": "call" }, { "api_name": "mock.MagicMock", "line...
494409517
# pylint doesn't understand pytest fixtures # pylint: disable=unused-argument from click.testing import CliRunner from dagster_airflow.cli import scaffold def test_build_dags(clean_airflow_home): '''This test generates Airflow DAGs for several pipelines in examples/toys and writes those DAGs to $AIRFLOW_HOME...
helloworld/continuous-dagster
deploy/dagster_modules/dagster-airflow/dagster_airflow_tests/test_build_dags.py
test_build_dags.py
py
1,760
python
en
code
2
github-code
36
[ { "api_name": "click.testing.CliRunner", "line_number": 18, "usage_type": "call" }, { "api_name": "dagster_airflow.cli.scaffold", "line_number": 41, "usage_type": "argument" }, { "api_name": "airflow.models.DagBag", "line_number": 46, "usage_type": "call" } ]
10315136743
from __future__ import print_function import sys import mdtraj as md from simtk.openmm import app import simtk.openmm as mm from simtk import unit import argparse class Tee(object): def __init__(self, name, mode): self.file = open(name, mode) self.stdout = sys.stdout def write(self, data): ...
vivek-bala/adaptive-msm-openmm
entk2/fs-peptide/simulate-fs.py
simulate-fs.py
py
2,035
python
en
code
0
github-code
36
[ { "api_name": "sys.stdout", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 20, "usage_type": "attribute" }, { "api_name": "mdtraj.load", "line_number": 24, "usage_type": "call" }, { "api_name": "simtk.openmm.app.ForceField...
5134070317
from PyQt5.QtWidgets import QListWidget, QListWidgetItem from PyQt5.QtWidgets import QWidget, QVBoxLayout from whispering_assistant.window_managers.windows.base_window_template import BaseWindowTemplate class ChoiceWindow(BaseWindowTemplate): def __init__(self, parent=None, choices=[], process_cb=None): ...
engrjabi/WhisperingAssistant
whispering_assistant/window_managers/windows/choice_window.py
choice_window.py
py
1,535
python
en
code
2
github-code
36
[ { "api_name": "whispering_assistant.window_managers.windows.base_window_template.BaseWindowTemplate", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "li...
43678975341
# importing the requests library import requests import time # defining the api-endpoint URL = "http://127.0.0.1:5000/add" # data to be sent to api PARAMS = { 'TimeStamp':time.time(), 'Temp1':'24.00', 'Temp2':'24.00', 'TAmbiant':'23.00', 'Humidity':'35'} # sending ...
mh49/HSTM
test_tools/post.py
post.py
py
548
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 16, "usage_type": "call" } ]
323540718
# -*- coding: utf-8 -*- """Console script for mcc.""" import os import click from pydub import AudioSegment from pydub.silence import split_on_silence @click.command() @click.argument('sound_path') @click.option('--mls', default=500, help='沉默的时长,毫秒') @click.option('--st', default=-30, help='无声的界限,如果比这个数值更小则认为是无声') @...
nanke-ym/mcc
mcc/split.py
split.py
py
1,227
python
en
code
0
github-code
36
[ { "api_name": "pydub.AudioSegment.from_wav", "line_number": 18, "usage_type": "call" }, { "api_name": "pydub.AudioSegment", "line_number": 18, "usage_type": "name" }, { "api_name": "pydub.silence.split_on_silence", "line_number": 19, "usage_type": "call" }, { "api...
44395709703
import torch import numpy as np from book.pytorch.utils.helper import get_mnist_loader import torch.nn.functional as F from torch import nn import matplotlib.pyplot as plt class ConvDenoiser(nn.Module): def __init__(self, encoding_dim): super(ConvDenoiser, self).__init__() # encoder layers ...
jk983294/morph
book/pytorch/autoencoder/cnn_denoise.py
cnn_denoise.py
py
4,398
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
718069407
from django.db import models from django.contrib.auth.models import User from django.db.models.query import ModelIterable from django.db.models.signals import post_save, post_init import requests import random def sendNotification(usertoken, title, body): userdata = { "to": str(usertoken), "notif...
haydencordeiro/FoodDeliveryDjango
food/models.py
models.py
py
7,454
python
en
code
1
github-code
36
[ { "api_name": "requests.post", "line_number": 26, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 30, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 30, "usage_type": "name" }, { "api_name": "django.db....
10556749786
import serial import tkinter from tkinter import* TTY_DEVICE = "COM" s=serial.Serial() def init(port,text2): global s try: s=serial.Serial(TTY_DEVICE + str(port), 115200, timeout=10) print('connect com'+str(port)) text2.configure(state=tkinter.NORMAL) text2.insert(1.0,'connect...
Zealua/PythonFirstTest
GUI/GUI_VGH/driver/comPort.py
comPort.py
py
1,363
python
en
code
0
github-code
36
[ { "api_name": "serial.Serial", "line_number": 7, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 12, "usage_type": "call" }, { "api_name": "tkinter.NORMAL", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tkinter.DISABLED", ...
72053024743
import numpy as np from scipy.optimize import fsolve import matplotlib.pyplot as plt from mars import Mars emissivity_dessert = 0.5 emissivity_PV = 0.5 absorptivity_dessert = 0.5 absorptivity_PV = 0.5 delta_time = 24 * 60 * 60 f = 0.15 cp = 1 T_Atmosphere = 200 rho = 1 num_days = 700 # formula not given. Just a plac...
muedavid/Mars
main.py
main.py
py
1,207
python
en
code
0
github-code
36
[ { "api_name": "mars.Mars", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.cos", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 25, ...
37779455706
import json from datetime import datetime as dt from datetime import date as dto import copy class ProcessJsonPortfolio: def calculate_average_price(self, _dict): """Calculate dollar cost average per security. Args: _dict (:obj:`dict`): Portfolio loaded from json. Re...
lzy7071/portfolio_tools
portfolio_tools/util/process_json_portfolio.py
process_json_portfolio.py
py
1,929
python
en
code
0
github-code
36
[ { "api_name": "copy.deepcopy", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 44, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 44, "usage_type": "name" }, { "api_name": "datetime.datetime.str...
31279947642
from ray import serve from typing import List, Dict import json import numpy as np from scipy.optimize import linprog @serve.deployment(num_replicas=1, ray_actor_options={"num_cpus": 1, "num_gpus": 0}) class LinearProgrammingService(object): # def __init__(self): def LinearProgramming(self, body: Dict): ...
tju-hwh/Yet-Another-Serverless-Benchmark
solver/ray_stateful/so/service/linear_programming.py
linear_programming.py
py
1,180
python
en
code
0
github-code
36
[ { "api_name": "typing.Dict", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.optimize.linprog", "line_number": 31, "usage_type": "call" }, { "api_name": "ray.serve.deployment",...
40761385267
import os import sys FILE_DIR = os.path.dirname(os.path.abspath(__file__)) # PROJ_DIR = FILE_DIR[:FILE_DIR.index('src')] # sys.path.append(PROJ_DIR) PROJ_DIR = os.path.abspath("..") print(f"proj_dir is: {PROJ_DIR}, adding to sys.path") import torch import torch.nn as nn import torch.optim as optim import torch.nn.fu...
Qing25/demo
conditional_generation/frame.py
frame.py
py
9,872
python
en
code
8
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.abspath", "line...
5460426589
from functools import partial from ._derived import Derived from . import utilities class Operation(Derived): __slots__ = ('opkwargs', 'opfn') def __init__(self, *terms, op = None, **kwargs, ): if type(op) is tuple: sops, op = op[:-1], op[-1...
lmoresi/funcy
funcy/_operation.py
_operation.py
py
972
python
en
code
0
github-code
36
[ { "api_name": "_derived.Derived", "line_number": 6, "usage_type": "name" }, { "api_name": "functools.partial", "line_number": 20, "usage_type": "call" } ]
15826790722
# Standard imports import copy import pandas as pd import logging import jsonpickle as jpickle import sklearn.cluster as sc # Our imports import emission.storage.timeseries.abstract_timeseries as esta import emission.analysis.modelling.tour_model.get_scores as gs import emission.analysis.modelling.tour_model.get_user...
e-mission/e-mission-server
emission/analysis/modelling/tour_model/build_save_model.py
build_save_model.py
py
7,787
python
en
code
22
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "jsonpickle.dumps", "line_number": 41, "usage_type": "call" }, { "api_name": "emission.storage.timeseries.abstract_timeseries.TimeSeries.get_uuid_list", "line_number": 48, "usage_typ...
15207404869
# 最短距离算法 import networkx as nx debug = False start_node = ('start', -1) # 初始节点 end_node = ('end', -1) # 终止节点 def fmt_edges(points, max_score=1.): """将节点得分列表格式化成距离矩阵 :param points list[[left, right, score]] :return edges [(node_id1, node_id2, score)] :return nodes [(left, right)] """ ...
ibbd-dev/python-ibbd-algo
ibbd_algo/shortest_distance.py
shortest_distance.py
py
2,510
python
en
code
1
github-code
36
[ { "api_name": "networkx.DiGraph", "line_number": 61, "usage_type": "call" }, { "api_name": "networkx.dijkstra_path", "line_number": 63, "usage_type": "call" } ]
19022803935
from aiogram.types import ( InlineKeyboardMarkup, InlineKeyboardButton, ReplyKeyboardMarkup, KeyboardButton, ) from main import admins_id from utils.db_api.schemas.table_db import session, Contest kb = ReplyKeyboardMarkup(resize_keyboard=True) kb.add(KeyboardButton("Добавить конкурс")).add(...
A-Sergey/TelegramBot_Contest
keyboards/buttons.py
buttons.py
py
1,574
python
en
code
0
github-code
36
[ { "api_name": "aiogram.types.ReplyKeyboardMarkup", "line_number": 11, "usage_type": "call" }, { "api_name": "aiogram.types.KeyboardButton", "line_number": 12, "usage_type": "call" }, { "api_name": "aiogram.types.ReplyKeyboardMarkup", "line_number": 14, "usage_type": "call...
3680795220
import numpy as np import cv2 import math import subprocess import shutil import os if not os.path.exists('/home/martin/fotos'): os.makedirs('/home/martin/fotos') image_sudoku_original = cv2.imread('/home/martin/sudoku/sudoku_recognition/testing3.jpeg') cv2.imshow("Imagen original",image_sudoku_original) cv2.wai...
msampietro/sudoku_recognition
sudoku.py
sudoku.py
py
6,869
python
en
code
0
github-code
36
[ { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number":...
16835981819
import pytest from backend.utils.assertions import assert_equals, assert_true from backend.utils.helper import Helper from front.data_for_tests.calender_data_for_tests import DataForTests from front.pages.page import CalendarPage, CalendarConfiguration @pytest.mark.usefixtures("setup", "test_config") class TestCalen...
RivkaTestGit/MoonActive
front/tests/test_calender.py
test_calender.py
py
3,347
python
en
code
0
github-code
36
[ { "api_name": "front.pages.page.CalendarPage", "line_number": 15, "usage_type": "call" }, { "api_name": "backend.utils.helper.Helper.get_config_value_by_name", "line_number": 16, "usage_type": "call" }, { "api_name": "backend.utils.helper.Helper", "line_number": 16, "usag...
42243061570
import cant_utils as cu import numpy as np import matplotlib.pyplot as plt import glob import bead_util as bu import tkinter import tkinter.filedialog import os, sys from scipy.optimize import curve_fit import bead_util as bu from scipy.optimize import minimize_scalar as minimize import pickle as pickle import time #...
charlesblakemore/opt_lev_analysis
scripts/general_analysis/not_yet_updated/straighten_cantilever_withpower.py
straighten_cantilever_withpower.py
py
3,333
python
en
code
1
github-code
36
[ { "api_name": "bead_util.load_dir_file", "line_number": 20, "usage_type": "call" }, { "api_name": "cant_utils.Data_dir", "line_number": 62, "usage_type": "call" }, { "api_name": "cant_utils.simple_loader", "line_number": 63, "usage_type": "attribute" }, { "api_nam...
20760678532
from re import T from django.db import models from machine.computations.examples import victorious_payment from django.contrib.postgres.fields import ArrayField # Create your models here. class Machine(models.Model): def empty_list(): return list() # identificar la maquina que estamos usando na...
montenegrop/casinoGames
machine/models.py
models.py
py
1,286
python
en
code
0
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 15, "usage_type": "call" }, { "api_name"...
41240226723
# Importar Librerias import pandas as pd import json # Opening JSON file f = open('orderbooks_05jul21.json') print(f) # Returns JSON object as a dictionary orderbooks_data = json.load(f) ob_data = orderbooks_data['bitfinex'] # Drop Keys with none values ob_data = {i_key: i_value for i_key,i_value in ob...
if722399/Laboratorio-1-MySt-
dataa.py
dataa.py
py
578
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 17, "usage_type": "call" } ]
18200360642
import json import os import random import shutil from predictor import get_predictor from yolox.tracking_utils.timer import Timer import cv2 import numpy as np def get_gt_by_frame(bbox_file: str): gtByFrames = {} # convert to List[bboxes, List[int]] with open(bbox_file) as f: annot = json.load(f) ...
chenzhutian/nba-Player-classifier
generate_samples.py
generate_samples.py
py
4,488
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 34, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_number": ...
22700582787
import pathlib import json import numpy as np import pandas as pd from scipy.interpolate import SmoothBivariateSpline, UnivariateSpline import matplotlib as mpl import matplotlib.pyplot as plt from .common import Timer, Tools from .sim_ctr import RgbGrid from .sim_reduce import Steps, ReduceModel clas...
kailicao/mesa_apokasc
sim_synth.py
sim_synth.py
py
8,766
python
en
code
0
github-code
36
[ { "api_name": "sim_ctr.RgbGrid.MASS_LIST", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sim_ctr.RgbGrid", "line_number": 26, "usage_type": "name" }, { "api_name": "sim_ctr.RgbGrid.FEH_LIST", "line_number": 27, "usage_type": "attribute" }, { "api_...
496184917
# -*- coding: utf-8 -*- import time import click from click.testing import CliRunner from dagster_aws.cli.term import Spinner, Term def test_term(): def term_helper(term_cmd, prefix, exit_code=0): @click.command() def fn(): term_cmd('foo bar') runner = CliRunner() res...
helloworld/continuous-dagster
deploy/dagster_modules/libraries/dagster-aws/dagster_aws_tests/cli_tests/test_term.py
test_term.py
py
1,054
python
en
code
2
github-code
36
[ { "api_name": "click.command", "line_number": 11, "usage_type": "call" }, { "api_name": "click.testing.CliRunner", "line_number": 15, "usage_type": "call" }, { "api_name": "dagster_aws.cli.term.Term.error", "line_number": 21, "usage_type": "attribute" }, { "api_na...
32782552053
import logging import cabby from events.stix import parse_stix_package, STIXPackage def collect_indicator_packages(configuration: dict) -> STIXPackage: for repository in configuration['repositories']: yield from poll_repository(repository) def poll_repository(repository: dict) -> list: logging.deb...
noxdafox/iocep
events/taxii.py
taxii.py
py
1,252
python
en
code
0
github-code
36
[ { "api_name": "events.stix.STIXPackage", "line_number": 8, "usage_type": "name" }, { "api_name": "logging.debug", "line_number": 14, "usage_type": "call" }, { "api_name": "cabby.create_client", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.info...
21518376045
from __future__ import division import scipy.optimize import numpy as np import json import re import cv2 _BLACK = (0, 0, 0) _RED = (0, 0, 255) _BLUE = (255, 0, 0) _PURPLE = (204, 0, 153) _ORANGE = (51, 153, 255) _LBROWN = (0, 153, 230) keypoint_colors = { '1': _RED, '2': _RED, '3': _RED, '4': _RED, '5': _RED, ...
egoodman92/semi-supervised-surgery
MULTITASK_FILES/KEYPOINTS_FILES/surgery-hand-detection-new/scripts/filter_bootstrap.py
filter_bootstrap.py
py
8,359
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 75, "usage_type": "call" }, { "api_name": "numpy.full", "line_number": 76, "usage_type": "call" }, { "api_name": "numpy.concatenate", "lin...
23642938118
from flask import Flask,render_template,request,redirect,session,flash app = Flask(__name__) app.secret_key = 'Farn' @app.route ('/') def index(): return render_template('index.html') @app.route ('/result', methods=['POST']) def result(): if len(request.form['name']) < 1: flash("Name cannot be em...
bmcconchie/DojoAssignments
Python/Flask/python_stack/flask_fundamentals/dataform/server.py
server.py
py
946
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 2, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request...
17305255074
# -*- coding: utf-8 -*- """ Created on Tue Sep 7 17:46:55 2021 @author: Administrator """ import SimpleITK as sitk import numpy as np import os import cv2 from shutil import copyfile import random num=379 lists=['train_002_0000.nii.gz','train_019_0000.nii.gz','train_069_0000.nii.gz','train_101_0000.nii.gz','train_11...
xyndameinv/FLARE21
process0.py
process0.py
py
1,837
python
en
code
2
github-code
36
[ { "api_name": "shutil.copyfile", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "shutil.copyfile", "line...
31734592611
from modules import aws_sript, firestorage_code import os from flask import Flask, jsonify from flask import render_template, request, redirect, url_for from werkzeug.utils import secure_filename import os, shutil from flask_cors import CORS from decorater_file import crossdomain global app app = Flask(__name__) CORS...
akhlaq1/flask-aws-face-detect-api
app.py
app.py
py
2,784
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_...
20019809326
#file used to take screenshot to baseline rectangle mappings off of import cv2 cam = cv2.VideoCapture(0) result, image = cam.read() if result: cv2.imshow("img_to_map", image) cv2.imwrite("img_to_map.png", image) cv2.waitKey(0) cv2.destroyWindow("img_to_map") else: print("No image det...
thqtcher/physical-computing-final
app/config/python/screenshotter.py
screenshotter.py
py
346
python
en
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number...
7615563038
# -*- coding: utf-8 -- import re import math from multiprocessing import cpu_count, freeze_support from multiprocessing.pool import Pool import sys from util import read_text_lines from util import refine_line from char2vec import load_model B = 1 I = 0 ''' 1. word2vec 모델 불러오기(from char2vec) ''' def is_hangul(ch...
kimwansu/autospacing_tf
make_data.py
make_data.py
py
9,337
python
en
code
0
github-code
36
[ { "api_name": "re.sub", "line_number": 70, "usage_type": "call" }, { "api_name": "char2vec.load_model", "line_number": 97, "usage_type": "call" }, { "api_name": "char2vec.load_model", "line_number": 104, "usage_type": "call" }, { "api_name": "util.read_text_lines"...
74144288102
from django.core.management.base import BaseCommand import os from importlib import import_module from django.conf import settings from django.core.management import call_command from newapp.utils import get_app_template_path, get_app_templates APP_TEMPLATES = [ x.get('name') for x in get_app_templates() ] class Com...
freezmeinster/django-newapp
newapp/management/commands/newapp.py
newapp.py
py
2,670
python
en
code
0
github-code
36
[ { "api_name": "newapp.utils.get_app_templates", "line_number": 9, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 11, "usage_type": "name" }, { "api_name": "os.walk", "line_number": 20, "usage_type": "call" }, { "api...
43304002854
import sys, os import os.path import shutil from rpython.translator.translator import TranslationContext from rpython.translator.tool.taskengine import SimpleTaskEngine from rpython.translator.goal import query from rpython.translator.goal.timing import Timer from rpython.annotator.listdef import s_list_of_strings fro...
mozillazg/pypy
rpython/translator/driver.py
driver.py
py
24,503
python
en
code
430
github-code
36
[ { "api_name": "rpython.tool.ansi_print.AnsiLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ.copy", "line_number": 54, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 54, "usage_type": "attribute" }, { "api_name": "os...
72312960103
from typing import Dict, List, Optional, Tuple import numpy as np import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F from mmcv.utils import ConfigDict from mmdet.core import bbox2roi from mmdet.models.builder import HEADS from mmfewshot.detection.models.roi_heads.meta_rcnn_roi_...
csuhan/VFA
vfa/vfa_roi_head.py
vfa_roi_head.py
py
12,474
python
en
code
56
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
30039556459
import math import numpy as np from sympy import* import matplotlib.pyplot as plt class Solver: def __init__(self, f, t0, y0, h, nsteps, inital_points): self.f = f self.t0 = t0 self.y0 = y0 self.h = h self.nsteps = nsteps self.inital_points = inital_points; self.coef_ab = [ [1], [1], [3.0/2.0, ...
vserraa/Numerical-Methods
solver.py
solver.py
py
9,570
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 292, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 293, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 293, "usage_type": "name" }, { "api_name": "matplotlib.py...
10017544829
from core.celery import app from celery import Celery import json import subprocess import os from .models import Node, Offer from django.utils import timezone import tempfile import redis from .serializers import NodeSerializer, OfferSerializer import calendar import datetime import requests from api.serializers impor...
golemfactory/golem-stats-backend
stats-backend/api2/tasks.py
tasks.py
py
17,630
python
en
code
1
github-code
36
[ { "api_name": "redis.ConnectionPool", "line_number": 18, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Node.objects.filter", "line_number": 24, "usage_type": "call" }, { "api_name": "models.No...
18045830902
import numpy as np import matplotlib.pyplot as plt import pandas as pd def get_reward_curve(agents): """ Extract rewards from list of agents used in training :param agents: list of agents used in training :return: array of rewards """ return np.array([agent.reward_total for agent in agents]) ...
hmdmia/HighSpeedRL
backend/utils/analysis.py
analysis.py
py
7,951
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.convolve", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number...
10525922454
import copy import torch import torch.nn as nn from .backbone import * import numpy as np import torch.nn.functional as F import thop def ConvBNReLU(in_chann, out_chann, ks, st, p=1): return nn.Sequential( nn.Conv2d(in_chann, out_chann, kernel_size=ks, stride=st, padding=p, bias=False), nn.BatchNo...
yadongJiang/semantic-segmentation-projects
libs/cpnet/model.py
model.py
py
7,478
python
en
code
5
github-code
36
[ { "api_name": "torch.nn.Sequential", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
152948829
import PyQt6 import pandas as pd from PyQt6 import QtWidgets, QtGui, QtCore from PyQt6.QtCore import pyqtSignal, pyqtSlot, Qt from PyQt6.QtWidgets import QListWidget, QFileDialog from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg from matplotlib.figure import Figure from gui.HyperParamterWidget import Hy...
Falrach94/deeplearning_ex4
gui/MainWindow.py
MainWindow.py
py
26,881
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.backends.backend_qtagg.FigureCanvasQTAgg", "line_number": 26, "usage_type": "name" }, { "api_name": "matplotlib.figure.Figure", "line_number": 29, "usage_type": "call" }, { "api_name": "PyQt6.QtWidgets.QMainWindow", "line_number": 35, "usage_type...
69982633063
import torch import torch.nn as nn from torch.nn import functional as F import math from typing import Tuple device = "cuda" if torch.cuda.is_available() else "cpu" class Embedding(nn.Module): def __init__(self, config, vocab_size): """ Embedding generates le...
SkAndMl/MusGPT
model.py
model.py
py
6,552
python
en
code
3
github-code
36
[ { "api_name": "torch.cuda.is_available", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", ...
198794662
import abc from typing import Dict, List from uuid import UUID from moderation_ml_example.models import Post class PostNotFoundError(Exception): pass class PostRepository: __metaclass__ = abc.ABCMeta async def save(self, post: Post) -> None: ... async def get(self, id: UUID) -> Post: ...
mikeyjkmo/post-moderation-example
moderation_ml_example/repository.py
repository.py
py
1,156
python
en
code
0
github-code
36
[ { "api_name": "abc.ABCMeta", "line_number": 12, "usage_type": "attribute" }, { "api_name": "moderation_ml_example.models.Post", "line_number": 14, "usage_type": "name" }, { "api_name": "uuid.UUID", "line_number": 17, "usage_type": "name" }, { "api_name": "moderati...
14716003738
from sqlalchemy import create_engine, text, MetaData, Table, Column, Integer, String, select engine = create_engine('postgresql://postgres:1@localhost/news_db') meta = MetaData() students = Table( 'students', meta, Column('id', Integer, primary_key=True), Column('first_name', String), Column('last_na...
devabsaitov/self_study
sqlalchemy_lesson/Basic/7_using_aliases.py
7_using_aliases.py
py
494
python
en
code
0
github-code
36
[ { "api_name": "sqlalchemy.create_engine", "line_number": 3, "usage_type": "call" }, { "api_name": "sqlalchemy.MetaData", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlalchemy.Table", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlalchemy...
2926954909
import pandas as pd import numpy as np from multiprocessing.pool import ThreadPool from multiprocessing import cpu_count import operator from collections import OrderedDict import itertools import time from sklearn.metrics import accuracy_score import visualization visuals = visualization.Visualization() ...
aditya-srikanth/Data-Mining-Assignment-3
LOF.py
LOF.py
py
5,514
python
en
code
0
github-code
36
[ { "api_name": "visualization.Visualization", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 45, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 50, "usage_type": "call" }, { "api_name": "itert...
20101978227
import cache import timer import lora import websockets import asyncio import threading import keyboard import timestamp def thread_function(): while (not cache.stop_thread): timer.countdown(cache.t) def thread_function_killer(): while (not cache.stop_thread): record = keyboa...
juliogcm/lorawan-flow
websocket_client/client.py
client.py
py
3,331
python
en
code
0
github-code
36
[ { "api_name": "cache.stop_thread", "line_number": 11, "usage_type": "attribute" }, { "api_name": "timer.countdown", "line_number": 12, "usage_type": "call" }, { "api_name": "cache.t", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cache.stop_thread...
22565647008
import numpy as np import torch as th from .gaussian_diffusion import GaussianDiffusion, mean_flat class KarrasDenoiser: def __init__(self, sigma_data: float = 0.5): self.sigma_data = sigma_data def get_snr(self, sigmas): return sigmas**-2 def get_sigmas(self, sigmas): return si...
openai/shap-e
shap_e/diffusion/k_diffusion.py
k_diffusion.py
py
9,973
python
en
code
10,619
github-code
36
[ { "api_name": "torch.randn_like", "line_number": 27, "usage_type": "call" }, { "api_name": "gaussian_diffusion.mean_flat", "line_number": 37, "usage_type": "call" }, { "api_name": "gaussian_diffusion.mean_flat", "line_number": 38, "usage_type": "call" }, { "api_na...
38251884357
from django.db import models all_pages = [] # Just switched to keeping it in-memory. No real need for a model here. # class Page(models.Model): # top = models.TextField(blank=True, null=True) # middle_link = models.TextField(blank=True, null=True) # middle_html = models.TextField(blank=True, null=True) #...
skoczen/skoczen
project/apps/resume/models.py
models.py
py
4,868
python
en
code
1
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 19, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 19, "usage_type": "name" }, { "api_name": "django.db.models.DateTimeField", "line_number": 20, "usage_type": "call" }, { "api_n...
34761412830
import sys, os import subprocess import json from typing import Union from random import random import web3 from web3 import Web3 from web3._utils.threads import Timeout from solcx import compile_files from eth_utils import decode_hex # Project modules from TextColor.color import bcolors MGMT_CONTRACT_DB_NAME = 'dat...
acid9reen/bas
utils.py
utils.py
py
11,123
python
en
code
0
github-code
36
[ { "api_name": "web3.Web3", "line_number": 24, "usage_type": "name" }, { "api_name": "web3.eth.wait_for_transaction_receipt", "line_number": 37, "usage_type": "call" }, { "api_name": "web3.eth", "line_number": 37, "usage_type": "attribute" }, { "api_name": "web3.We...
34234807737
class Employee: raise_amount = 1.04 num_emps = 0 def __init__(self, first, last, pay): self.first = first self.last = last self.pay = pay self.email = first + '.' + last + '@company.com' Employee.num_emps += 1 def fullname(self): return...
latiful-hassan/OOP
staticmethods.py
staticmethods.py
py
1,980
python
en
code
0
github-code
36
[ { "api_name": "datetime.date", "line_number": 57, "usage_type": "call" } ]
34619647140
import datetime import json import random import requests import numpy as np import pandas as pd from pkg_resources import resource_filename class DataWrangler: def __init__(self, wallet, start, end): self.wallet = wallet self.start = start self.end = end self.profit = None ...
karolow/currency-wallet
currency_wallet/utils/utils.py
utils.py
py
3,114
python
en
code
0
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 31, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.random.random",...
39723292841
#Find list of all sub_breed breed name import requests def get_json_dog_output_dict(url): r = requests.get(url) output = r.json() return output def get_breed_sub_breed_full_name(): dog_output = get_json_dog_output_dict(url = "https://dog.ceo/api/breeds/list/all") dog_breed_output = dog_output["mes...
Swetha-Vootkuri/PythonSessions
dogs_api/breed_sub_breed_list.py
breed_sub_breed_list.py
py
859
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" } ]
21185857238
import pygame from time import time import os ## OPTIONS LIEES A L'AFFICHAGE screen_width, screen_height = 1280, 720 # taille de la fenetre show_interface = False # afficher le classement ticks_per_second = 60 # nombre de mise à jour par seconde empty_ground_color = (210, 210, 210) # couleur d'une terre inoccup...
JonathanOll/Pixel-War-Simulator
options.py
options.py
py
1,495
python
fr
code
0
github-code
36
[ { "api_name": "pygame.font.init", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pygame.font.Font", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.font", ...
27029688469
import torch import numpy as np import torch.nn as nn class PositionalEncoding1D(nn.Module): def __init__(self, num_pos_feats=64, temperature=10000, normalize=False, scale=None): """ :param channels: The last dimension of the tensor you want to apply pos emb to. """ super().__init__...
ViTAE-Transformer/DeepSolo
adet/layers/pos_encoding.py
pos_encoding.py
py
3,339
python
en
code
177
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.arange", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number"...
35147097028
import nltk from functools import lru_cache from nltk.corpus import stopwords from nltk.stem.snowball import EnglishStemmer import re from bs4 import BeautifulSoup class Preprocessor: def __init__(self): # Stemming is the most time-consuming part of the indexing process, we attach a lru_cache to the stemm...
sidsachan/movie_sentiment
preprocessor.py
preprocessor.py
py
1,221
python
en
code
0
github-code
36
[ { "api_name": "functools.lru_cache", "line_number": 14, "usage_type": "call" }, { "api_name": "nltk.stem.snowball.EnglishStemmer", "line_number": 14, "usage_type": "call" }, { "api_name": "nltk.tokenize.WhitespaceTokenizer", "line_number": 15, "usage_type": "call" }, ...
15760194327
import glob import os import sys try: sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % ( sys.version_info.major, sys.version_info.minor, 'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0]) except IndexError: pass import carla import random import time ...
hchoi256/carla-research-project
Learning_Tasks/LT1/vehicle_camera.py
vehicle_camera.py
py
3,348
python
en
code
1
github-code
36
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.version_info", "line_num...
41230462018
import numpy as np import matplotlib.pyplot as plt from pathlib import Path from SnapOptimizer.optimization.snap_optimizer import SNAPGateOptimizer2Qubits, SNAPGateOptimizerStatePreparation from SnapOptimizer.optimization.snap_pulse_optimizer import SNAPPulseOptimizer import SnapOptimizer.qubit_gates as qubit_gates fr...
Paulsson99/SnapOptimizer
SnapOptimizer/optimization/automation.py
automation.py
py
5,537
python
en
code
0
github-code
36
[ { "api_name": "SnapOptimizer.encodings.Encoding", "line_number": 14, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 31, "usage_type": "call" }, { "api_name...
28508158291
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('home', '0019_auto_20150312_1008'), ] operations = [ migrations.CreateModel( name='LinkCategory', fie...
micahlagrange/rmlsa.com
rmlsa/home/migrations/0020_linkcategory_weblink.py
0020_linkcategory_weblink.py
py
1,164
python
en
code
0
github-code
36
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
35478284383
import os import glob import h5py import json import copy import torch import librosa import numpy as np import soundfile as sf import speech_recognition as sr from jiwer import wer from tqdm import tqdm from scipy import signal from trainer import Trainer from hps.hps import hp, Hps from torch.autograd import Variable...
andi611/ZeroSpeech-TTS-without-T
convert.py
convert.py
py
14,769
python
en
code
109
github-code
36
[ { "api_name": "librosa.istft", "line_number": 30, "usage_type": "call" }, { "api_name": "hps.hps.hp.hop_length", "line_number": 30, "usage_type": "attribute" }, { "api_name": "hps.hps.hp", "line_number": 30, "usage_type": "name" }, { "api_name": "hps.hps.hp.win_le...
3302452099
import telebot import requests import re import os from twilio.rest import Client import pyrebase bot = telebot.TeleBot("Replace this with telegram bot father key", parse_mode=None) config = { "apiKey": "", "authDomain": "", "databaseURL": "", "storageBucket": "" } x = 0 y = 0 z = 0 q = 0 firebase = pyrebase.in...
harishsg99/Telegram-to-WA-bot
app.py
app.py
py
2,041
python
en
code
0
github-code
36
[ { "api_name": "telebot.TeleBot", "line_number": 7, "usage_type": "call" }, { "api_name": "pyrebase.initialize_app", "line_number": 18, "usage_type": "call" }, { "api_name": "twilio.rest.Client", "line_number": 75, "usage_type": "call" } ]
13780351709
import sys from collections import deque def div_area(q): while q: r, c = q.popleft() for x, y in [[r + 1, c], [r - 1, c], [r, c + 1], [r, c - 1]]: if 0<= x < n and 0<= y < m: if area[x][y] == 0: area[x][y] = -1 q.append([x, y]) ...
Yangseyeon/BOJ
03. Gold/2638.py
2638.py
py
1,281
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 43, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 43, "usage_type": "attribute" }, { "api_name": "sys.stdin.readlin...
5544666629
import urllib.request import datetime import json # 返回一个月内的cf场数和上/掉分情况 def get_CF_ContestCount(name): apiUrl = "https://codeforces.com/api/user.rating?handle=" + name try: page = urllib.request.urlopen(apiUrl, timeout=2000) s = page.read().decode('utf-8') contestsData = json.loads(s)['...
Linzecong/LPOJ
CrawlingServer/CodeForceContestCounter.py
CodeForceContestCounter.py
py
1,067
python
en
code
216
github-code
36
[ { "api_name": "urllib.request.request.urlopen", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 10, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 10, "usage_type": "name" }, { "api_nam...
37952156492
from math import sqrt from itertools import product import numpy as np from scipy.special import factorial as fact from functools import lru_cache # The interaction matrix in desired basis # U^{spherical}_{m1 m2 m3 m4} = \sum_{k=0}^{2l} F_k angular_matrix_element(l, k, m1, m2, m3, m4) # H = \frac{1}{2} \sum_{ijkl,\si...
romerogroup/CondensedMatter_Jupyter
code/minimulti/electron/U_matrix.py
U_matrix.py
py
19,979
python
en
code
7
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 84, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 90, "usage_type": "call" }, { "api_name": "functools.lru_cache", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "...