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
42882353355
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Please refer the tutorial ":ref:`tutorial-parse_parser`". """ # pylint: disable=invalid-name, no-self-use __author__ = "Mu Yang <http://muyang.pro>" __copyright__ = "2018-2021 CKIP Lab" __license__ = "GPL-3.0" import re from wcwidth import wcswidth from ply.lex impo...
ckiplab/ehownet
ehn/parse/parser.py
parser.py
py
8,932
python
en
code
10
github-code
36
[ { "api_name": "wcwidth.wcswidth", "line_number": 73, "usage_type": "call" }, { "api_name": "ply.lex.lex", "line_number": 83, "usage_type": "call" }, { "api_name": "re.search", "line_number": 116, "usage_type": "call" }, { "api_name": "ply.yacc.yacc", "line_num...
12545797664
#!/usr/bin/env python def check_path(fp): import os if not os.path.exists(fp): raise FileNotFoundError("Could not find the file {}".format(fp)) def main(sew_file, orb_file, hdf_file, symmetry, index): import re import numpy as np import h5py print(' ') print(' M U L L I K...
gaurabganguly1989/molcas_mo2ao_weights
molcas_ao_weights.py
molcas_ao_weights.py
py
9,516
python
en
code
0
github-code
36
[ { "api_name": "os.path.exists", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 44, "usage_type": "call" }, { "api_name": "re.search", "line_number": 46...
24347774605
import requests as req from lxml import html from tqdm import tqdm url = 'http://swf.com.tw/scrap/' page = req.get(url) dom = html.fromstring(page.text) images = dom.xpath('//img/@src') def download(url): filename = url.split('/')[-1] r = req.get(url, stream=True) with open(filename, 'wb...
theoyu13/python3
python程式設計入門/F9796/ch11/download_img.py
download_img.py
py
787
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 7, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 7, "usage_type": "name" }, { "api_name": "requests.get", "line_num...
29573142583
import tensorflow as tf from model import char_rnn from utils import build_dataset import numpy as np start_token = 'B' end_token = 'E' model_dir = 'result/poem' corpus_file = 'data/poems.txt' lr = 0.0002 def to_word(predict, vocabs): predict = predict[0] predict /= np.sum(predict) sample = np.random.ch...
yanqiangmiffy/char-rnn-writer
generate_poem.py
generate_poem.py
py
2,358
python
en
code
83
github-code
36
[ { "api_name": "numpy.sum", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.arange", "l...
13840387121
from django.contrib import admin from django.urls import path, include from . import views urlpatterns = [ path('joueur/',views.joueur, name="Joueur"), path('club/',views.club,name="Club"), path('player/',views.player,name="Player"), path('',views.home, name="Home"), path('affiche/',views.affiche_...
2bFaycal/projet-django
foot/app/urls.py
urls.py
py
1,182
python
fr
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
7043720148
from keras.applications.inception_v3 import InceptionV3 from tensorflow.keras import layers, models, optimizers INPUT_SHAPE_300_300 = (300, 300, 3) def create_model(input_shape=INPUT_SHAPE_300_300, weights=None): if weights is not None: inception_base = InceptionV3( weights=None, include_top=...
SalmanRafiullah/garbage-classification
models/inception_v3.py
inception_v3.py
py
1,034
python
en
code
0
github-code
36
[ { "api_name": "keras.applications.inception_v3.InceptionV3", "line_number": 9, "usage_type": "call" }, { "api_name": "keras.applications.inception_v3.InceptionV3", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.keras.models.Sequential", "line_number": 19...
43163584792
from flask import Flask from flask_pymongo import PyMongo from operator import itemgetter from flask_login import LoginManager import sys # Initialize mongo db with app app = Flask(__name__) # mongodb_client = PyMongo(app, uri='mongodb://localhost:27017/todo_db') mongodb_client = PyMongo(app, uri='mongodb://mongo:2701...
rickyjorgensen2000/cse312
flaskr/db.py
db.py
py
4,316
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_pymongo.PyMongo", "line_number": 10, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 96, "usage_type": "call" } ]
11580020473
import mysql.connector from tabulate import tabulate import getpass def login(): # This function is for establishing connection # between python and mysql database by taking # input of user id and password and host name # then it take the input of database from the # user and if the databa...
manavmittal05/InventoryManagement
ManavMittal_2021538_Master Stock-1.py
ManavMittal_2021538_Master Stock-1.py
py
18,424
python
en
code
0
github-code
36
[ { "api_name": "mysql.connector.connector.connect", "line_number": 17, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 17, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 17, "usage_type": "name" }, { "...
39277796402
from PIL import Image, ImageSequence from generators import Generator class OverlayGenerator(Generator): ALLOWED_OVERLAYS = { "fire.gif": "burning", "fire2.gif": "burning", "sparkle.gif": "sparkling", "sparkle2.gif": "sparkling", "loving.gif": "loving", } def __in...
grdaneault/emojigen
api/generators/overlay.py
overlay.py
py
2,116
python
en
code
0
github-code
36
[ { "api_name": "generators.Generator", "line_number": 6, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 28, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 28, "usage_type": "name" }, { "api_name": "generators.Generator.get...
15826968262
from __future__ import print_function from __future__ import division from __future__ import unicode_literals from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import str from builtins import range from builtins import * from past.utils import ol...
e-mission/e-mission-server
emission/analysis/modelling/user_model_josh/utility_model.py
utility_model.py
py
16,233
python
en
code
22
github-code
36
[ { "api_name": "future.standard_library.install_aliases", "line_number": 6, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 6, "usage_type": "name" }, { "api_name": "emission.core.wrapper.trip_old.Coordinate", "line_number": 29, "usage_type"...
41643896349
from _GLOBAL_OPTIONS_ import factionsOptionMenu, addPremiumItems, addRevive, AddNightmareTickets, removeAds, unlockProfiles from _PROFILE_OPTIONS_ import addItemsMenu, changeUsername, addCash, setFreeSkillReset, setLevel, setBlackStronboxes, addBlackKeys, addAugmentCores, setSupportItems, addMultiplayerStats from _UT...
SWFplayer/SAS4Tool
_MAIN_.py
_MAIN_.py
py
8,232
python
en
code
0
github-code
36
[ { "api_name": "_UTILS_.mainTitle", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 36, "usage_type": "call" }, { "api_name": "msvcrt.kbhit", "line_number": 38, "usage_type": "call" }, { "api_name": "win32console.SetConsoleTitl...
37407869802
import pandas as pd import numpy as np from sklearn.model_selection import train_test_split import os import shutil df = pd.read_csv('../data/speakers_all.csv') df.drop(columns=['Unnamed: 9', 'Unnamed: 10', 'Unnamed: 11'], inplace=True) df_full = df[df['file_missing?'] == False] df_full['sex'] = df_full['sex'].apply(l...
acaldwell93/Accent-Classification
src/create_train_test_directories.py
create_train_test_directories.py
py
1,769
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 50, "usage_type": "call" }, { "api_name": "...
2888068360
# -*- coding: utf-8 -*- from __future__ import absolute_import import json import logging from tornado.escape import json_encode from tornado.escape import json_decode from tornado.escape import utf8 from .constant import * logger = logging.getLogger('server.' + __name__) class JsonStream: def __init__(self, ...
All-less/exotic-server
lib/json_stream.py
json_stream.py
py
1,023
python
en
code
2
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "tornado.escape.json_decode", "line_number": 25, "usage_type": "call" }, { "api_name": "tornado.escape.utf8", "line_number": 37, "usage_type": "call" }, { "api_name": "torn...
30509808806
#!/home/meichen/anaconda3/bin/python import numpy as np import matplotlib.pyplot as plt import pandas as pd import os import glob import matplotlib.ticker as mticker from matplotlib.ticker import StrMethodFormatter, NullFormatter def main(): data = pd.read_csv('pairsfile_rgp_select.csv',skipinitialspace=True) ...
meichenl95/SR_deepfocus
figures/egfs_one.py
egfs_one.py
py
2,853
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 21, "usage_type": "call" }, { "api_name": "os.chdir", "line_number"...
26014460878
from ..h2o import random_forest from .estimator_base import H2OEstimator class H2ORandomForestEstimator(H2OEstimator): def __init__(self,mtries=None,sample_rate=None,build_tree_one_node=None,ntrees=None, max_depth=None,min_rows=None,nbins=None,nbins_cats=None, binomial_double_trees=None...
tomasgreif/h2o-3
h2o-py/h2o/estimators/random_forest.py
random_forest.py
py
807
python
en
code
null
github-code
36
[ { "api_name": "estimator_base.H2OEstimator", "line_number": 4, "usage_type": "name" }, { "api_name": "h2o.random_forest", "line_number": 17, "usage_type": "call" } ]
14112986280
import os import allure import pytest import logging from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By import allure from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.chrome.options import Options clas...
nasretdinovs/tensor_autotest
common.py
common.py
py
2,451
python
en
code
0
github-code
36
[ { "api_name": "logging.info", "line_number": 20, "usage_type": "call" }, { "api_name": "allure.step", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver.common.by.By.CLASS_NAME", "line_number": 32, "usage_type": "attribute" }, { "api_name...
21418641611
import ismrmrd import os import itertools import logging import numpy as np import numpy.fft as fft import ctypes import mrdhelper from datetime import datetime # Folder for debug output files debugFolder = "/tmp/share/debug" def groups(iterable, predicate): group = [] for item in iterable: group.app...
HMS-CardiacMR/MyoMapNet
InLine_Implementation/Code/simplefft.py
simplefft.py
py
4,004
python
en
code
23
github-code
36
[ { "api_name": "logging.info", "line_number": 43, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 44, "usage_type": "call" }, { "api_name": "ismrmrd.ACQ_IS_PHASECORR_DATA", "line_number": 47, "usage_type": "attribute" }, { "api_name": "ismrmrd....
26493496083
from django.urls import path from .import views urlpatterns = [ path("", views.index, name="storehome"), path("about/", views.about, name="aboutus"), path("contact/", views.contact, name="contactus"), path("Seller/", views.seller, name="sellerid"), #Seller/ is the html file name not t...
princegupta003005/E-commerce-Website
Anapp/store/urls.py
urls.py
py
697
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
495049737
import imp import importlib import inspect import os import sys import weakref from collections import namedtuple from enum import Enum from dagster import check from dagster.core.definitions.partition import RepositoryPartitionsHandle from dagster.core.definitions.pipeline import PipelineDefinition from dagster.core....
helloworld/continuous-dagster
deploy/dagster_modules/dagster/dagster/core/definitions/handle.py
handle.py
py
28,007
python
en
code
2
github-code
36
[ { "api_name": "sys.version_info", "line_number": 18, "usage_type": "attribute" }, { "api_name": "collections.namedtuple", "line_number": 28, "usage_type": "call" }, { "api_name": "dagster.core.errors.DagsterInvariantViolationError", "line_number": 38, "usage_type": "call"...
74060670184
import re from hashlib import sha256 from unittest import mock import pytest from aiohttp import web from sqlalchemy import and_, select from server.config import config from server.db.models import ban, friends_and_foes from server.exceptions import BanError, ClientError from server.game_service import GameService f...
FAForever/server
tests/unit_tests/test_lobbyconnection.py
test_lobbyconnection.py
py
34,970
python
en
code
64
github-code
36
[ { "api_name": "server.games.VisibilityState.PUBLIC", "line_number": 34, "usage_type": "attribute" }, { "api_name": "server.games.VisibilityState", "line_number": 34, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 30, "usage_type": "call" }, { ...
31347480186
from PIL import Image from gcbmanimation.util.tempfile import TempFileManager Image.MAX_IMAGE_PIXELS = None class Frame: ''' Represents a presentation-format image that can be included in an animation. A frame usually applies to a particular year and points to an image file on disk. Arguments: 'ye...
moja-global/GCBM.Animation
gcbmanimation/animator/frame.py
frame.py
py
4,162
python
en
code
1
github-code
36
[ { "api_name": "PIL.Image.MAX_IMAGE_PIXELS", "line_number": 3, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 3, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 41, "usage_type": "call" }, { "api_name": "PIL.Image", ...
19865653500
import streamlit as st import base64 import os from nbanalyzer import * from PIL import Image import time script_directory = os.getcwd() PROGRESS_BAR_CUSTOM_COLOR = '#f63366' ordinal = lambda n: "%d%s" % (n,"tsnrhtdd"[(n//10%10!=1)*(n%10<4)*n%10::4]) def load_data(year: int, stat_type: str): if stat_type == 'pla...
tta13/NBA-Stats-Explorer
nba_app.py
nba_app.py
py
9,140
python
en
code
2
github-code
36
[ { "api_name": "os.getcwd", "line_number": 8, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 23, "usage_type": "call" }, { "api_name": "streamlit.set_option", "line_number": 45, "usage_type": "call" }, { "api_name": "PIL.Image.open", "...
70786129065
from Bio.Seq import Seq import os def parse_query_results(path): """ This fucntion will p[arse the query results :param path: The path of the file that contains the query results :return: An array that contains the results described in the file """ file = open(path,"r") results = [] for ...
guys79/BioInformaticsProject
main.py
main.py
py
11,616
python
en
code
0
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path", "line_number": 61, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 61, "usage_type": "call" }, { "api_name": "Bio.Seq.Seq", "line_...
38930132887
""" from pytube import Playlist import pytube itemlist = {} playlist = Playlist("") for item in playlist: j = pytube.YouTube(item).title.title() oi = pytube.YouTube(item).metadata.metadata print(oi) print(j) itemlist[j] = [item, oi] print(itemlist) from mutagen.easyid3 import EasyID3 audio = Eas...
Suave101/pytube-AHHHHHH
Tags.py
Tags.py
py
903
python
en
code
0
github-code
36
[ { "api_name": "os.chdir", "line_number": 31, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 32, "usage_type": "call" }, { "api_name": "mutagen.easyid3.EasyID3", "line_number": 33, "usage_type": "call" } ]
12151884978
import torch # noqa from model import softmax_classifier from model import softmax_classifier_backward from model import cross_entropy from utils import Metric, accuracy # noqa __all__ = ['create_model', 'test_epoch', 'test_epoch', 'train_loop'] ################################################# # create_model ###...
antebi-itai/Weizmann
DL for CV/HW1/Solution/Code/train.py
train.py
py
5,534
python
en
code
0
github-code
36
[ { "api_name": "torch.rand", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.rand", "line_number": 28, "usage_type": "call" }, { "api_name": "utils.Metric", "line_number": 63, "usage_type": "call" }, { "api_name": "utils.Metric", "line_number": ...
28890245799
"""Score network module.""" import torch import copy import math from torch import nn from torch.nn import functional as F from openfold.utils.rigid_utils import Rigid, Rotation from data import utils as du from data import all_atom from model import ipa_pytorch from motif_scaffolding import twisting import functools a...
blt2114/twisted_diffusion_sampler
protein_exp/model/score_network.py
score_network.py
py
13,595
python
en
code
11
github-code
36
[ { "api_name": "torch.Tensor", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.arange", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.sin", "line_number": 29, "usage_type": "call" }, { "api_name": "math.pi", "line_number":...
34781259647
import h5py import numpy as np filename = 'weight_imgnet_ker5_h5/ResNet_18_ker5.h5' h5f = h5py.File(filename, 'r') cvsfmt = '%.18e' # covers upto float128 # get a List of data sets in group 'dd48' # print('h5f:', h5f.shape) # Get the data lv0_keys = list(h5f.keys()) print("lv0: ", lv0_keys) for keys0 in lv0_keys: ...
dwkim606/lattigo_conv
imgnet_read_h5.py
imgnet_read_h5.py
py
1,175
python
en
code
0
github-code
36
[ { "api_name": "h5py.File", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.savetxt", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.savetxt", "line_number...
39056277589
from matplotlib import pyplot as plt vr=[2.6,2.8,3.0,3.1,3.2,3.3,3.4,3.6] VR=[48.37,57.55,64.92,69.12,72.82,74.12,73.1,67.66] plt.plot(vr,VR,'k',lw=1.5) plt.scatter(vr,VR,marker='+',s=90,lw=1.5) plt.grid() plt.xlabel('Rupture speed (km/s)') plt.ylabel('Variance reductio (%)') plt.show()
Ogweno/mylife
Nepal/plot_rupt_speed.py
plot_rupt_speed.py
py
290
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 8, "usage_type": "call" }, { "api_name": "matpl...
12478884070
import json import os import cv2 import numpy as np import numpy.matlib import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.animation as animation # change IDs to your IDs. ID1 = '206299463' ID2 = '312497084' ID = "HW3_{0}_{1}".format(ID1, ID2) RESULTS = 'results' os.makedirs(RESUL...
StudentYuval/VP2023
ex3/particle_filter.py
particle_filter.py
py
11,564
python
en
code
0
github-code
36
[ { "api_name": "os.makedirs", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 45, "usage_type": "attribute" }, { "api_name": "numpy.copy", "line_number": 70, "usage_type": "call" }, { "api_name": "numpy.clip", "line_numb...
74551961384
#!/usr/bin/env python3 # encoding:utf-8 ''' @author: lierl @file: use_enum.py @time: 2018/3/24 17:31 ''' __author__ = 'lierl' from enum import Enum, unique Month = Enum('Month',('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')) for name, member in Month.__members__.items(): print(name, '=...
dream7319/djtest
demo/use_enum.py
use_enum.py
py
1,187
python
en
code
0
github-code
36
[ { "api_name": "enum.Enum", "line_number": 12, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_name": "enum.unique", "line_number": 17, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 44, ...
33057055793
from flask import request from app import app from app.service import get_value, set_value, add_set, get_set, set_expiry, range_elements, rank #End point for GET, SET and EXPIRE command @app.route('/redis/key',methods=['POST','GET','PATCH']) def keyDetails(): if request.method == "GET": key = request.form[...
shreyans-sureja/Redis-Implementation
app/routes.py
routes.py
py
1,651
python
en
code
0
github-code
36
[ { "api_name": "flask.request.method", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.request.form", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.re...
40857469466
import requests import show_route import serial class Navi_auto: def __init__(self): self.key = '1b1779b2176bc8d85a93f9aef22b8a53' self.latitude = 1 self.longitude = 0 self.start_coordinate = [116.481028, 39.989643] self.desti_coordinate = [116.434446, 39.90816] sel...
haiboCode233/KivyPlusAR
GPSAPI.py
GPSAPI.py
py
4,415
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 46, "usage_type": "call" }, { "api_name": "show_route.gps_lon_lat.clear", "line_number": 55, "usage_type": "call" }, { "api_name": "show_route.gps...
29500719773
import json from pyspark.sql import SparkSession from pyspark.sql.functions import concat, col, lit, split, to_date, date_format import os import time # Create a SparkSession spark = SparkSession.builder.getOrCreate() # Start the timer start_time = time.time() # Load the config file with open('config.json') as f: ...
hari01008/Extract-Transform-Load-With-Mysql-and-Pyspark
transform.py
transform.py
py
2,316
python
en
code
0
github-code
36
[ { "api_name": "pyspark.sql.SparkSession.builder.getOrCreate", "line_number": 8, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 8, "usage_type...
22577730329
''' Created on 06.12.2013 @author: hfrieden Import an Arma 2/Arma 3 unbinarized MDL file ''' import struct import bpy import bmesh import os.path as path import ArmaToolbox import ArmaTools def getLayerMask(layer): res = [False, False, False, False, False, False, False, False, False, False, ...
AlwarrenSidh/ArmAToolbox
ArmaToolbox/MDLImporter.py
MDLImporter.py
py
18,846
python
en
code
70
github-code
36
[ { "api_name": "struct.unpack", "line_number": 26, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 32, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 35, "usage_type": "call" }, { "api_name": "struct.unpack", "line_n...
43008845296
import pytest from sqlobject import DatabaseIndex, ForeignKey, IntCol, MultipleJoin, \ SQLObject, StringCol from sqlobject.dberrors import DatabaseError, IntegrityError, \ OperationalError, ProgrammingError from sqlobject.tests.dbtest import raises, setupClass, supports #######################################...
sqlobject/sqlobject
sqlobject/tests/test_indexes.py
test_indexes.py
py
3,088
python
en
code
140
github-code
36
[ { "api_name": "sqlobject.SQLObject", "line_number": 14, "usage_type": "name" }, { "api_name": "sqlobject.StringCol", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlobject.IntCol", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlobject.Da...
10024409616
import csv import operator import decimal import numpy as np import matplotlib.pyplot as pl import calendar import sys import os.path h = open('../results/MonthlyTurnoverOldCerrado.csv','rb') data = csv.reader(h) months = [] bints = [] seasons = [] boundarys = [] sumprecips = [] avghumid = [] avgvisits = [] for col...
musikzauberin/buzz
code/OldCode/plotting2.py
plotting2.py
py
828
python
en
code
0
github-code
36
[ { "api_name": "csv.reader", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 38, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 38, "usage_type": "name" }, { "api_name": "matplotlib.pyplot...
21609680031
from contextlib import contextmanager import sys import os import tempfile from shutil import rmtree from os import getcwd, chdir from os.path import join, basename, dirname, isdir, abspath, sep import unittest import six from six.moves import reload_module from pylint import config, lint from pylint.lint import PyLi...
a0x8o/kafka
sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/test/unittest_lint.py
unittest_lint.py
py
26,703
python
en
code
59
github-code
36
[ { "api_name": "os.name", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os._name", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.platform", "line_number": 31, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", "...
32473828762
from config import bot, chat_id from time import sleep from telebot import types from plugins.error import Error from plugins.message import shout import random from plugins.error import in_chat, check_private @in_chat() def say(m): bot.delete_message(m.chat.id, m.message_id) try: if m.chat.type != "pr...
evilcatsystem/telegram-bot
plugins/say.py
say.py
py
2,015
python
ru
code
1
github-code
36
[ { "api_name": "config.bot.delete_message", "line_number": 11, "usage_type": "call" }, { "api_name": "config.bot", "line_number": 11, "usage_type": "name" }, { "api_name": "telebot.types.InlineKeyboardMarkup", "line_number": 14, "usage_type": "call" }, { "api_name"...
16627412673
''' ***************************************************************************************** * * ================================================= * Pharma Bot Theme (eYRC 2022-23) * ================================================= * * This script is intended for implementation of Ta...
advait-0/eyrc22_PB_3004
Task 4/Task 4A/task_4a.py
task_4a.py
py
20,080
python
en
code
3
github-code
36
[ { "api_name": "os.getcwd", "line_number": 80, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 81, "usage_type": "call" }, { "api_name": "os.path", "line_number": 81, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number":...
36788048136
from pydantic import BaseSettings, BaseModel from pathlib import Path from .languages import WIKIPEDIA_LANGS import toml class Settings(BaseSettings): status: str = "unknown" logging_chat: int = None db_path: Path = Path("jdanbot.db") music_path: Path = Path("media/music") admin_notes: list[s...
jDan735/jdan734-bot
bot/config/config.py
config.py
py
1,254
python
en
code
5
github-code
36
[ { "api_name": "pydantic.BaseSettings", "line_number": 10, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", ...
17217695574
from extras import * from common import Common from indexer import Indexer import math import re import nltk import operator from collections import defaultdict, OrderedDict from nltk.stem import SnowballStemmer from nltk.corpus import wordnet class Query_Expansion: def __init__(self): """ Constr...
ghildiyal-ashutosh/Search_Engine
tasks/query_expansion.py
query_expansion.py
py
6,739
python
en
code
2
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 19, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 20, "usage_type": "call" }, { "api_name": "common.Common", "line_number": 22, "usage_type": "call" }, { "api_name": "indexer...
10210350419
from sklearn import datasets from sklearn.impute import SimpleImputer from sklearn.model_selection import train_test_split import pandas as pd import numpy as np # Multiclass Classification Datasets def load_mnist(): mnist = datasets.load_digits(as_frame=True) mnist_X, mnist_y = mnist.data, mnist.target ...
eccabay/CMA-ES_hyperparameters
load_data.py
load_data.py
py
6,168
python
en
code
0
github-code
36
[ { "api_name": "sklearn.datasets.load_digits", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 11, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 14, "usage_type": "call" }, {...
38516174008
# pip install uszipcode import pandas as pd from uszipcode import SearchEngine search = SearchEngine(simple_zipcode=False) def add_coordinates(df): '''Input: a pandas dataframe which includes a 'Zip' field representing a US zip code. Output: dataframe with 'lat' and 'lng' fields added which represent...
dslachar/analysis_of_crp_data
add_coordinates.py
add_coordinates.py
py
3,241
python
en
code
0
github-code
36
[ { "api_name": "uszipcode.SearchEngine", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.Series", ...
8519295436
import pygame import Snake, Apple import os os.environ['SDL_VIDEO_CENTERED'] = '1' pygame.mixer.pre_init(44100, -16, 1, 512) pygame.init() pygame.display.set_caption("Sssssnake") # 10x10 segments winwidth = 200 winheight = 240 win = pygame.display.set_mode((winwidth, winheight)) # segment - 20x20px segsize = 20 sna...
TZdybel/Games-with-Pygame
snake/main.py
main.py
py
3,681
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.mixer.pre_init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.init", ...
31458300119
import pygame import jumpingHorses.constants as Constants from .constants import BLACK_PIECE, WHITE_PIECE, MOVE_COLOR, MOVE_RADIUS, SQUARE_SIZE, WIDTH, HEIGHT, LETTER_GAP_SIZE, OUTLINE_SIZE from .board import Board from menu.main_menu import MainMenu import menu.gameState as GameState class GameMaster: #in...
perkonss/AI1darbs
jumpingHorses/game_master.py
game_master.py
py
3,699
python
en
code
0
github-code
36
[ { "api_name": "constants.WHITE_PIECE", "line_number": 24, "usage_type": "name" }, { "api_name": "board.Board", "line_number": 25, "usage_type": "call" }, { "api_name": "constants.LETTER_GAP_SIZE", "line_number": 29, "usage_type": "name" }, { "api_name": "constants...
37350976457
"""Zero-field splitting. See:: Spin decontamination for magnetic dipolar coupling calculations: Application to high-spin molecules and solid-state spin qubits Timur Biktagirov, Wolf Gero Schmidt, and Uwe Gerstmann Phys. Rev. Research 2, 022024(R) – Published 30 April 2020 """ from math import pi fr...
f-fathurrahman/ffr-learns-gpaw
my_gpaw/zero_field_splitting.py
zero_field_splitting.py
py
7,481
python
en
code
0
github-code
36
[ { "api_name": "my_gpaw.calculator.GPAW", "line_number": 29, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 50, "usage_type": "call" }, { "api_name": "my_gpaw.typing.Array2D", "line_number": 30, "usage_type": "name" }, { "api_name": "my_gpaw.ty...
19840085119
import numpy as np import tensorflow as tf from mpl_toolkits import mplot3d from d2l import tensorflow as d2l def f(x): return x ** 2 def f_grad(x): return 2 * x def gd(eta, f_grad): x = 10.0 results = [x] for i in range(10): x -= eta * f_grad(x) results.append(float(x)) pr...
AnhVietPham/Deep-Learning
optimization-algrithms/gradient-descent/main.py
main.py
py
1,568
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.range", "line_number": 27, "usage_type": "call" }, { "api_name": "d2l.tensorflow.set_figsize", "line_number": 28, "usage_type": "call" }, { "api_name": "d2l.tensorflow", "line_number": 28, "usage_type": "name" }, { "api_name": "d2l.tensor...
38568112529
import collections class Solution: def findLucky(self, arr) : count = collections.Counter(arr) max_count = -1 for key in count : if key == count[key]: max_count = max(max_count, key) return max_count s = Solution() print(s.findLucky([4,2,3...
archanakalburgi/Algorithms
daily_log/27_aug/lucky_num.py
lucky_num.py
py
561
python
en
code
1
github-code
36
[ { "api_name": "collections.Counter", "line_number": 4, "usage_type": "call" } ]
34182105193
import time from unittest import skip from qiskit.providers.jobstatus import JobStatus from qiskit_ibm_runtime.exceptions import RuntimeJobTimeoutError from ..unit.mock.proxy_server import MockProxyServer, use_proxies from ..ibm_test_case import IBMIntegrationJobTestCase from ..decorators import run_integration_test ...
Qiskit/qiskit-ibm-runtime
test/integration/test_results.py
test_results.py
py
9,622
python
en
code
106
github-code
36
[ { "api_name": "ibm_test_case.IBMIntegrationJobTestCase", "line_number": 13, "usage_type": "name" }, { "api_name": "unittest.skip", "line_number": 16, "usage_type": "call" }, { "api_name": "decorators.run_integration_test", "line_number": 17, "usage_type": "name" }, { ...
44209779593
"""OWM API parser for creating weather report of different cities""" from app.input_file_handler import * from app.logging_and_error_handler import * import requests class CityReport: """Get report from OWM for current city and process it""" def __init__(self, city: City): """ :par...
vizamo/Python-Study-Coding
ICD0004/Final Project/app/owm_parser.py
owm_parser.py
py
7,368
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 31, "usage_type": "call" } ]
73603910825
from flask import Flask from bitrix24 import * import pycep_correios app = Flask(__name__) @app.route('/<id>', methods=['POST','GET']) def cep(id): bx24 = Bitrix24('https://megaisencoes.bitrix24.com.br/rest/XXXX/XXXXXXX/') dealId = id chamada= bx24.callMethod("crm.deal.get", id=dealId) ...
Gabriandl/Projetos-Mega
addCep/addCep.py
addCep.py
py
2,148
python
pt
code
1
github-code
36
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "pycep_correios.get_address_from_cep", "line_number": 22, "usage_type": "call" } ]
26610511083
#DEFAULT ARGUMENTS# import torch import numpy as np from utilities.optirank.src.BCD.Create_Instructions_List import classical_architecture_separate_b_once from utilities.small_functions import percentage_zero, percentage_ones from utilities.optirank.src.relaxation.lambda_P_setting import delta_loss from utilities.opti...
paolamalsot/optirank
utilities/optirank/classifiers/default_args.py
default_args.py
py
2,224
python
en
code
0
github-code
36
[ { "api_name": "utilities.optirank.src.BCD.Create_Instructions_List.classical_architecture_separate_b_once", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.inf", "line_number": 14, "usage_type": "attribute" }, { "api_name": "utilities.optirank.src.relaxation.lambd...
24389916144
import os.path import warnings from collections import defaultdict from itertools import chain from . import builtin from .. import options as opts from .file_types import static_file from .path import relname from ..backends.compdb import writer as compdb from ..backends.make import writer as make from ..backends.nin...
jimporter/bfg9000
bfg9000/builtins/link.py
link.py
py
25,450
python
en
code
73
github-code
36
[ { "api_name": "build_inputs.build_input", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 24, "usage_type": "call" }, { "api_name": "build_inputs.Edge", "line_number": 28, "usage_type": "name" }, { "api_name": "pa...
19788170743
#!/usr/bin/env python # -*- coding:utf-8 -*- import re import math import codecs import random import numpy as np import os import jieba import pickle import shutil jieba.initialize() def zero_digits(s): """将0~9数字字符统一用"0"字符取代 """ return re.sub('\d', '0', s) def load_sentences(path, lower, zeros): ...
churximi/Car-NER
data_utils.py
data_utils.py
py
14,187
python
en
code
0
github-code
36
[ { "api_name": "jieba.initialize", "line_number": 14, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 160, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
8890281336
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 18 11:28:15 2017 @author: vitorhadad """ import torch from torch import nn, cuda from torch.autograd import Variable import torch.nn.functional as F from torch import optim import numpy as np from torch.nn.utils.rnn import pack_padded_sequence, pa...
halflearned/organ-matching-rl
matching/deep_ml/count_lstm.py
count_lstm.py
py
6,722
python
en
code
2
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "name" }, { "api_name": "torch.nn.CrossEntropyLoss", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.nn", ...
32017330441
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import numpy as np import math if __name__ == '__main__': SZ = 64 # taille de l'image SP = int(SZ / 2) # Coordonnee max/min im = np.zeros((SZ, SZ), np.uint8) # Image comme un tableau all_i = range(-SP, ...
JuIngong/TPTelecom
Signaux/TP2/tp2_2.py
tp2_2.py
py
815
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 10, "usage_type": "attribute" }, { "api_name": "math.sin", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", ...
10794984259
from absl.testing import absltest from absl.testing import parameterized import more_itertools import tensorflow as tf from uncertainty_baselines.datasets import datasets import data_preprocessor # local file import from experimental.language_structure.vrnn import data_utils # local file import from experimental.lang...
HeyGF/uncertainty-baselines
experimental/language_structure/vrnn/data_preprocessor_test.py
data_preprocessor_test.py
py
4,004
python
en
code
null
github-code
36
[ { "api_name": "data_preprocessor.INPUT_ID_NAME", "line_number": 10, "usage_type": "attribute" }, { "api_name": "data_preprocessor.INPUT_MASK_NAME", "line_number": 11, "usage_type": "attribute" }, { "api_name": "data_preprocessor.DIAL_TURN_ID_NAME", "line_number": 12, "usa...
39006259890
import os import anndata import scanpy as sc from matplotlib import rcParams import sccross rcParams["figure.figsize"] = (4, 4) PATH = "s01_preprocessing" os.makedirs(PATH, exist_ok=True) rna = anndata.read_h5ad("Saunders-2018.h5ad") met = anndata.read_h5ad("Luo-2017.h5ad") atac = anndata.read_h5ad("10x-ATA...
mcgilldinglab/scCross
data/unmatched_mouse_cortex/preprocess.py
preprocess.py
py
2,006
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.rcParams", "line_number": 13, "usage_type": "name" }, { "api_name": "os.makedirs", "line_number": 16, "usage_type": "call" }, { "api_name": "anndata.read_h5ad", "line_number": 19, "usage_type": "call" }, { "api_name": "anndata.read_h5ad",...
39804372033
from core_operations.models import US_COUNTRY_CODE, NUMBER_OF_DAYS_IN_A_YEAR, LIST_OF_STATES_IN_US from core_operations.models import FormattedPhoneNumberField, YearsOfWorkField from django.db import models import re from datetime import date from datetime import datetime # from internal_users.models import InternalUse...
zjgcainiao/new_place_at_76
talent_management/models.py
models.py
py
12,604
python
en
code
0
github-code
36
[ { "api_name": "faker.Faker", "line_number": 11, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 84, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 84, "usage_type": "name" }, { "api_name": "django.db.mo...
43190780850
from openpyxl.styles import PatternFill, GradientFill def set_fill_color_green(workbook): # read # http://openpyxl.readthedocs.io/en/stable/api/openpyxl.styles.fills.html ws = workbook.active a1 = ws['A1'] # 2 different fill types fill = PatternFill("solid", fgColor="DDDDDD") fill = Gradie...
simkimsia/ug-read-write-excel-using-python
examples/c09_2_fill_color/openpyxl/index.py
index.py
py
498
python
en
code
2
github-code
36
[ { "api_name": "openpyxl.styles.PatternFill", "line_number": 10, "usage_type": "call" }, { "api_name": "openpyxl.styles.GradientFill", "line_number": 11, "usage_type": "call" }, { "api_name": "openpyxl.styles.PatternFill", "line_number": 12, "usage_type": "call" } ]
10713162688
import os import mujoco_py import numpy as np from mujoco_py import functions from learn_seq.utils.general import get_mujoco_model_path # object indicator in mujoco MJ_SITE_OBJ = 6 # `site` objec MJ_BODY_OBJ = 1 # `body` object MJ_GEOM_OBJ = 5 # `geom` object # geom types MJ_CYLINDER = 5 MJ_BOX = 6 MJ_MESH = 7 ...
deanpham98/learn-seq
learn_seq/utils/mujoco.py
mujoco.py
py
9,113
python
en
code
3
github-code
36
[ { "api_name": "learn_seq.utils.general.get_mujoco_model_path", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name"...
27053376609
import pytest from oddEvenList import Solution class ListNode: def __init__(self, x): self.val = x self.next = None @pytest.mark.parametrize("nums, expected", [ ([1, 2, 3, 4, 5], [1, 3, 5, 2, 4]), ([2, 1, 3, 5, 6, 4, 7], [2, 3, 6, 7, 1, 5, 4]) ]) def test_oddEvenList(nums, expected): ...
ikedaosushi/leetcode
problems/python/tests/test_oddEvenList.py
test_oddEvenList.py
py
613
python
en
code
1
github-code
36
[ { "api_name": "oddEvenList.Solution", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 11, "usage_type": "attribute" } ]
16848170368
from app import app, mail from . import login_required, bad_request, created_request from flask import jsonify, request from db import db, User, Department, Role, UserRoles from sqlalchemy.exc import IntegrityError from setting import MAX_USER_PER_PAGE from dateutil import parser as TimeParser from secrets import toke...
hackernese/Idea-Manager
backend/api/routes/user.py
user.py
py
17,364
python
en
code
0
github-code
36
[ { "api_name": "flask.request.get_json", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 21, "usage_type": "name" }, { "api_name": "flask.request.session", "line_number": 26, "usage_type": "attribute" }, { "api_name": "flask...
788805808
import math import numpy as np import cv2 import settings from point import polarvec, Point class EV3Map: def __init__(self): self.settings = settings.SettingsRegistry['global'] self.image = cv2.imread(self.settings.load_map) self.gray = cv2.cvtColor(self.image, cv2.COLOR_RGB2GRAY) ...
pfnet-research/chainer-ev3
simulator2d/map.py
map.py
py
1,986
python
en
code
8
github-code
36
[ { "api_name": "settings.SettingsRegistry", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2...
34547539160
import cv2 # 选择第二只摄影机 cap = cv2.VideoCapture(0) while(True): # 从摄影机撷取一张影像 ret, frame = cap.read() cv2.putText(frame, "aaqqqqqqqqqqqq", (0,100), cv2.FONT_HERSHEY_SIMPLEX,1, (0,0,0)) # 显示图片 cv2.imshow('frame', frame) cv2.waitKey(1) if cv2.getWindowProperty('frame', cv2.WND_PROP_AUTOSIZE) == -1: ...
Amenoimi/Simple_OCR
cv.py
cv.py
py
456
python
zh
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.putText", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.imshow", ...
5217107857
import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt import contextily as ctx from adjustText import adjust_text from matplotlib.offsetbox import OffsetImage, AnnotationBbox file_path = '/Users/jakewatembach/Desktop/meteoriteLandings/Meteorite_Landings.csv' df = pd.read_csv(file_path) df['mass ...
jakeww/meteoriteLandings
landings.py
landings.py
py
3,775
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "geopandas.GeoDataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "geopandas.points_from_xy", "line_number": 16, "usage_type": "call" }, { "api_name": "geopan...
70387200423
import os import torch import timm import numpy as np from simple_network import SimpleNetwork from torch.utils.data import DataLoader from torchvision.datasets import ImageFolder from torchvision.transforms import Compose, Normalize, ToTensor, Resize from torchvision.models import resnet18 #from torch import nn from n...
Hamster-yang/FL_chest-xray_timm
app/custom/chestxrayvalidator.py
chestxrayvalidator.py
py
5,254
python
en
code
0
github-code
36
[ { "api_name": "nvflare.apis.executor.Executor", "line_number": 20, "usage_type": "name" }, { "api_name": "nvflare.app_common.app_constant.AppConstants.TASK_VALIDATION", "line_number": 21, "usage_type": "attribute" }, { "api_name": "nvflare.app_common.app_constant.AppConstants", ...
29224787647
from flask import Flask, request, render_template, redirect, flash from flask_sqlalchemy import SQLAlchemy import requests import sys import os app = Flask(__name__) app.config.from_pyfile("config.py") db = SQLAlchemy(app) def return_data_from_api(city_name_value): api_id = "24034c2fc253da6475cd74bc0b96cf5a" ...
artem-chigin/weather_app
program.py
program.py
py
2,458
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", ...
24159423427
import subprocess import os import requests KEY = 'trnsl.1.1.20161216T160124Z.4a07c4b6a2f01566.ade260e6c684818698899fd08a9c15d72faca843' URL = 'https://translate.yandex.net/api/v1.5/tr.json/translate' # путь к файлу с текстом; directory_source = 'Source' # путь к файлу с результатом; directory_result = 'Result' # ...
pashkovsky/PY2PM
PY3_2/Homework/translator_files.py
translator_files.py
py
3,013
python
ru
code
0
github-code
36
[ { "api_name": "subprocess.run", "line_number": 16, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3...
22354333965
import os import re import typing import pymysql import mlrun.utils class MySQLUtil(object): dsn_env_var = "MLRUN_HTTPDB__DSN" dsn_regex = ( r"mysql\+pymysql://(?P<username>.+)@(?P<host>.+):(?P<port>\d+)/(?P<database>.+)" ) check_tables = [ "projects", # check functions as we...
mlrun/mlrun
server/api/utils/db/mysql.py
mysql.py
py
3,216
python
en
code
1,129
github-code
36
[ { "api_name": "mlrun.utils.utils", "line_number": 21, "usage_type": "attribute" }, { "api_name": "mlrun.utils", "line_number": 21, "usage_type": "name" }, { "api_name": "mlrun.utils.utils.retry_until_successful", "line_number": 27, "usage_type": "call" }, { "api_n...
44648666543
from rest_framework.documentation import include_docs_urls from django.contrib import admin from django.urls import path, re_path, include from django.conf.urls import url urlpatterns = [ path('admin/', admin.site.urls), ] urlpatterns += [ path( 'drf-docs/', include_docs_urls( tit...
Endlex-net/Easting_kanban
kanban/urls.py
urls.py
py
539
python
en
code
3
github-code
36
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "dja...
15538629853
#!/usr/bin/env python # coding: utf-8 # In[63]: from PIL import Image, ImageDraw import numpy as np import math import imageio from copy import deepcopy import cv2 def to_integral_image(img_arr): """ Calculates the integral image based on this instance's original image data. """ row_sum = np.zeros(...
lizihao1999/Viola-Jones
hw4.py
hw4.py
py
9,985
python
en
code
2
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.multiply", "line_number": 103, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numbe...
32432567007
from django import template from django.utils.translation import ugettext as _ from message.models import Message from milestone.models import Milestone from lib import utils register = template.Library() def displaystatistic(context, name, trans_name, number): icons_folder = '/media/basepage/images/icons/' ic...
joaquimrocha/Rancho
rancho/lib/templatetags/displaystatistic.py
displaystatistic.py
py
794
python
en
code
7
github-code
36
[ { "api_name": "django.template.Library", "line_number": 7, "usage_type": "call" }, { "api_name": "django.template", "line_number": 7, "usage_type": "name" } ]
35802636506
from tkinter import * from PyQt4 import QtGui,QtCore import cv2 import re from selenium.webdriver import Firefox from selenium.webdriver.firefox.options import Options from selenium.webdriver.common.by import By class Window(QtGui.QMainWindow): def __init__(self, parent=None): super(Window,self).__...
lucifer6666/Reverse-Image-Search
revimage.py
revimage.py
py
3,601
python
en
code
0
github-code
36
[ { "api_name": "PyQt4.QtGui.QMainWindow", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt4.QtGui.QLabel", "line_number": 13, "usage_type": "call" }, { "api_name": "PyQt4.QtGui...
70118415145
import webcolors from sklearn.cluster import KMeans import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from colormap import rgb2hex import pandas as pd from scipy.spatial import KDTree class ColorNames: WebColorMap = {} WebColorMap["AliceBlue"] = "#F0F8FF" WebColorMap["AntiqueWhite"]...
danydepo/ffs-backend
TrainAndTest/Color/color_detection.py
color_detection.py
py
10,216
python
en
code
0
github-code
36
[ { "api_name": "colormap.rgb2hex", "line_number": 197, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 231, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 231, "usage_type": "name" }, { "api_name": "sklearn.cluster.KMeans",...
69905549866
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ############################################################################## """Perform inference on a single imag...
chhari/tiredwebsite
infer_website.py
infer_website.py
py
5,203
python
en
code
0
github-code
36
[ { "api_name": "detectron.utils.c2.import_detectron_ops", "line_number": 43, "usage_type": "call" }, { "api_name": "detectron.utils.c2", "line_number": 43, "usage_type": "name" }, { "api_name": "cv2.ocl.setUseOpenCL", "line_number": 47, "usage_type": "call" }, { "a...
5313775703
import numpy as np import cv2 import os.path as osp from glob import glob import matplotlib.pyplot as plt from PIL import Image from sklearn.metrics import confusion_matrix import random """ return all gif frames as a Python list """ def load_gif(path): im = Image.open(path) n_frames = im.n_frames count = ...
CS6220-YelpImageSearch/YelpImageSearch
evaluation/utils.py
utils.py
py
3,045
python
en
code
1
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 14, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 34, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
27254983972
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------ Script to obtain uncertainties of heavy mass spectrum and widhts via bootstrap Authors: A. Ramirez-Morales (andres.ramirez.morales@cern.ch) and H. Garcia-Tecocoatzi -------------...
Ailierrivero/bottom-baryonsFW-copy
scripts/bootstrap_three_quark.py
bootstrap_three_quark.py
py
12,649
python
en
code
0
github-code
36
[ { "api_name": "os.getcwd", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 28, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 2...
15521725834
''' 40. Combination Sum II Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. Each number in candidates may only be used once in the combination. Note: All numbers (including target) will be positive...
MarshalLeeeeee/myLeetCodes
40-combinationSum2.py
40-combinationSum2.py
py
3,071
python
en
code
0
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 63, "usage_type": "call" } ]
23504518781
import struct from pathlib import Path from npkpy.common import NPKError, NPKIdError, NPKMagicBytesError from npkpy.npk.npk_constants import CNT_HANDLER from npkpy.npk.cnt_basic import BYTES_LEN_CNT_ID, BYTES_LEN_CNT_PAYLOAD_LEN from npkpy.npk.npk_file_basic import FileBasic MAGIC_BYTES = b"\x1e\xf1\xd0\xba" BYTES_LE...
botlabsDev/npkpy
npkpy/npk/npk.py
npk.py
py
3,324
python
en
code
13
github-code
36
[ { "api_name": "npkpy.npk.npk_file_basic.FileBasic", "line_number": 27, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 30, "usage_type": "name" }, { "api_name": "struct.unpack_from", "line_number": 39, "usage_type": "call" }, { "api_name": "st...
73360141224
# django imports from django.contrib.auth.decorators import login_required from django.contrib.contenttypes.models import ContentType from django.db import IntegrityError from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from django.template....
django-lfs/lfs
manage/views/lfs_portlets.py
lfs_portlets.py
py
6,283
python
en
code
23
github-code
36
[ { "api_name": "django.contrib.contenttypes.models.ContentType.objects.get_for_model", "line_number": 27, "usage_type": "call" }, { "api_name": "django.contrib.contenttypes.models.ContentType.objects", "line_number": 27, "usage_type": "attribute" }, { "api_name": "django.contrib.c...
19449055889
from django.db import models import re import statistics from .direct_indicator import DirectIndicator from .question_response import QuestionResponse find_square_bracket_keys = re.compile(r"\[(.*?)\]") class IndirectIndicator(models.Model): topic = models.ForeignKey('Topic', related_name='indirect_indicators',...
sergioespana/openESEA
backend/core/models/indirect_indicator.py
indirect_indicator.py
py
11,653
python
en
code
1
github-code
36
[ { "api_name": "re.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.mode...
40171037803
import pygame import config pygame.init() class Text: """ Text class handles all text displays on a game window, which is passed by the game handle. Each instance of Text is its own type of text (e.g. velocity output, position output), allowing for easy enabling and disabling of text disp...
tbone-iii/Car-Driving-Simulator
text_display.py
text_display.py
py
3,644
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "config.WHITE", "line_number": 13, "usage_type": "attribute" }, { "api_name": "config.BLACK", "line_number": 14, "usage_type": "attribute" }, { "api_name": "config.default_font_si...
2285190842
from setuptools import setup VERSION = "1.0.3" setup( name="builder", version=VERSION, license="Apache License 2.0", author="The Open Peer Power Authors", author_email="hello@openpeerpower.io", url="https://openpeerpower.io/", description="Opp.io wheels builder form Open Peer Power.", ...
actions-marketplace-validations/OpenPeerPower_wheels
setup.py
setup.py
py
989
python
en
code
0
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 5, "usage_type": "call" } ]
4957095145
import pytest @pytest.mark.asyncio async def test_healthcheck(test_client_rest): response = await test_client_rest.get("http://test/healthcheck") assert response.status_code == 200 data = response.json() assert data == {"status": "ok"}
riuzaver/market-temp-test
{{cookiecutter.project_name}}/tests/test_healthcheck.py
test_healthcheck.py
py
255
python
en
code
0
github-code
36
[ { "api_name": "pytest.mark", "line_number": 4, "usage_type": "attribute" } ]
20522871772
from django.shortcuts import render, get_object_or_404 from .models import Project from django.db.models import Q # Create your views here. def render_producto(request): print(request.GET) queryset = request.GET.get("buscar") print(queryset) productos = Project.objects.all() if queryset: ...
Eliothd2/Imprentala-Website
productos/views.py
views.py
py
871
python
en
code
0
github-code
36
[ { "api_name": "models.Project.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Project.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.Project", "line_number": 11, "usage_type": "name" }, { "api_name": ...
19150802136
''' Reference: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Deep Residual Learning for Image Recognition. arXiv:1512.03385 ''' import torch class ShallowResNetBlock(torch.nn.Module): ''' input -> Conv3x3 -> BN -> ReLU -> Conv3x3 -> BN + ShortCut -> Relu | ...
zllz4/Face-Recognition
models/resnet.py
resnet.py
py
11,268
python
en
code
1
github-code
36
[ { "api_name": "torch.nn", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn.Conv2d", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torch.nn.Conv2d", "lin...
39915116580
import pandas as pd import numpy as np import datetime as dt import os import matplotlib.pyplot as plt from util import get_data, plot_data # prepare the data def normalize_stocks(prices): prices.fillna(method='ffill', inplace=True) prices.fillna(method='bfill', inplace=True) return prices / prices.iloc[0]...
EntingHsiao/Stock_trading_with_ML
indicators.py
indicators.py
py
7,063
python
en
code
1
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 47, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 65, "usage_type": "call" }, { "api_name": "pandas.DataFrame",...
42406250255
import json from flask import url_for from flask_login import current_user from flask_mail import Message from bd_project import mail from bd_project.models import OrderList, Product from bd_project.classes import UserHelper from bd_project.models import Order def add_current_ordered_products(order_products_by_curre...
Braindead3/bd_project
bd_project/users/utils.py
utils.py
py
2,407
python
en
code
0
github-code
36
[ { "api_name": "bd_project.models.OrderList", "line_number": 15, "usage_type": "call" }, { "api_name": "bd_project.models.Product.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bd_project.models.Product", "line_number": 15, "usage_type": "name" }, { ...
11378302691
from functools import reduce n = int(input()) data = list(map(int, input().split())) def mean(data): sum = reduce(lambda x, y: x + y, data) return sum / len(data) def stdev(data): mu = mean(data) sq_sq_dists_mean = list(map(lambda x: (x - mu) ** 2, data)) sum_sq_dists_mean = reduce(lambda x, y:...
scouvreur/hackerrank
10-days-of-statistics/python/day_1_3.py
day_1_3.py
py
427
python
en
code
1
github-code
36
[ { "api_name": "functools.reduce", "line_number": 8, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 15, "usage_type": "call" } ]
39964545331
import openai openai.api_key = "[YOUR_OPENAI_API]" chat_history = [{"role": "system", "content": "You are a assistant."}] def bot_message(input): chat_history.append({"role": "user", "content": f"{input}"}) chat = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=chat_history ...
ingyunson/gpt_chatbot
GPT_chatbot.py
GPT_chatbot.py
py
1,411
python
en
code
0
github-code
36
[ { "api_name": "openai.api_key", "line_number": 3, "usage_type": "attribute" }, { "api_name": "openai.ChatCompletion.create", "line_number": 9, "usage_type": "call" }, { "api_name": "openai.ChatCompletion", "line_number": 9, "usage_type": "attribute" } ]
43046744636
import typing from datetime import datetime from discord import Activity, ActivityType, Embed, Game, HTTPException, Status, Member, User, TextChannel, VoiceChannel, Role, Invite, Game, Emoji, PartialEmoji, Colour from discord.ext import commands from discordbot.botmodules import serverdata, audio from discordbot.conf...
AlexeiSur/bot12345
discordbot/bot.py
bot.py
py
8,041
python
en
code
0
github-code
36
[ { "api_name": "rich.traceback.install", "line_number": 13, "usage_type": "call" }, { "api_name": "rich.pretty.install", "line_number": 15, "usage_type": "call" }, { "api_name": "discord.Member", "line_number": 20, "usage_type": "name" }, { "api_name": "discord.Use...
694411018
import datetime from airflow import models from airflow.operators.bash_operator import BashOperator from airflow.operators.dummy_operator import DummyOperator default_dag_args = { # https://airflow.apache.org/faq.html#what-s-the-deal-with-start-date 'start_date': datetime.datetime(2020, 4, 27) } dataset = 'ai...
cs327e-spring2020/snippets
country2.py
country2.py
py
1,245
python
en
code
2
github-code
36
[ { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "airflow.models.DAG", "line_number": 21, "usage_type": "call" }, { "api_name": "airflow.models", "line_number": 21, "usage_type": "name" }, { "api_name": "airflow.operators....
37220479023
import json with open('settings.json','r',encoding='utf8') as token: data = json.load(token) import requests import subprocess from flask import Flask, render_template, request, abort, make_response, jsonify from datetime import datetime, timezone, timedelta import firebase_admin from firebase_admin import credenti...
NTX8205/LineBot
flask_server.py
flask_server.py
py
10,110
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 3, "usage_type": "call" }, { "api_name": "firebase_admin.credentials.Certificate", "line_number": 10, "usage_type": "call" }, { "api_name": "firebase_admin.credentials", "line_number": 10, "usage_type": "name" }, { "api_na...
12435271099
from urllib.request import urlopen from bs4 import BeautifulSoup import requests import csv import openpyxl import json import time from datetime import datetime from random import random start_time = time.time() print('scraping the site') test = [] options = [] answer = '' image_source = [] choices = None try: ye...
charlesinto/quizAppQuestions
index.py
index.py
py
3,056
python
en
code
2
github-code
36
[ { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 28, "usage_type": "call" }, { "api_name": "random.random", "line_nu...
38799393419
from discord import Interaction import bdg import enum class FormatStyle(enum.Enum): UPPER = 0 LOWER = 1 REVERSED = 2 SPACED = 3 HACKER = 4 IRONIC = 5 hacker_dict = { "a": "4", "s": "5", "o": "0", "e": "3" } class FormatCommand(bdg.BdgCommand): header = { 'name': "formatar", 'description'...
DanielKMach/BotDusGuri
src/commands/fun/format.py
format.py
py
1,487
python
pt
code
1
github-code
36
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "attribute" }, { "api_name": "bdg.BdgCommand", "line_number": 20, "usage_type": "attribute" }, { "api_name": "discord.Interaction", "line_number": 32, "usage_type": "name" } ]
3954925048
# -*- codind: utf-8 -*- import os, sys, random, argparse, time import math import json import codecs import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch import optim install_path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspat...
ZiJianZhao/Unaligned-SLU
base/stc/main.py
main.py
py
7,763
python
en
code
1
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path.append", "l...
73581418663
from flask import Flask, render_template, jsonify from database import engine, text, load_job_from_db app = Flask(__name__) def load_jobs_from_db(): try: with engine.connect() as conn: result = conn.execute(text("select * from jobs")) column_names = result.keys() jobs = [] for row in re...
Maulikdavra/mdfinance-carrer-webiste-v2
app.py
app.py
py
974
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "database.engine.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "database.engine", "line_number": 9, "usage_type": "name" }, { "api_name": "database.text", ...
13285114730
from flair.data import Corpus from flair.datasets import ColumnCorpus from flair.embeddings import TokenEmbeddings, WordEmbeddings, StackedEmbeddings from flair.models import SequenceTagger from flair.trainers import ModelTrainer from pathlib import Path columns={0: 'text', 1: 'label'} dataPath='../data/' test_file=in...
gfreitag/Recipe-Project
python/tester_script.py
tester_script.py
py
1,031
python
en
code
0
github-code
36
[ { "api_name": "flair.data.Corpus", "line_number": 11, "usage_type": "name" }, { "api_name": "flair.datasets.ColumnCorpus", "line_number": 11, "usage_type": "call" }, { "api_name": "flair.embeddings.WordEmbeddings", "line_number": 17, "usage_type": "call" }, { "api...
10762352030
import os import cv2 import rclpy from rclpy.node import Node from sensor_msgs.msg import Image from cv_bridge import CvBridge from handy_msgs.msg import Float32Stamped import readchar import json class MyNode(Node): def __init__(self, name, published_image): super().__init__(name) self.image_publi...
bresilla/webo
webots_ros2_pioneer3at/webots_ros2_pioneer3at/utils/image_player.py
image_player.py
py
2,641
python
en
code
0
github-code
36
[ { "api_name": "rclpy.node.Node", "line_number": 11, "usage_type": "name" }, { "api_name": "sensor_msgs.msg.Image", "line_number": 14, "usage_type": "argument" }, { "api_name": "handy_msgs.msg.Float32Stamped", "line_number": 15, "usage_type": "argument" }, { "api_n...