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
73961134759
from flask import Flask, render_template, request app = Flask(__name__) @app.route("/") def index(): title = "Signos LTDA" return render_template("index.html", title=title) @app.route("/signo_chines") def chines(): title = "Signo Chinês" return render_template("signo_chines.html",title=title) if __n...
LucasRibeiroRJBR/Signos
app.py
app.py
py
368
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" } ]
74925088039
import numpy as np import matplotlib.pyplot as plt x = np.linspace(1, 2, 100) y = x**3 + 2*x*x - 6 plt.plot(x, y, color="blue", linewidth=2.0, linestyle='-',label="cosine") # Establecer limites plt.xlim(x.min() * 0.9, x.max() * 1.1) plt.ylim(y.min() * 0.9, y.max() * 1.1) ## Moviendo los ejes al centro ax = plt.g...
Byhako/python
graficas/wgrafica.py
wgrafica.py
py
997
python
es
code
1
github-code
18
[ { "api_name": "numpy.linspace", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplo...
26095948508
import argparse import json import os # from pprint import pprint from typing import Tuple import ebooklib from ebooklib import epub from gensim import summarization from pkgs.utils import config_system # load paths, books dictionaries paths_dict = config_system.load_paths_config() books_dict = config_system.load_bo...
AmarCodes-22/audino
scripts/summarize.py
summarize.py
py
7,237
python
en
code
0
github-code
18
[ { "api_name": "pkgs.utils.config_system.load_paths_config", "line_number": 14, "usage_type": "call" }, { "api_name": "pkgs.utils.config_system", "line_number": 14, "usage_type": "name" }, { "api_name": "pkgs.utils.config_system.load_books_config", "line_number": 15, "usag...
23791799593
import os import logging import getpass import platform import sys from datetime import datetime, timedelta class LogFileCreationError( Exception ): """ This is my custom exception class to be thrown when there is an error when creating a log file Arguments: Exception {[type]} -- [description] ...
Jpifer13/RasPi-Kubernetes-Cluster-Controller
src/logging/LoggingUtils.py
LoggingUtils.py
py
4,247
python
en
code
0
github-code
18
[ { "api_name": "logging.NOTSET", "line_number": 23, "usage_type": "attribute" }, { "api_name": "getpass.getuser", "line_number": 31, "usage_type": "call" }, { "api_name": "platform.node", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime.n...
19688322782
from django.contrib import admin from .models import Course, CourseTranslation class CourseTranslationInline(admin.TabularInline): model = CourseTranslation fields = ('locale', 'title', 'description') ordering = ('locale',) min_num = 2 extra = 0 @admin.register(Course) class CourseAdmin(admin.M...
ahlsunnah/learn-islam-django
learn_islam/courses/admin.py
admin.py
py
569
python
en
code
1
github-code
18
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "models.CourseTranslation", "line_number": 7, "usage_type": "name" }, { ...
25169119844
# Copyright (C) 2023 by Nikodem "Med0kin" Kuliś # This file is part of the intentsCreator project, # and is released under the "MIT License Agreement". # Please see the LICENSE file that should have been included # as part of this package. import json def new_json() -> dict: intents = { "inten...
Med0kin/intentsCreator
json_maker.py
json_maker.py
py
4,146
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 26, "usage_type": "call" } ]
34834295230
import time from lib.loss_interface import LossInterface from lib.loss_interface import Loss class DeepfaceeditingLoss(LossInterface): def __init__(self, args): super(DeepfaceeditingLoss,self).__init__(args) def get_loss_G(self, G_dict): L_G = 0.0 if self.args.W_recon: L_re...
doublejy715/deepfaceediting-pytorch
deepfaceediting/loss.py
loss.py
py
2,665
python
en
code
2
github-code
18
[ { "api_name": "lib.loss_interface.LossInterface", "line_number": 5, "usage_type": "name" }, { "api_name": "lib.loss_interface.Loss.get_cycle_loss", "line_number": 12, "usage_type": "call" }, { "api_name": "lib.loss_interface.Loss", "line_number": 12, "usage_type": "name" ...
30035300178
# import sys # sys.path.insert(0, '/home/liheng/Desktop/protocol') from core import Contract_pb2 import grpc import api_pb2_grpc import Tron_pb2 import api_pb2 from pprint import pprint class GrpcServer: """ grpc:通过protocbuf协议生成grpc.py文件,调用对应的功能接口 """ # def __init__(self, config): # self.conf...
IUYsongyaya/protocol
protocol1/api/grpc_server.py
grpc_server.py
py
5,939
python
en
code
0
github-code
18
[ { "api_name": "api_pb2.EmptyMessage", "line_number": 24, "usage_type": "call" }, { "api_name": "grpc.insecure_channel", "line_number": 25, "usage_type": "call" }, { "api_name": "api_pb2_grpc.WalletStub", "line_number": 26, "usage_type": "call" }, { "api_name": "Tr...
3769906323
from typing import Optional from simnet.client.components.diary.base import BaseDiaryClient from simnet.models.genshin.diary import Diary from simnet.utils.enum_ import Game class GenshinDiaryClient(BaseDiaryClient): """Genshin diary component.""" async def get_genshin_diary( self, player_id...
PaiGramTeam/SIMNet
simnet/client/components/diary/genshin.py
genshin.py
py
972
python
en
code
12
github-code
18
[ { "api_name": "simnet.client.components.diary.base.BaseDiaryClient", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { ...
21760642458
#!/usr/bin/python3 -OO """ Provides left and right hand prompts for zshell. Additionally a top line filling whole length of the terminal can be drawn. The output of this command is expected to be piped to `source /dev/stdin`. """ from os import getenv from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter ...
gilbus/python-prompt
async_prompt.py
async_prompt.py
py
13,277
python
en
code
1
github-code
18
[ { "api_name": "os.getenv", "line_number": 23, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 46, "usage_type": "name" }, { "api_name": "enum.unique", "line_number": 45, "usage_type": "name" }, { "api_name": "os.getenv", "line_number": 113, ...
35199527213
import pygame from ClsMenu import * import sys import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) #Define pinagem física (outra opção BCM) GPIO.setup(8, GPIO.IN, pull_up_down = GPIO.PUD_DOWN) GPIO.setup(10, GPIO.IN, pull_up_down = GPIO.PUD_DOWN) GPIO.setup(40, GPIO.IN, pull_up_down = GPIO.PUD_DOWN) class Game(): #Ta...
edumoromi/gameterapia
ClsGame_Mao.py
ClsGame_Mao.py
py
7,811
python
en
code
0
github-code
18
[ { "api_name": "RPi.GPIO.setmode", "line_number": 5, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 5, "usage_type": "name" }, { "api_name": "RPi.GPIO.BOARD", "line_number": 5, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "line...
73517908200
"""ProjectPSIT2017""" import pandas as pd import pygal def main(): """ReadData & Plotgraph""" chart = pygal.Bar(title=' Total Imported Value ') datalist = [] address = 'C:/Users/weerapat/Documents/GitHub/Main_Psit_Project2017/Data/ImportedValue.csv' data = pd.read_csv(address) datalist.append(da...
ITFSTUDENT191/Main_Psit_Project2017
ForWeb/Code/Imported_Value.py
Imported_Value.py
py
809
python
en
code
0
github-code
18
[ { "api_name": "pygal.Bar", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" } ]
7210757783
from typing import List class Solution: def uncommonFromSentences(self, s1: str, s2: str) -> List[str]: words = dict() for word in s1.split(): count = words.get(word, 0) words[word] = count +1 for word in s2.split(): count = words.get(word, 0) ...
verybada/leetcode
algorithm/python/UncommonWordsFromTwoSentences/solution.py
solution.py
py
520
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
73912860200
import os from beanie import init_beanie from motor.motor_asyncio import AsyncIOMotorClient from db.item import Item from db.record import Record async def init(): client = AsyncIOMotorClient(os.environ["MONGO_CONNECTION_STRING"]) await init_beanie(database=client.lego, document_models=[Item, Record]) asy...
Loupeznik/lego-price-tracker
db/database.py
database.py
py
898
python
en
code
0
github-code
18
[ { "api_name": "motor.motor_asyncio.AsyncIOMotorClient", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "beanie.init_beanie", "line_number": 12, "usage_type": "call" }, { "api_nam...
74741750441
import logging from gi.repository import GObject, Gtk import yumex.common.const as const from yumex.common import _, ngettext from yumex.gui.views.packagequeue import PackageQueue logger = logging.getLogger("yumex.gui.views") class QueueView(Gtk.TreeView): __gsignals__ = { "queue-refresh": (GObject.Sig...
timlau/yumex-dnf
src/yumex/gui/views/queueview.py
queueview.py
py
5,790
python
en
code
60
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "gi.repository.Gtk.TreeView", "line_number": 12, "usage_type": "attribute" }, { "api_name": "gi.repository.Gtk", "line_number": 12, "usage_type": "name" }, { "api_name": "gi...
32531606809
### Movie-pairs #################### import sys,time from pyspark import SparkConf, SparkContext from math import sqrt ## Settings scoreThreshold = 0.97 coOccurenceThreshold = 50 movieID = 50 simstrengthCut = 200 def loadMovieNames(): ''' Makes a dict of movie ids and na...
atulkakrana/Data-Analytics
spark-similar_movies.py
spark-similar_movies.py
py
3,667
python
en
code
1
github-code
18
[ { "api_name": "math.sqrt", "line_number": 48, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 60, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 66, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 72, ...
13085007626
import argparse import logging import os.path from time import sleep from socket import AF_INET, SOCK_STREAM, socket from const import * from response import Response, CacheContent from request import Request from multiprocessing.dummy import Pool as ThreadPool from multiprocessing import cpu_count class Worker: ...
dmtrbrlkv/otus_python_hw4
app/httpd.py
httpd.py
py
3,377
python
en
code
0
github-code
18
[ { "api_name": "socket.socket", "line_number": 17, "usage_type": "argument" }, { "api_name": "logging.exception", "line_number": 19, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 23, "usage_type": "argument" }, { "api_name": "socket.socket.c...
4349020285
from utils import get_centroids, get_cossim, calc_loss import torch import torch.nn as nn import torch.nn.functional as F class FeatureExtractionCNN(nn.Module): def __init__(self, input_size, num_classes): super(FeatureExtractionCNN, self).__init__() self.conv1 = nn.Conv1d(in_channels=1, out_chann...
Keitoran75/PiezoBuds
conv1dClassify.py
conv1dClassify.py
py
8,933
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Conv1d", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
26861401538
#Dictionaries Challenge 25: Code Breakers App from collections import Counter print("Welcome to the Code Breakers App") #list of elements to remove from all text for analysis non_letters = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ", ".", "?", "!", ",", '"', "'", ":", ";", "(", ")", "%", "$", "&", ...
MarcelNeumeier/Python-Apps
Code Breakers App.py
Code Breakers App.py
py
5,759
python
en
code
0
github-code
18
[ { "api_name": "collections.Counter", "line_number": 25, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 61, "usage_type": "call" } ]
71133277799
#%% import numpy as np import math from scipy.signal import convolve2d from numpy.core.fromnumeric import transpose #%% def to255(X): return (((X-X.min())/(X.max()-X.min()))*255).astype(np.int16) def RMSE(x, y): """ RMSE on single spectral """ return np.sqrt(np.mean(np.power(x - y, 2...
gulubao/SelfS2-Demo
utils/RefeIqa.py
RefeIqa.py
py
2,359
python
en
code
0
github-code
18
[ { "api_name": "numpy.int16", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.power", "line_number"...
17342901024
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('software', '0011_auto_20170305_2022'), ] operations = [ migrations.RemoveField( model_name='chatting', ...
EsmondCho/catchme
software/migrations/0012_auto_20170305_2028.py
0012_auto_20170305_2028.py
py
531
python
en
code
0
github-code
18
[ { "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.RemoveField", "line_number": 14, "usage_type": "call" }, ...
71580247079
# Used many of the code from: https://github.com/kingosticks/mopidy-tunein/blob/master/mopidy_tunein/tunein.py try: import xml.etree.cElementTree as elementtree except ImportError: import xml.etree.ElementTree as elementtree import re import urlparse from urllib import urlencode from Helper import Helper fro...
dernico/mediaschlingel
apis/tunein.py
tunein.py
py
14,087
python
en
code
0
github-code
18
[ { "api_name": "Factory.StreamModelFactory.createFromTunein", "line_number": 24, "usage_type": "call" }, { "api_name": "Factory.StreamModelFactory", "line_number": 24, "usage_type": "name" }, { "api_name": "Factory.StreamModelFactory.createFromStreamJson", "line_number": 41, ...
12582370361
# @author: Gautam Patel # Problem Description URL: https://www.hackerrank.com/challenges/super-reduced-string/problem #!/bin/python3 import math import os import random import re import sys from itertools import groupby # Complete the superReducedString function below. def superReducedString(s): old_s = s new...
gautambp/HackerRank
Master/python3/super-reduced-string.py
super-reduced-string.py
py
764
python
en
code
0
github-code
18
[ { "api_name": "itertools.groupby", "line_number": 18, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 27, "usage_type": "attribute" } ]
25879441252
import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import pickle def loadData(filepath, lowerbound, upperbound): with open(filepath, 'rb') as file: data = pickle.load(file) positions = data['positions'] times = data['time'] new_p...
schmidt12335/data_analysis
15cm_means_pressurechange.py
15cm_means_pressurechange.py
py
2,400
python
en
code
0
github-code
18
[ { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.ones", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 1...
12038823656
import logging import os from optparse import make_option from django.core.management.base import CommandError from multiprocessing import Pool, cpu_count from softwarecollections.management.commands import LoggingBaseCommand from softwarecollections.scls.models import OtherRepo logger = logging.getLogger(__name_...
sclorg/softwarecollections
softwarecollections/scls/management/commands/sclotherrepos.py
sclotherrepos.py
py
1,642
python
en
code
68
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "softwarecollections.management.commands.LoggingBaseCommand", "line_number": 28, "usage_type": "name" }, { "api_name": "softwarecollections.management.commands.LoggingBaseCommand.option_li...
30432922609
# -*- coding: utf-8 -*- """ Created on Thu Jan 23 17:28:54 2014 @author: cesar zamora """ import numpy as np from scipy.spatial import Delaunay n = 100 points = np.zeros((n,2)) for i in range(0,n): #genera n puntos aleatorios dentro del cir de radio 1 point = np.array([1.,1.]) while np.linalg.norm(point) >...
czammar/eit_thesis
src/aux_programs/mesh_prueba.py
mesh_prueba.py
py
1,555
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_nu...
73250169960
# -*- coding: utf-8 -*- """ parrot plugin: Sends out messages to MUC or JID. """ __author__ = "Petr Morávek (xificurk@gmail.com)" __copyright__ = ["Copyright (C) 2007 Kevin Smith", "Copyright (C) 2009-2011 Petr Morávek"] __license__ = "GPL 3.0" __version__ = "0.5.0" import logging log = logging.g...
xificurk/keelsbot
plugins/parrot.py
parrot.py
py
1,649
python
en
code
4
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" } ]
26595780102
import json import os import requests import time from kafka import KafkaProducer def fetch() -> dict: endpoint = 'https://api.coindesk.com/v1/bpi/currentprice.json' res = requests.get(endpoint) res_json = json.loads(res.text) return res_json def clean_record(raw: dict) -> dict: return { ...
Masamerc/kakfa-stream-simple-app
stream-producer/producer.py
producer.py
py
962
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "kafka.KafkaProducer", "line_number": 24, "usage_type": "name" }, { "api_name": "os.environ.get", "lin...
4813182473
# Verdi GUI is a small tool to interface with a Coherent Verdi laser through Serial # Verdi GUI is distributed under the MIT Expat License from PyQt4 import QtCore, QtGui import os, serial, sys, time from win32event import CreateMutex from win32api import CloseHandle, GetLastError from winerror import ERROR_ALREADY_EX...
lsav/verdi-gui
VerdiGUI.py
VerdiGUI.py
py
26,049
python
en
code
1
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "serial.Serial", "line_number": 85, "usage_type": "call" }, { "api_name": "serial.serialutil", "...
28108407450
#!/usr/bin/env python3 from Crypto.Cipher import AES import requests import time import string def encrypt(payload): url = "http://aes.cryptohack.org/ecb_oracle/encrypt/" r = requests.get(url + payload + '/') return r.json()['ciphertext'] def print_blk(hex_blks, sz): for i in range(0, len(hex_blks), sz...
onealmond/hacking-lab
cryptohack/ecb-oracle/ecb_oracle.py
ecb_oracle.py
py
1,076
python
en
code
72
github-code
18
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "string.digits", "line_number": 20, "usage_type": "attribute" }, { "api_name": "string.ascii_lowercase", "line_number": 20, "usage_type": "attribute" }, { "api_name": "string.asc...
12653892252
#! /usr/bin/env python # -*- coding: utf-8 -*- import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import os import sys sys.path.append('../../../..') import argparse import math import cv2 import numpy as np import csv import glob import yaml import pickle from multiprocessing import Pool import...
iidango/tangologger
manual_alignment/test/alignment/align2d_search.py
align2d_search.py
py
23,250
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "...
9699895558
"""Action Handler Module.""" from collections import deque from ..context import context from ._action import Action, HandlerAction, ReversibleAction class ActionHandler: """Action Handler Class. Implements action execution and Undo/Redo functionality. """ DEFAULT_MAX_UNDO = 100 def __init__(s...
thetacom/hexabyte
hexabyte/actions/action_handler.py
action_handler.py
py
1,510
python
en
code
185
github-code
18
[ { "api_name": "collections.deque", "line_number": 20, "usage_type": "name" }, { "api_name": "_action.ReversibleAction", "line_number": 20, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 21, "usage_type": "name" }, { "api_name": "_action....
75118377959
#!/usr/bin/python3 # COMP3311 22T3 Assignment 2 # Print a list of character roles played by an actor/actress import sys import psycopg2 ### Globals db = None usage = f"Usage: {sys.argv[0]} FullName" ### Command-line args if len(sys.argv) < 2: print(usage) exit(1) # process the command-line args ... name =...
cinnamenn/comp3311-database
assignment 2/roles.py
roles.py
py
1,802
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "psycopg2.connect", "lin...
37403430758
# KunShan Assignment 6 # q1a def natureNumbers(n: int) -> None: def natureNumber(n: int) -> None: if n <= 1: print('1', end=' ') else: natureNumber(n - 1) print(n, end=' ') natureNumber(n) print() # q2a def alt(s: str, t: str) -> str: if len(s) == 0 ...
Methane-Kun/DePaul_CODE
CSC401/codes/Kun_Shan_Assign_6.py
Kun_Shan_Assign_6.py
py
1,278
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 59, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 59, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 60, "usage_type": "call" }, { "api_name": "matpl...
21475176877
from pathlib import Path from unittest.mock import mock_open, patch from gen_unit_tables import write_unit_table def test_write_unit_table(snapshot): with patch.object(Path, "open", mock_open()) as mock_open_file: write_unit_table(filename=Path()) lines = [ args[0] for args in mock_open_file...
MDAnalysis/UserGuide
doc/source/scripts/tests/snapshot/test_gen_unit_tables.py
test_gen_unit_tables.py
py
478
python
en
code
21
github-code
18
[ { "api_name": "unittest.mock.patch.object", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "argument" }, { "api_name": "unittest.mock.patch", "line_number": 8, "usage_type": "name" }, { "api_name": "unittest...
26195096700
import pprint import pandas as pd from sklearn.metrics import roc_auc_score, average_precision_score def score_counter(val, y_true, y_pred): scores = { "TP": 0, "FP": 0, "TN": 0, "FN": 0 } for i in range(len(y_pred)): if y_pred[i] == val: ...
PhlipPhlops/covid_ICU_prediction
custom_classification_report.py
custom_classification_report.py
py
3,191
python
en
code
0
github-code
18
[ { "api_name": "pandas.DataFrame", "line_number": 79, "usage_type": "call" }, { "api_name": "sklearn.metrics.roc_auc_score", "line_number": 96, "usage_type": "call" }, { "api_name": "sklearn.metrics.average_precision_score", "line_number": 97, "usage_type": "call" } ]
26291546653
import coloredlogs, logging coloredlogs.install(fmt='%(levelname)7s %(asctime)s %(hostname)s %(message)s') import numpy as np import matplotlib.pyplot as plt # a combination of different randoms Bn = 256 Sn = 80 A = np.concatenate((np.random.randn(Bn) * 0.2 + 8, np.random.randn(Bn) * 3 - 10, np.random.randn(Bn), np...
maeola/mnist-gan
sample.py
sample.py
py
727
python
en
code
0
github-code
18
[ { "api_name": "coloredlogs.install", "line_number": 2, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random"...
25988547643
import os import argparse import json import numpy as np import torch from utils.util import get_mask_mnr, get_mask_bm, get_mask_rm from utils.util import find_max_epoch, print_size, sampling, calc_diffusion_hyperparams from imputers.DiffWaveImputer import DiffWaveImputer from imputers.SSSDSAImputer import SSSDSAImpu...
AI4HealthUOL/SSSD
src/inference.py
inference.py
py
7,925
python
en
code
183
github-code
18
[ { "api_name": "os.path.join", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number": 50, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
17071824422
import os import re import itertools import logging import pandas as pd from slugify import slugify from labonneboite.conf import settings from labonneboite.common import mapping as mapping_util from labonneboite.common import hiring_type_util from labonneboite.common import geocoding from labonneboite.common.search i...
StartupsPoleEmploi/labonneboite
labonneboite/scripts/prepare_mailing_data.py
prepare_mailing_data.py
py
8,721
python
en
code
42
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "lin...
29583719288
from typing import List class Solution: def permute(self, nums: List[int]) -> List[List[int]]: self.result = [] self.list = [] self.backtrack(nums) return self.result def backtrack(self, nums): if len(nums) == len(self.list): self.result.append(self.list[:]) ...
HALF-MAN/lt
python/46. Permutations.py
46. Permutations.py
py
515
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 3, "usage_type": "name" } ]
36244186025
import json import src.data_loaders as module_data import torch from pytorch_lightning import seed_everything, Trainer from torch.utils.data import DataLoader from train import ToxicClassifier def initialize_trainer(CONFIG): seed_everything(1234) device = torch.device("cuda" if torch.cuda.is_available() else...
unitaryai/detoxify
tests/test_trainer.py
test_trainer.py
py
1,873
python
en
code
755
github-code
18
[ { "api_name": "pytorch_lightning.seed_everything", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 12, "usage_type": "call" }, { "api_name":...
9402629135
import sys from git import Repo, GitCommandError # type: ignore import requests from requests import Response from src.filepath import ROOT_PATH from src.migration.migrator import Migrator, _Version from src.logger_handler import LoggerHandler from src import FUTURE_PYTHON_VERSION from src.utils import restart_progra...
AndreWohnsland/CocktailBerry
src/updater.py
updater.py
py
4,445
python
en
code
51
github-code
18
[ { "api_name": "src.logger_handler.LoggerHandler", "line_number": 13, "usage_type": "call" }, { "api_name": "src.filepath.ROOT_PATH", "line_number": 21, "usage_type": "name" }, { "api_name": "git.Repo", "line_number": 22, "usage_type": "call" }, { "api_name": "git....
3491399771
from collections import defaultdict from functools import reduce def solution(clothes): type = defaultdict(int) for cloth in clothes: type[cloth[1]]+=1 return reduce(lambda x, y: x * y, [i+1 for i in type.values()])-1 print(solution([["yellow_hat", "headgear"], ["blue_sunglasses", "eyewear"], ...
rachel5004/Algorithm
Programmers/Hash/Camouflage.py
Camouflage.py
py
668
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 4, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 7, "usage_type": "call" } ]
70406585961
import pygame import little_ship_function as function from little_ship_setting import Setting from little_ship_ship import Little_ship from pygame.sprite import Group from rect import Rect '''这是一个小飞船的游戏''' def game_run(): pygame.init() settings = Setting() screen = pygame.display.set_mode( (sett...
RyanLin1995/python
PythonLearning/小游戏/little_ship/little_ship_game.py
little_ship_game.py
py
840
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 13, "usage_type": "call" }, { "api_name": "little_ship_setting.Setting", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 15, "usage_type": "call" }, { "api_name": "pygam...
4166689297
import os import math from urllib.parse import urlencode import pandas as pd import numpy as np from ulttb import downsample from bottle import abort import config class App(): def __init__(self, *args, **kwargs): # set up output dir if not os.path.exists(config.APP_CONFIG["OUTPUT_DIR"]): ...
ceos-coverage/coverage-data-downsampler
src/app.py
app.py
py
6,449
python
en
code
2
github-code
18
[ { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "config.APP_CONFIG", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.makedirs", ...
18377329765
from django.shortcuts import render,redirect from django.views.generic import ListView,DetailView,TemplateView,CreateView from car_rent import settings from main.models import Car,CarClass,Images,AboutUs,Contacts,CarMarka,SendList from main.forms import OrderDataForm from django.urls import reverse_lazy from threading...
Agil89/car_rent
car_rent/main/views.py
views.py
py
3,358
python
en
code
0
github-code
18
[ { "api_name": "django.views.generic.ListView", "line_number": 17, "usage_type": "name" }, { "api_name": "main.models.Car", "line_number": 18, "usage_type": "name" }, { "api_name": "main.models.CarClass.objects.all", "line_number": 25, "usage_type": "call" }, { "ap...
22313595999
import streamlit as st import datetime as DT import pandas as pd def gsc_data_work(df, site_url, days_selector, days_ago): try: #df = webproperty.query.search_type(search_type).range('today',days=days_ago).dimension('date', 'page').get().to_dataframe() df['date'] = pd.to_datetime(df['dat...
Fruall/google_search_console_streamlit
functions.py
functions.py
py
1,095
python
en
code
0
github-code
18
[ { "api_name": "pandas.to_datetime", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.to_numeric", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.to_numeric", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date....
30116134759
#! usr/bin/env python from sys import argv from os.path import exists import simplejson as json script, in_file, out_file = argv data = json.load(open(in_file)) usable = data["data"]["list"] geojson = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry" : { ...
QuanShuang/QuanSHUANG.github.io
resources/transformer.py
transformer.py
py
658
python
en
code
1
github-code
18
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "name" }, { "api_name": "simplejson.load", "line_number": 9, "usage_type": "call" }, { "api_name": "simplejson.dump", "line_number": 28, "usage_type": "call" } ]
23032622319
import PySimpleGUI as sg import planar_projection import obj_reader import workarounds def RGB_2_HEX(x: tuple): return f"#{x[0]:02x}{x[1]:02x}{x[2]:02x}" def refresh_view(RENDER_MODE): canvas: sg.Graph = window['-GRAPH-'] canvas.erase() points = my_camera.project_object(my_object) if RENDER_M...
EdwardChamberlain/PySimpleGUI-3D-Viewer
src/main.py
main.py
py
3,778
python
en
code
5
github-code
18
[ { "api_name": "PySimpleGUI.Graph", "line_number": 13, "usage_type": "attribute" }, { "api_name": "obj_reader.import_obj", "line_number": 61, "usage_type": "call" }, { "api_name": "planar_projection.Camera_3D", "line_number": 62, "usage_type": "call" }, { "api_name...
37057050301
import configuracion import vdb_generado import utiles import criticidades import logging import requests import re import time from threading import Thread class Iterador_Nessus_Vdb(Thread): conf = configuracion.Configuracion() componente = None columnas_fijas = None environmental_im...
DanielPastorMiguel/VDBauto
nessus_iterador.py
nessus_iterador.py
py
24,498
python
es
code
0
github-code
18
[ { "api_name": "threading.Thread", "line_number": 11, "usage_type": "name" }, { "api_name": "configuracion.Configuracion", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.log", "line_number": 35, "usage_type": "call" }, { "api_name": "utiles.get_n...
40904234499
import torch import torch.nn as nn from torchvision import models from torch.nn import functional as F def get_backbone(name, pretrained=True): """ Loading backbone, defining names for skip-connections and encoder output. """ # loading backbone model if name == 'resnet18': backbone = models.resne...
vkola-lab/unaah
models/networks/UNaah.py
UNaah.py
py
11,124
python
en
code
2
github-code
18
[ { "api_name": "torchvision.models.resnet18", "line_number": 12, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 12, "usage_type": "name" }, { "api_name": "torchvision.models.resnet34", "line_number": 14, "usage_type": "call" }, { "api_na...
72672049321
import pandas as pd import numpy as np from ACME.utils import clean_list from ACME.ACME_function import computeACME, build_feature_exploration_table, predictACME from ACME.ACME_plot import ACME_summary_plot, feature_exploration_plot, ACME_barplot_multicalss from ACME.ACME_anomaly_detection import build_anomaly_detectio...
dandolodavid/ACME
ACME/ACME.py
ACME.py
py
19,035
python
en
code
4
github-code
18
[ { "api_name": "numpy.setdiff1d", "line_number": 38, "usage_type": "call" }, { "api_name": "ACME.utils.clean_list", "line_number": 81, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 87, "usage_type": "call" }, { "api_name": "numpy.where", "...
15325764249
from tkinter import * import webbrowser import backend from pygame import mixer import pygame class Frontend(object): def __init__(self,window): self.window = window self.bk = backend.Backend() myfont = ('New Times Roman', 18) #Create Labels self.lbl = Label(master=window,...
saraponton/MusicDatabase
frontend.py
frontend.py
py
4,456
python
en
code
0
github-code
18
[ { "api_name": "backend.Backend", "line_number": 11, "usage_type": "call" }, { "api_name": "webbrowser.open", "line_number": 110, "usage_type": "call" }, { "api_name": "webbrowser.open", "line_number": 116, "usage_type": "call" }, { "api_name": "pygame.init", "...
14589018975
###Main module for OCR API application### from __future__ import print_function import os import sys import subprocess import json from PIL import Image import logging from flask import jsonify from fuzzywuzzy import fuzz from fuzzywuzzy import process #configure pyhton logging module for log creation logging.basicCo...
elisaper/OCR
ocr/__init__.py
__init__.py
py
4,498
python
en
code
0
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 15, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.stderr", "li...
22050702469
#!/usr/bin/env python """ Simple script to check availability of new docker images from hub.docker.com """ import docker from helpers import mylogger client = docker.from_env() def get_name(image): """ Get image name from "image" object """ name = image.attrs["RepoDigests"][0] name = name.split(...
andrejgorin/Docker
docker_checker.py
docker_checker.py
py
1,164
python
en
code
2
github-code
18
[ { "api_name": "docker.from_env", "line_number": 9, "usage_type": "call" }, { "api_name": "helpers.mylogger.info", "line_number": 44, "usage_type": "call" }, { "api_name": "helpers.mylogger", "line_number": 44, "usage_type": "name" }, { "api_name": "helpers.mylogge...
4713544705
import json import os import scipy from Evaluation import Evaluation from OptimizationProblems import initialize_optimization_problem from OptimizationTask import optimization_task from billiard import Pool from celery import Celery from utils.Datatypes import OptimizationParameters from utils.Logger import MyLogger ...
Merck/mRNAid
backend/flask_app/tasks.py
tasks.py
py
2,381
python
en
code
9
github-code
18
[ { "api_name": "utils.Logger.MyLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "celery.Celery", "line_n...
38927447570
# # @lc app=leetcode id=27 lang=python3 # # [27] Remove Element # # @lc code=start from typing import List class Solution: def removeElement(self, nums: List[int], val: int) -> int: length = len(nums) index = 0 for i in range(length): if nums[i] != val: ...
huhudev-git/leetcode
27.remove-element.py
27.remove-element.py
py
523
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" } ]
72152729641
from django.urls import path from . import views urlpatterns = [ path( "transactions/", views.TransactionViewSet.as_view({"get": "get"}), name="transactions", ), path( "statements/", views.StatementViewSet.as_view({"get": "get", "post": "post"}), name="state...
briancaffey/django-postgres-vue-gitlab-ecs
backend/apps/banking/urls.py
urls.py
py
337
python
en
code
60
github-code
18
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" } ]
2745645617
# -*- coding: utf-8 -*- import base64 import json import os import os.path import shutil import socket import sys import tarfile import tempfile import unittest import pytest import six from docker.api.client import APIClient from docker.constants import IS_WINDOWS_PLATFORM from docker.errors import DockerException ...
ksshanam/docker-py
tests/unit/utils_test.py
utils_test.py
py
38,166
python
en
code
1
github-code
18
[ { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
25804874451
# coding:utf-8 import tornado.ioloop import tornado.httpserver import tornado.options import logging from tornado.options import define, options from tornado import web from tornado import gen from tornado.web import authenticated, RequestHandler import os import json from tornado.gen import coroutine define("port",...
morya/dockerfile-tornado
web/w.py
w.py
py
1,705
python
en
code
0
github-code
18
[ { "api_name": "tornado.options.define", "line_number": 16, "usage_type": "call" }, { "api_name": "tornado.options.define", "line_number": 17, "usage_type": "call" }, { "api_name": "tornado.web.RequestHandler", "line_number": 20, "usage_type": "name" }, { "api_name...
4828526137
import string import re import pickle from nltk.corpus import stopwords from stemming.porter2 import stem import networkx as nx from tqdm import tqdm def ProcessAmazon(save_data_path): """ This function opens the Amazond data as a text file. The loop allows us to store the relevant products metadata into...
mathieutardy/LinkPrediction
text2dict.py
text2dict.py
py
3,513
python
en
code
0
github-code
18
[ { "api_name": "tqdm.tqdm", "line_number": 38, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 61, "usage_type": "call" }, { "api_name": "re.escape", "line_number": 62, "usage_type": "call" }, { "api_name": "string.digits", "line_number": 62,...
42435086688
import logging import os import tempfile import unittest from google.cloud.dataflow import version from google.cloud.dataflow.worker import environment class EnvironmentTest(unittest.TestCase): def create_temp_file(self, path, contents): with open(path, 'w') as f: f.write(contents) return f.name ...
volnt/DataflowPythonSDK
google/cloud/dataflow/worker/environment_test.py
environment_test.py
py
1,808
python
en
code
null
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", ...
69897038762
#!/usr/bin/env python # coding: utf-8 # In[1]: import os.path import warnings warnings.simplefilter("ignore", UserWarning) import sys import argparse import pandas as pd import pickle from nltk.corpus import stopwords stop_words = set(stopwords.words('english')) from sklearn.preprocessing import MultiLabelBinarizer...
kilicogluh/CONSORT-TM
svm/predict.py
predict.py
py
2,732
python
en
code
11
github-code
18
[ { "api_name": "warnings.simplefilter", "line_number": 9, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 16, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 16, "usage_type": "name" }, { "api_name":...
29219065414
import argparse import json import logging import os import time from logging.handlers import RotatingFileHandler import requests import urllib3 from influxdb import InfluxDBClient from mb8600.modem import MB8600 urllib3.disable_warnings() logger = logging.getLogger() logger.setLevel(logging.INFO) formatter = loggi...
xNinjaKittyx/mb8600
data_export.py
data_export.py
py
4,124
python
en
code
4
github-code
18
[ { "api_name": "urllib3.disable_warnings", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging....
33994937308
#This Code Just Flips The Images Used For Flipping The Left to Make Right For Data Augumentation Purpose import os from PIL import Image path_of_the_directory= './data/left' st = "right" count = 226 x = 206 print("Files and directories in a specified path:") for filename in os.listdir(path_of_the_directory): ...
174414-Rodda/AngryGrannyAI
DataColection/Flipper.py
Flipper.py
py
669
python
en
code
3
github-code
18
[ { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number...
71427482600
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV fil...
aorursy/new-nb-3
jagdish2386_understanding-confusion-matrix.py
jagdish2386_understanding-confusion-matrix.py
py
2,554
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 50, "usage_type": "call" }, { "api_name": "s...
23744490389
import os import ujson as json import pytups as pt import pandas as pd import datetime import numpy as np def read_json(filename): with open(filename, 'r') as f: return json.load(f) def _treat_stop_area(one_stop): get_line_time = lambda v: (v['line']['shortName'], v['dateTime']) return pt.TupList...
pchtsp/transport_api
TisseoR/analize_tisseo.py
analize_tisseo.py
py
14,649
python
en
code
0
github-code
18
[ { "api_name": "ujson.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pytups.TupList", "line_number": 15, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_num...
3962913657
from core import base from core.db import Base, session_scope from core.auth import Auth from sqlalchemy import Column, Integer, String class Perform(Base): __tablename__ = 'perform' id = Column(Integer, primary_key=True) bot_id = Column(String) pline = Column(String) @classmethod def list_li...
DempDemp/nautilus
core/perform.py
perform.py
py
2,879
python
en
code
2
github-code
18
[ { "api_name": "core.db.Base", "line_number": 6, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 9, "usage_type": "argument" }, { "api_name": "sqlalchemy.Column"...
44179376744
import os print(os.getcwd()) from uuid import uuid4 import cgi, types from json import loads, dumps from copy import deepcopy from urllib import parse as urlparse from gevent.pywsgi import WSGIServer import gevent from views import ( home, user_list, update_user, not_found_page, ) from mod...
GingerLee11/practice-webapi
api/server.py
server.py
py
3,818
python
en
code
0
github-code
18
[ { "api_name": "os.getcwd", "line_number": 2, "usage_type": "call" }, { "api_name": "models.Session", "line_number": 21, "usage_type": "call" }, { "api_name": "models.User", "line_number": 34, "usage_type": "argument" }, { "api_name": "models.User", "line_numbe...
189241944
from tensorflow.keras.optimizers import Adam from imports import * import cnn import batchprep import keras.backend as K from tensorflow.keras.callbacks import ReduceLROnPlateau from keras.models import model_from_json from pydub import AudioSegment import matplotlib.cm as cm from matplotlib.colors import Nor...
Rodeanugd/mgr-cnn
backend/predictsong.py
predictsong.py
py
2,673
python
en
code
0
github-code
18
[ { "api_name": "keras.models.model_from_json", "line_number": 27, "usage_type": "call" }, { "api_name": "pydub.AudioSegment.from_mp3", "line_number": 33, "usage_type": "call" }, { "api_name": "pydub.AudioSegment", "line_number": 33, "usage_type": "name" }, { "api_n...
37679763872
import unittest from compare_args import compare_args from utils import broken_fact, add, plus_broken from math import factorial class TestCompareArgs(unittest.TestCase): def test_compare_args_broken_fact(self): self.assertEqual( compare_args(broken_fact, factorial, [(0,), (1,), (5,)]), ...
Kehrlann/python-functions
test_compare_args.py
test_compare_args.py
py
590
python
en
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "compare_args.compare_args", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.broken_fact", "line_number": 11, "usage_type": "argument" }, { "api_name": ...
26516624235
from typing import Dict, Union from acme import types from acme.adders.reverb import base import jax import jax.numpy as jnp import numpy as np import tree def zeros_like(x: Union[np.ndarray, int, float, np.number]): """Returns a zero-filled object of the same (d)type and shape as the input. The difference betw...
deepmind/acme
acme/adders/reverb/utils.py
utils.py
py
2,859
python
en
code
3,100
github-code
18
[ { "api_name": "typing.Union", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.number", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.number", ...
35268345483
# Green lines signify a significant level of resistance. Usually occurs once a stock hits a ATH and then rests and # consolidates for a couple of months import yfinance as yf import datetime as dt import pandas as pd from pandas_datareader import data as pdr yf.pdr_override() start_date = dt.datetime(1980, 12, 1) now...
judgedreadnaught/IntroToFinance
GreenLineBreakoutCalc.py
GreenLineBreakoutCalc.py
py
1,955
python
en
code
0
github-code
18
[ { "api_name": "yfinance.pdr_override", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime...
9608995003
from django.db.models import Q from django.shortcuts import render # Create your views here. from gym.models import Gym def search(request): q = request.GET.get('q') print(q) context = { 'q': q, 'gym_results': Gym.objects.filter(Q(name__icontains=q) | ...
TobWul/Koble
home/views.py
views.py
py
595
python
en
code
0
github-code
18
[ { "api_name": "gym.models.Gym.objects.filter", "line_number": 13, "usage_type": "call" }, { "api_name": "gym.models.Gym.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "gym.models.Gym", "line_number": 13, "usage_type": "name" }, { "api_name...
7431389060
from pdf2image import convert_from_path from pathlib import Path file_path = "./pdf_files/others/eng1.pdf" # file_path = "./pdf_files/jobi-1.pdf" # file_path = "./pdf_files/right-blue-1.pdf" import fitz doc = fitz.open(file_path) page = doc[0] height = page.rect.height width = page.rect.width print(width) print(...
bahaminabbasi/pdfminer
pdftoimage.py
pdftoimage.py
py
1,215
python
en
code
0
github-code
18
[ { "api_name": "fitz.open", "line_number": 14, "usage_type": "call" }, { "api_name": "pdf2image.convert_from_path", "line_number": 25, "usage_type": "call" } ]
37896502385
from __future__ import unicode_literals #-*- coding: utf-8 -*- """ Models for the Agave hosted identity service. LdapUser model borrows heavily from the django-ldapdb example model. """ __author__ = 'jstubbs' from django.conf import settings from ldapdb.models.fields import CharField, IntegerField import ldapdb.model...
agaveplatform/pyprofiles-api
agave_id/service/models.py
models.py
py
2,164
python
en
code
0
github-code
18
[ { "api_name": "ldapdb.models.fields.models", "line_number": 15, "usage_type": "attribute" }, { "api_name": "ldapdb.models.fields", "line_number": 15, "usage_type": "name" }, { "api_name": "django.conf.settings.LDAP_BASE_SEARCH_DN", "line_number": 21, "usage_type": "attrib...
26965426456
import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import OneHotEncoder import copy from models.decisiontree import DecisionTree from utils import perf_metrics_2X2, plot_confusion_matrix class AdaBoost: def __init__(self, n_estimators=None, base_estimator=None): if n_estimators is None:...
Subangkar/Machine-Learning-CSE-472-BUET
Assignment-1/Adaboost/models/adaboost.py
adaboost.py
py
4,305
python
en
code
1
github-code
18
[ { "api_name": "models.decisiontree.DecisionTree", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 38, "usage_type": "call" }, { "api_name": "sklearn.prep...
16529571450
from sentinelsat import SentinelAPI from collections import OrderedDict import pandas as pd import time tic = time.time() """ login """ user = "rsfuzzy_1" password = "Qwezxc789Qwezxc789" api = SentinelAPI(user, password) """ querry prepare """ producttype = "S2MSI1C" # producttype = "S2MS2Ap" # doesn't work # p...
kiarash-borooshan/sentinel-download-by-tiles
SentinelDownByTile.py
SentinelDownByTile.py
py
4,474
python
en
code
0
github-code
18
[ { "api_name": "time.time", "line_number": 7, "usage_type": "call" }, { "api_name": "sentinelsat.SentinelAPI", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.OrderedD...
9187168032
import sys sys.stdin = open('bj1761.txt','r') from collections import deque def LCA(x,y): if Depth[x]>Depth[y]:x,y=y,x for i in range(20,-1,-1): if Depth[y]-Depth[x]>=1<<i:y=Par[y][i] if x==y:return x for i in range(20,-1,-1): if Par[x][i]!=Par[y][i]: x=Par[x][i] ...
choo0618/TIL
algoritm/20상반기 코딩테스트/정점들의 거리/bj1761.py
bj1761.py
py
1,004
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin", "line_number": 2, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 24, "usage_type": "call" } ]
17998357353
"""main""" def main(): """main docx""" import json txt = json.loads(input()) lim = float(input()) human = [i for i in txt] human = sorted(list(filter(lambda num: int(txt[num]) >= lim, human))) if human == []: print("Nope") return _ = [print(human[i], "%.2f"%txt[human[i]],...
docxed/codeEjust
Filter.py
Filter.py
py
368
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 5, "usage_type": "call" } ]
71908582120
import logging import numpy as np import pandas as pd from utils import printColors import matplotlib.pyplot as plt logger = logging.getLogger("appLogger") class Interraction: __export = None __graph = None def __init__(self, databaseInstance): self.__export = Export(databaseInstance) se...
Pierre-Jean-Descarpentries/INF34515---Projet-en-informatique
src/visualize.py
visualize.py
py
13,371
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "utils.printColors.FAIL", "line_number": 29, "usage_type": "attribute" }, { "api_name": "utils.printColors", "line_number": 29, "usage_type": "name" }, { "api_name": "utils....
16909595994
import cv2 from camera import CameraThread def get_cameras(): max_tested = 100 for i in range(max_tested): temp_camera = cv2.VideoCapture(i) if temp_camera.isOpened(): temp_camera.release() continue return i class CameraEnv: def __init__(self, env): self.en...
AlexanderKhazatsky/household_robots
robot_control/camera_env_wrapper.py
camera_env_wrapper.py
py
543
python
en
code
0
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "camera.CameraThread", "line_number": 18, "usage_type": "call" } ]
14470126362
from dataclasses import dataclass from time import time # each social channel has a type # and the current number of followers # SocialChannel = tuple[str, int] @dataclass class SocialChannel: channel_type: str followers: int # each post has a message and the timestamp when it should be posted # Post = tuple...
Daniechka/software-mindset
doings/ex5.py
ex5.py
py
1,967
python
en
code
0
github-code
18
[ { "api_name": "dataclasses.dataclass", "line_number": 7, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 15, "usage_type": "name" }, { "api_name": "time.time", "line_number": 50, "usage_type": "call" } ]
34361592287
from .. import models,schema from fastapi import FastAPI, HTTPException,Depends,status,APIRouter from sqlalchemy.orm import Session from ..database import get_db router=APIRouter( tags=['post'] ) #read all posts @router.get("/posts") def view_posts(db: Session=Depends(get_db)): posts = db.query(models.Post).al...
Amani-kintsugy/pet
app/routers/post.py
post.py
py
1,486
python
en
code
0
github-code
18
[ { "api_name": "fastapi.APIRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 11, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 11, "usage_type": "call" }, { "api_name": "database.get_...
75329304999
from __future__ import print_function ########################################### # Matplotlib support ########################################### ENABLE_PLOTTING=1 # Disable plotting if running on a machine without matplotlib # ...
MITHaystack/CorrelX
src/cx2d_lib.py
cx2d_lib.py
py
109,308
python
en
code
7
github-code
18
[ { "api_name": "imp.reload", "line_number": 214, "usage_type": "call" }, { "api_name": "imp.reload", "line_number": 219, "usage_type": "call" }, { "api_name": "imp.reload", "line_number": 229, "usage_type": "call" }, { "api_name": "imp.reload", "line_number": 2...
13680834724
#!/usr/bin/env python3 import os import configparser import logging import datetime import shutil import time import pexpect import paramiko """ python3 -m pip install -U pip setuptools """ logging_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'run.log') logging.basicConfig(filename=logging_file, le...
ulimit65535/mysqlbackup
main.py
main.py
py
11,376
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.abspath", "line...
17173536100
# -*- coding: utf-8 -*- import math import torch from torch import nn from torch import optim # Variational Auto Encoder class VAE(nn.Module): def __init__(self, latent_dim, input_dim, hidden_dim=200, device='cpu'): """ Standart model of VAE with ELBO optimization. Args: laten...
Intelligent-Systems-Phystech/DeepGenerativeModels
src/DeepGenerativeModels/AutoEncoders.py
AutoEncoders.py
py
14,142
python
en
code
3
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
1997812239
import re, sys from pathlib import Path import subprocess as sp # load the path of d4j_scripts d4j_scripts_Path = Path('../../d4j_scripts').resolve() sys.path.append(str(d4j_scripts_Path)) sys.path.append(str(d4j_scripts_Path / 'd4j_ori')) from defects4j import * from d4j_info import * d4jBuggyProjDirPath = Path('../...
mutrepair/BenchmarkingAPR
tools/npr4j/checkEditsPatches.py
checkEditsPatches.py
py
8,181
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_n...
42481317031
import torch from torchvision.datasets import MNIST, CIFAR10 import torchvision.transforms as transforms from torch.utils.data import Dataset, DataLoader import numpy as np from utils.dataset_utils import DatasetCache, DatasetSubset, TransformDataset class BanditDataset(Dataset): def __init__(self, contexts, acti...
davidbrandfonbrener/deep-offline-bandits
utils/data.py
data.py
py
7,170
python
en
code
2
github-code
18
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.save", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 36, "usage_type": "call" }, { "api_name": "torchvision.datasets.CI...
23819326263
from pickletools import optimize import sys, os sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) import torch from torch.utils.data import DataLoader import pickle from rdkit import Chem from rdkit import rdBase from tqdm import tqdm from Dataset.get_dataset import get_dat...
ggkong/tfCompared
Script/aae_script/step2_train_aae.py
step2_train_aae.py
py
21,795
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number...
40259115927
import requests word = input("PLease input the word that you want search for in a Dictionary: ") url = "https://api.dictionaryapi.dev/api/v2/entries/en/{0}".format(word) api_response = requests.get(url) my_dictionary = api_response.json() for dictionary in my_dictionary: print(dictionary) print(f"Word: {dict...
arwavis/MyPyMinds
My Learning-Basics/my_program/dictionary.py
dictionary.py
py
404
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" } ]
4863584837
from keras.datasets import mnist from keras.layers import MaxPooling2D #download mnist data and split into train and test sets (X_train, y_train), (X_test, y_test) = mnist.load_data() import matplotlib.pyplot as plt #plot the first image in the dataset plt.imshow(X_train[0],cmap='gray') X_train[0].shape X_train = X_...
taburiss3525/ALM-pro3
doc/CNN1.py
CNN1.py
py
2,149
python
en
code
0
github-code
18
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 4, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 8, "usage_type": "call" }, { "api_nam...
3273092911
import tensorflow as tf import numpy as np from bench.core.executer import Executer def masks_to_boxes(masks): """Compute the bounding boxes around the provided masks The masks should be in format [N, H, W] where N is the number of masks, (H, W) are the spatial dimensions. Returns a [N, 4] tensors, with...
DeepLink-org/DLOP-Bench
bench/samples/long_tail/masks_to_boxes/xla_impl.py
xla_impl.py
py
1,311
python
en
code
38
github-code
18
[ { "api_name": "tensorflow.range", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tensorflow.range", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow....
22694524382
import torch import torchvision import torchvision.models.detection as models from torchvision.models.detection.roi_heads import RoIHeads from torchvision.models.detection import FasterRCNN from torchvision.models.detection.backbone_utils import resnet_fpn_backbone from collections import OrderedDict def build_model...
DongBumKim/Car_Dacon
model.py
model.py
py
2,809
python
en
code
0
github-code
18
[ { "api_name": "torchvision.models.detection.fasterrcnn_resnet50_fpn", "line_number": 12, "usage_type": "call" }, { "api_name": "torchvision.models.detection", "line_number": 12, "usage_type": "name" }, { "api_name": "torchvision.models.detection.faster_rcnn.FastRCNNPredictor", ...
3849667342
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: Dango Wang # time : 2019/6/17 import os import random from maya import cmds from DCC_TOOLS.common.dcc_utils import * from utils.common_methods import * import maya.mel as mel import pymel.core as pm import mel_context reload(mel_context) import logging try: ...
DangoWang/OCTToolkits
DCC_TOOLS/RIG/DsfMyWave/main.py
main.py
py
11,575
python
en
code
1
github-code
18
[ { "api_name": "os.path.split", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 25, "usage_type": "call" }, { "api_name": "maya.cmds.ls", "line_...
7998508316
from KunbaiLib import * import inspect import logging logging.basicConfig(level=logging.DEBUG) class fp(FileNameParser): def Log(self, message, *args): #logging.debug(message, *args) print(message) #print() #parser = FileNameParser("/volume1/personal/videos/GWest/#Asian in West Collection/...
kunbai/p-meta-agent
Contents/Code/test.py
test.py
py
1,090
python
en
code
0
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 4, "usage_type": "attribute" } ]
11763109343
#!/usr/bin/env python # -*- coding: utf8 -*- """ Check whether the xls+hts files in the current directory follow the specifications at http://hydroscope.gr/, Documents, Data entry standardization. We check whether the current directory contains a single .xls or .odt file and whether the accompanying .hts files are tho...
openmeteo/enhydris-importer
enhydris_importer/management/commands/_hcheck.py
_hcheck.py
py
7,489
python
en
code
0
github-code
18
[ { "api_name": "xlrd.XL_CELL_NUMBER", "line_number": 53, "usage_type": "attribute" }, { "api_name": "logging.error", "line_number": 55, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 84, "usage_type": "call" }, { "api_name": "xlrd.open_workbook"...
34000825623
from cx_Freeze import setup, Executable exe=Executable( script='ftp_exact_target.py', base="Win32Gui", icon="image/swiss-marketing-knife.ico", targetName="Swiss Marketing Tool.exe", #shortcutName="Remove From Mailing List", #shortcutDir="ProgramMenuFolder", ) shortcut_table = [ ...
dhoy/swiss-marketing-knife
setup.py
setup.py
py
2,232
python
en
code
0
github-code
18
[ { "api_name": "cx_Freeze.Executable", "line_number": 3, "usage_type": "call" }, { "api_name": "cx_Freeze.setup", "line_number": 53, "usage_type": "call" } ]
15878395254
from django.core.management.base import BaseCommand, CommandError import csv import io from invoicing.UserMigration import migrate from django.utils.safestring import mark_safe from django.template.loader import render_to_string import os from django.conf import settings class Command(BaseCommand): help = 'Closes t...
Charlez91/invoiceapp
src/invoicing/management/commands/migrate_user.py
migrate_user.py
py
1,831
python
en
code
0
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "io.open", "line_number": 13, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 14, "usage_type": "call" }, { "api_name": "invoicing.U...
39728384311
""" RTMA API MODULE - This module contains any API based methods that users interact with. When the library is installed, this is the module users should interact with. For detailed information on the methods and configuring the library, please see our Readme on our Github. https://github.com/RTM...
RTMAAI/CO600-Musical-Analysis
rtmaii/rtmaii.py
rtmaii.py
py
12,595
python
en
code
2
github-code
18
[ { "api_name": "logging.Formatter", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.Stream...