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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42377878463 | from django.contrib.auth.models import User
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
email_confirmed = models.BooleanField(default=False)
class Project(models.Model):
owner = models.ForeignKey(User, on_delete=models.PROTECT)
... | sudomakeinstall2/ocular-backend | core/models.py | models.py | py | 2,670 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.OneToOneField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name... |
40690347314 | import csv
import sys
sys.path.append("/home/alesya/Downloads/KLayout-python-shamil_dev_sfs")
import pya
from pya import Point, DPoint, Vector, DVector, DSimplePolygon, SimplePolygon, DPolygon, Polygon, Region
from ClassLib import *
from sonnetSim.matlabClient import MatlabClient
from sonnetSim.pORT_TYPES import PORT... | AlesyaSokol/KLayout-python | Projects/Transmon lasing/Capacitor_kappa_ge.py | Capacitor_kappa_ge.py | py | 2,540 | python | en | code | null | 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": "pya.Application.instance",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pya.Application"... |
25834722692 | import streamlit as st #all streamlit commands will be available through the "st" alias
import text_lib as glib #reference to local lib script
#
st.set_page_config(page_title="Text to Text") #HTML title
st.title("Text to Text") #page title
#
input_text = st.text_area("Input text", label_visibility="collapsed") #displ... | izardy/aws_bedrock_code | workshop/completed/text/text_app.py | text_app.py | py | 799 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.text_area",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.... |
1796888067 | import logging
import pandas as pd
import pymysql
import os
import django
# 获取当前路径下的setting文件
# 设置环境变量
# celery是一个问题!!!
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mblog.settings')
# django.setup()
# os.path.dirname()返回上一级目录
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# 日志
logger = l... | syz247179876/Django-Mblog | mblog_this/mblog/connect_mysql.py | connect_mysql.py | py | 1,899 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
... |
22759447534 | import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import root,minimize
from scipy.misc import derivative
a = 0.1
k = 2*np.pi
x0_ = np.linspace(0,2,200)
def x0(x):
f = lambda x0_, x_: x0_ - a*np.sin(k*x0_) - x_
x0 = root(f, x0 = x, args=(x,) ).x
return x0
def z(x_):... | KirillPonur/water | solve.py | solve.py | py | 1,872 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.root",
"line_... |
20303654900 | import django.contrib.auth.views
from django.conf import settings
from django.urls import include, path
urlpatterns = [
path("", include('evap.evaluation.urls')),
path("staff/", include('evap.staff.urls')),
path("results/", include('evap.results.urls')),
path("student/", include('evap.student.urls')),
... | e-valuation/EvaP | evap/urls.py | urls.py | py | 1,119 | python | en | code | 93 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.include",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.includ... |
10124296956 | from simpletransformers.language_generation import LanguageGenerationModel
import os
def download_model():
import dropbox
dbx = dropbox.Dropbox("gzhGYnEbdx0AAAAAAAAAAW5Ab2pW_0ShlpGFbDOnBkzRTlSLJCBn889-RDubhfLt")
with open("from_scratch/best_model/pytorch_model.bin", "wb") as f:
print("getting fil... | CiTRuS93/McNLP | model.py | model.py | py | 1,459 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dropbox.Dropbox",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "simpletransformers.languag... |
36073338813 | import statsmodels.api as sm
import pandas as pd
from Data_prep import getDfRange
import warnings
def MarginalRegression(CT,Omics,filePath,by = "FC"):
# CT: pd.DataFrame, index = samples, columns = cells
# Omics: pd.DataFrame, index = genes, columns = cells
# filePath: str, path to save the output
# by... | yuemolin/MOFUN-CCC | MOFUN_CCC/Feature_selection.py | Feature_selection.py | py | 2,620 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "Data_prep.getDfRange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "statsmodels.api.a... |
3686623757 | """
ICAL pipeline
"""
results_dir = "./results/"
from rascil.data_models import PolarisationFrame, export_gaintable_to_hdf5
from rascil.processing_components import (
export_image_to_fits,
qa_image,
qa_gaintable,
create_image_from_visibility,
create_blockvisibility_from_ms,
image_gather_chan... | NLESC-quantum/rascil | examples/pipelines/ska-pipelines/ska_ical_skymodel_rsexecute_pipeline.py | ska_ical_skymodel_rsexecute_pipeline.py | py | 4,077 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "logging.info"... |
11116578773 | import pygame
class Edge(pygame.sprite.Sprite):
def __init__(self, game, x, y):
self.game = game
# will need layers and groups later for collisions
pygame.sprite.Sprite.__init__(self, self.groups)
self.x = x * 16
self.y = y * 16
self.width = 16
self.height... | JJAA-projects/astro-explorer | Archived/sandbox/entities.py | entities.py | py | 485 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.sprite",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pyga... |
4030693656 | from turtle import Turtle, Screen, done, onclick, write, bgcolor, width
from genetic_project.model import Model
from genetic_project.constants import *
from typing import Any
from time import time_ns
best_fitness = -1
class ViewController:
screen: Any
pen: Turtle
model: Model
def __init_... | Depresivna-ryza/robots-genetic-algorithm | genetic_project/ViewController.py | ViewController.py | py | 6,334 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.Any",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "turtle.Turtle",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "genetic_project.model.Model",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "genetic_project.... |
11354770108 | import sqlalchemy as sa
from ziggurat_foundations.models.services.resource import ResourceService
from appenlight.models import Base, get_db_session
from sqlalchemy.orm import validates
from ziggurat_foundations.models.base import BaseModel
class AlertChannelAction(Base, BaseModel):
"""
Stores notifications ... | AppEnlight/appenlight | backend/src/appenlight/models/alert_channel_action.py | alert_channel_action.py | py | 2,383 | python | en | code | 35 | github-code | 18 | [
{
"api_name": "appenlight.models.Base",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "ziggurat_foundations.models.base.BaseModel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 19,
"usage_type": "call"
},
{
... |
5416893697 | # https://colab.research.google.com/drive/1H9epx3rtmUVdhe0Qb_L5O2rQt8q7CpLZ
# Load All Libraries
from __future__ import print_function
from collections import Counter
import sklearn
import sklearn.datasets
import sklearn.ensemble
import numpy as np
import lime
import lime.lime_tabular
import pandas as pd
i... | francisnardi/hackaton-algar-2018 | logisticRegression.py | logisticRegression.py | py | 6,945 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.concat... |
14274848424 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import functools
import logging
from panodr_module import *
logger = logging.getLogger(__name__)
class GatedGenerator(nn.Module):
def __init__(self):
super(GatedGenerator, self).__init__()
self.latent_channels = 6... | VCL3D/PanoDR | service/panodr_net.py | panodr_net.py | py | 5,628 | python | en | code | 33 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"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",
... |
1810028642 | import requests
from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
class ActionAskCovidRegion(Action):
def name(self) -> Text:
return "action_info_covid_regioni"
def run(self, dispatcher: CollectingDispatcher, tracker: Tra... | debaalex/Rasa-Riva-Flask-Integration | covid chatbot rasa/actions/actions.py | actions.py | py | 4,552 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rasa_sdk.Action",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Text",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rasa_sdk.executor.CollectingDispatcher",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rasa... |
41301399642 | import argparse
import os.path
import pandas
import plotly.express as px
from tkinter import *
from PIL import ImageTk,Image
VERSION = "0.1"
# Start
# Main Function
def gui():
main_window = Tk()
# size of the window
main_window.geometry('670x480')
main_window.title("Threat Calculator")
... | plushed/threatcalc | threatcalc.py | threatcalc.py | py | 4,987 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.execl",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line... |
73518848359 | from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def swapHelper(self, head: Optional[ListNode],root: Optional[ListNode], prev:Optional[ListNode]):
if head == None:
return root
elif hea... | MatjazM2020/codingWorkouts | swapNodesInPairs.py | swapNodesInPairs.py | py | 1,293 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "typing.Optional",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 23,
"usage_type": "name"
}
] |
23378354565 |
import bluetooth
import struct
def connect_bluetooth(mac: str):
try:
print(f"Connecting to MAC address {mac}")
sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((mac, 1))
print(f"Connected to {mac}")
return sock
except bluetooth.btcommon.BluetoothError as e:
print(e)
return None
class... | Robosoc-Southampton/SumoBot-2020 | python/bt.py | bt.py | py | 588 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "bluetooth.BluetoothSocket",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bluetooth.RFCOMM",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "bluetooth.btcommon",
"line_number": 14,
"usage_type": "attribute"
}
] |
18969866899 | import pygame
import math
import sys
class GUI:
def __init__(self, service, multiplayer):
self._service = service
self.__multiplayer = multiplayer
self.board = self._service.repo.table
self.__columns = self._service.repo.number_columns
self.__rows = self._service.repo.numbe... | x64alex/Connect-Four | ui/gui.py | gui.py | py | 6,253 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "math.floor",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pygame.draw.re... |
33754569505 | from django import forms #import modułu wbudowanych formularzy
from .models import Topic, Entry #import modelu Topic
class TopicForm(forms.ModelForm): #Utworzenie klasy TopicForm z przekazanym modelem formularza
class Meta:
model = Topic #Budowanie formularza o model Topic
fields = ['text'] #Możl... | TKdev96/django_learning_log | learning_logs/forms.py | forms.py | py | 723 | python | pl | code | 0 | github-code | 18 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Topic",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.Model... |
20792118549 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# Train the model
# After training we will have a dataset
# dataset is sent to CNN classifier we have used (VGG16) here.
# Examples of other CNN classifier: Resnet, InceptionNet, MObile Net V2
# Mobile Net V2 is very light, It uses Rpi, 25 Mb, accuray is 70% wrt 72% of ... | ksharpit/Mask-Detection | main.py | main.py | py | 6,477 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
16969548022 | import boto3
import time
import os
import csv
from datetime import datetime
import json
def main():
event_bridge = boto3.client("events")
data_s3_bucket_name = os.environ.get["S3_BUCKET_NAME"]
data_s3_object_key = os.environ.get["S3_OBJECT_KEY"]
if None == data_s3_bucket_name or None == data_s3_obje... | NaumanMunir9/cdk-patterns-eventbridge-etl | container/s3DataExtractionTasks/main.py | main.py | py | 1,622 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "boto3.client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "boto3.resource",
"li... |
23984621385 | import numpy as np
import csv
import keras
import tensorflow as tf
from keras.utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import Adadelta, SGD
from keras.callbacks import TensorBoard
config = tf.ConfigProto()
config.gpu_opti... | iamgroot42/SML_assignments | Assignment 4/part2.py | part2.py | py | 3,127 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tensorflow.ConfigProto",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.backend.set_session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "k... |
10053625276 | from Call import Call
from Simulator import Simulator
from Calls import Calls
from Elevator import Elevator
from Building import Building
import sys
import json
import csv
import numpy as np
#
def init_elev_list():
elev_l = []
# initialize elevator list
for current in elev_dict:
e = Elevator(int(c... | Tomi-1997/CS-2ndYear | OOP/1/src/Ex1_main.py | Ex1_main.py | py | 2,164 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Elevator.Elevator",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "Building.Building",
"li... |
10522860712 | import cvxpy as cp
import numpy as np
import sympy
from sympy import var
from sympy.matrices import Matrix, eye, zeros, ones, diag, GramSchmidt
var('e1 e2 g p1 p2 p3')
M = Matrix([[0, 0, -1], [1, 0, 0], [0, 1, 0]])
P = Matrix([[0, 1 / 2], [1 / 2, 0]])
S = Matrix([[0, 1 / 2], [1 / 2, -e1]])
SP2 = Matrix([[0, 1 / 2],... | LeoMassai/RENOpt | Dissipativity.py | Dissipativity.py | py | 1,234 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sympy.var",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sympy.matrices.Matrix",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sympy.matrices.Matrix",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sympy.matrices.M... |
22702847241 | # -*- coding: utf-8 -*-
from setuptools.command import build_ext
from distutils.unixccompiler import UnixCCompiler
__author__ = 'Jon Nappi'
__all__ = ['GolangBuildExt', 'GolangCompiler']
class GolangBuildExt(build_ext.build_ext):
"""Custom extension builder that sets builds extensions using the
:class:`Golan... | moogar0880/golang_ext | golang_ext/extensions.py | extensions.py | py | 2,704 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "setuptools.command.build_ext.build_ext",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "setuptools.command.build_ext",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "distutils.unixccompiler.UnixCCompiler",
"line_number": 19,
"usage_... |
26526262505 | import functools
from absl.testing import absltest
import chex
import haiku as hk
import jax
import jax.numpy as jnp
from jax_privacy.src.dp_sgd import grad_clipping
from jax_privacy.src.dp_sgd import typing
import optax
NUM_SAMPLES = 4
NUM_CLASSES = 7
INPUT_SHAPE = (12, 12, 3)
MAX_NORM = 1e-4
def model_fn(inputs, ... | deepmind/jax_privacy | jax_privacy/src/dp_sgd/grad_clipping_test.py | grad_clipping_test.py | py | 9,314 | python | en | code | 72 | github-code | 18 | [
{
"api_name": "haiku.Conv2D",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "jax.nn.relu",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "jax.nn",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "haiku.Conv2D",
"line_number"... |
38267805939 | """© 2022 The Trustees of Columbia University in the City of New York.
This work may be reproduced, distributed, and otherwise exploited for
academic non-commercial purposes only, provided that it cites the original work:
Stefan J. Hofmeister, Michael Hahn, and Daniel Wolf Savin, "Deriving instrumental point sp... | stefanhofmeister/Deriving-PSFs-from-partially-occulted-images | find_occulted_pixels.py | find_occulted_pixels.py | py | 5,556 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "glob.glob",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.int8",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "inout.read_image",
"line_numb... |
16682043417 | ### 052830 -- doing PCA on temporal neural patterns
### can I think be analogized to a PSTH (as the first component)
### both to examine the PCs, and to see how many are needed
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from analysi... | preacherwhite/Hal-sharedcore-Tang-data | analysis/scripts/temporal_pca.py | temporal_pca.py | py | 3,376 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "analysis.data_utils.get_neural_data",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "analysis.data_utils.trial_average",
"line_number": 27,
"usage_type": "call"
},
{
... |
204486003 | import copy
import pygame
from sim_utils.config import LANE_LIGHT_LOCATION, LANE_LENGTH, FACTOR_SPEED, SAFETY_DISTANCE, EMERGENCY_RED_MAX_SPEED, \
METHOD
from sim_utils.utils import load_image, get_screen_center, get_lane_points, stopping_position, get_rotation, \
acceleration_time
class Vehicle(pygame.spri... | Noodleguitar/TrafficControlSim | traffic_sim/carlogic.py | carlogic.py | py | 10,153 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.sprite",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "p... |
29186225888 | """Heroku dataclip event source"""
import csv
from datetime import datetime
import itertools
import json
import time
import requests
import dateutil.parser
from eventplayback import EventSource
class DataClipSource(EventSource):
"""A source of events, replayed from a Heroku dataclip.
See dataclip.json.exam... | xxv/mqtt-log-replay | dataclip_source.py | dataclip_source.py | py | 3,775 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "eventplayback.EventSource",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "dateutil.parser.parser",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "dateutil.parser",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": ... |
71937203241 | import os
# import multiprocessing
import librosa
import soundfile as sf
# import soxbindings as sox
def preprocess(data, input_dir, dest_dir, target_sr=None, speed=None,
overwrite=True):
speed = speed or []
speed.append(1)
speed = list(set(speed)) # Make uniqe
input_fname = os.path... | seccask/encfspython-bin | exp/mlperf-tr-sphrcg/utils/preprocessing_utils.py | preprocessing_utils.py | py | 3,458 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "soundfile.SoundFile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "librosa.load",
"lin... |
10346305176 | import sys
import os
sys.path.append("..")
import json
def split_json(file_path, chunk_size):
with open(file_path, "r", encoding="utf-8") as file:
data = json.load(file) # Assuming it's a JSON array
for i in range(0, len(data), chunk_size):
with open(f"chunk_{i}.json", "w", encoding... | ewang-pu/CompVLMs | vision-language-models-are-bows/tool_scripts/parse_captions.py | parse_captions.py | py | 3,798 | 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": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": ... |
33384527891 | import os
from random import randint
from flask import Flask, redirect, render_template, flash, request
# from app import clear_app_cache, invalidate_key_in_app_cache, put_key_in_app_cache, refresh_app_cache_config
from app import *
from lib import calc_statistics, delete_images_data, get_cache_config, get_capacity, ge... | IbrahimTEslim/Image_Key_Matcher | manager.py | manager.py | py | 5,021 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lib.get_cache_config",
"line... |
8273315855 | #! /usr/bin/env python 3
import numpy as np
import pandas as pd # data analysis package
import matplotlib.pyplot as plt
# filepath of csv data
FILEPATH = '/Users/gerald/Documents/TA-ing/MCHE 474/Me'
FILE_NAME = 'MCHE474-001-202240 Grades.csv'
df = pd.read_csv(f'{FILEPATH}/{FILE_NAME}', index_col='Last name')
hist_a... | gge0866/MCHE474---Control-Systems | Assignment_histogram.py | Assignment_histogram.py | py | 1,797 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
... |
71359418920 | import os
import shutil
import tarfile
import zipfile
import requests
from tqdm import tqdm
from sally.logger import LogLevel, log
import inquirer
def cleanup_path(dir_path):
log('clean-up `%s`' % dir_path, LogLevel.INFO)
if os.path.isdir(dir_path):
shutil.rmtree(dir_path)
os.makedirs(dir_path, ... | KennethanCeyer/sally | sally/file.py | file.py | py | 1,880 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sally.logger.log",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sally.logger.LogLevel.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sally.logger.LogLevel",
"line_number": 14,
"usage_type": "name"
},
{
"api_name":... |
19363327909 | import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from DragDrop import ListBox,ListItem,ListBox2
from GetAPI import GetAPIInfo
import json
from sys import stderr, stdout
from MainApp import startMain,disconnect
import traceback
from HelperUi import DialogBox
from Activate imp... | Saransh0905/Tele-autoManager | MainWindow.py | MainWindow.py | py | 18,488 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "GetAPI.GetAPIInfo",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "traceback.format_e... |
1279719355 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
get_ipython().system('pip install lxml')
# In[2]:
get_ipython().system('pip install requests')
# In[4]:
import pandas as pd
# In[5]:
import requests #make http calls
# In[6]:
from lxml import html #Parsing the html
# In[8]:
amazon_url_to_crawl = "htt... | niharika0608/mywork | scraping_amazon_reviews with Python.py | scraping_amazon_reviews with Python.py | py | 3,346 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 74,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"l... |
73193193961 | from typing import Optional
from pyrogram.enums import MessageEntityType
from pyrogram.raw.functions.account import UpdateEmojiStatus
from pyrogram.raw.types import EmojiStatus
from pagermaid.listener import listener
from pagermaid.enums import Client, Message
async def get_custom_emojis(message: Message) -> Option... | TeamPGM/PagerMaid_Plugins_Pyro | set_status/main.py | main.py | py | 1,648 | python | en | code | 192 | github-code | 18 | [
{
"api_name": "pagermaid.enums.Message",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pyrogram.enums.MessageEntityType.CUSTOM_EMOJI",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pyrogram.enums.MessageEntityType",
"line_number": 16,
"usage_t... |
43714738427 | import torch
import torch.nn as nn
class Network(nn.Module):
def __init__(self, in_dim: int, out_dim: int):
"""Initialization."""
super(Network, self).__init__()
self.layers = nn.Sequential(
nn.Linear(in_dim, 128),
nn.ReLU(),
nn.Linear(128, 128),
... | vincehass/Deep-Reinforcement-Learning-Optimal-Control | utilities/DQN_utilities/DQN_Network.py | DQN_Network.py | py | 518 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
72518631400 | import psycopg2
class postgresql:
def __init__(self):
self.database = psycopg2.connect(host='localhost',
dbname='solvedac',
user='postgres',
password='asdf1234',
... | 70825/solvedac-pipeline | database/postgresql.py | postgresql.py | py | 1,101 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "psycopg2.connect",
"line_number": 6,
"usage_type": "call"
}
] |
21849199950 | import random as rd
import datetime as dt
import math
import sys
def get_seconds(time):
time_digits = list(str(time))
return int(time_digits[0])*60*60+int(time_digits[2])*10*60+int(time_digits[3])*60+int(time_digits[5])*10+int(time_digits[6])+int(time_digits[8])*0.1+int(time_digits[9])*0.01
def calculate(a, b... | SimonHiesl/Bash-Programs | python_files/arith.py | arith.py | py | 3,801 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "random.ra... |
40597362082 | '''
Created on 2014-6-19
@author: xiajie
'''
import numpy as np
import matplotlib.pyplot as plt
def simulate(n=100):
X = np.random.random(n)
X = np.sort(X)
Y = np.zeros(n)
for i in range(n):
e = np.random.normal(0., 0.33)
Y[i] = np.sin(4*X[i])+e
return X, Y
def draw(X, Y):
plt... | jayshonzs/ESL | KernelSmoothing/SimulateData.py | SimulateData.py | py | 447 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "numpy.random.random",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.sort",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"l... |
24092735270 | from ducttapp.models import db
from .base import TimestampMixin
from sqlalchemy.orm import relationship
from sqlalchemy import func
import enum
from datetime import datetime
category_book_table = db.Table(
'category_book',
db.Model.metadata,
db.Column('category_id', db.Integer, db.ForeignKey('category.id'... | anhducc13/flask-app | ducttapp/models/category.py | category.py | py | 3,026 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "ducttapp.models.db.Table",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ducttapp.models.db",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "ducttapp.models.db.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name"... |
33338719878 | from typing import List, Union
from dataclasses import dataclass
import copy
@dataclass
class TeamScore:
name: str
points: int
place: int
def take_input():
teams_num = int(input())
data: List[TeamScore] = []
for place in range(1, teams_num + 1):
name, points = input().split()
... | daniskazan/kontur-contest | premier_league.py | premier_league.py | py | 2,029 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line... |
40706791280 | import math
import multiprocessing as mp
import os.path
import numpy as np
import queue
import time
import glob
import torch
"""NOTE in the documentation transforms and augmented are used interchangeably"""
"""
DSAL (Dataset and loader)
This clas will transform and batch images/masks/labels for machine learning t... | NguyenNhuDi/ICCV-2023-VRL | src/data_loading/DSAL.py | DSAL.py | py | 14,328 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 200,
"usage_type": "call"
},
{
"api_name": "multiprocessing.JoinableQueue",
"line_number": 213,
"usage_type": "call"
},
{
"api_name": "multiprocessing.JoinableQueue",
"line_number": 214,
"usage_type": "call"
},
{
"api_na... |
25499341652 | from tweepy import OAuthHandler
import tweepy as tw
import pandas as pd
from constants.values import *
def twitter_data():
# Collect tweets
tweets = tw.Cursor(API.search,
q=SEARCH_WORDS,
lang="en",
since=DATE_SINCE).items(10)
tweets_copy... | Amit-DataScience/Twitter_Data_Covid19_Sentiment_Analysis | Get_Data/Extract_Twitter_Dat.py | Extract_Twitter_Dat.py | py | 2,103 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tweepy.Cursor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 26,
"usage_type": "call"
}
] |
10242024633 | import pandas
from Gameplay import *
from Team import *
from DirectoryWide import *
import numpy
from alive_progress import alive_bar, alive_it
#"""
schedLength = input('How many games per season would you like? (20, 52, 162, Alt)') # 1 and '' is 52, 2 is 162
if schedLength == '':
schedLength = '52'
if schedLength... | AWHerzig/Baseball3 | League.py | League.py | py | 47,709 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.DataFrame",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line... |
28744899187 | import os
from dotenv import load_dotenv
from flask import (
Flask,
redirect,
render_template,
url_for,
request,
flash
)
from page_analyzer import db, html
app = Flask(__name__)
load_dotenv()
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY')
app.config['DATABASE_URL'] = os.getenv('DATABASE_U... | serVmik/python-project-83 | page_analyzer/app.py | app.py | py | 2,372 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number... |
26484632070 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
# for single feature: Linear regression:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
fileData = pd.read_csv('ex1data1.txt', names = ['population', 'profit'])
print(fileData.head())
## Split population and pro... | ritika137/LITG-Python | linear-regression-one-variable.py | linear-regression-one-variable.py | py | 3,082 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.f... |
74749113961 | from django.shortcuts import render, redirect, HttpResponse
from .models import Investimento
from .forms import InvestimentoForm
from django.contrib.auth.decorators import login_required
# Create your views here.
# def pagina_inicial(request):
# return HttpResponse('Pronto para investir!')
def pagina_contato(req... | Juan-Costa-Lemos/django_app_invista_me | invista_me/views.py | views.py | py | 2,216 | python | pt | code | 1 | github-code | 18 | [
{
"api_name": "django.shortcuts.HttpResponse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "models.Investimento.objects.all",
"line_number": 25,
"usage_type": "call"
},
{
... |
4445766039 | import pytest
def solution(nums):
max_num = len(set(nums))
if len(nums) // 2 < max_num:
max_num = len(nums) // 2
return max_num
# return min(len(set(nums)), len(nums)//2)
@pytest.mark.parametrize("nums, expected", [
([3,1,2,3], 2),
([3,3,3,2,2,4], 3),
([3,3,3,2,2,2], 2)
])
def te... | prography-6th-study/algorithm-code | jisoo/2-포켓몬.py | 2-포켓몬.py | py | 516 | python | ko | code | 4 | github-code | 18 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 12,
"usage_type": "attribute"
}
] |
25313056290 | from datetime import datetime
from json import dump
from os import mkdir
from os.path import abspath, dirname, exists, join
from typing import Sequence
class Transport():
pass
transport_dir = abspath(join(dirname(__file__), 'cache'))
send_dir = join(transport_dir, 'send')
receive_dir = join(transport_dir, 'rece... | vikasmunshi/python-scripts | src/crypt/transport.py | transport.py | py | 1,095 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
37899138581 | # Built-in libraries
from os import listdir
from os.path import join
import multiprocessing as mp
import random
# 3rd-party libraries
import cv2
class Dataset(object):
num_processes = 5
def __init__(self, data_folder, train_portion=0.99, mean=[0., 0., 0.], shuffle=True):
self.data_folder = data_f... | anhpngt/DogvsCat | datahandler.py | datahandler.py | py | 2,723 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Manager",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pro... |
597855536 | import gym
from gym import spaces
from gym.utils import seeding
import random
import sys
import numpy as np
# Gridworld. ' ' is an empty cell, '-' or '|' is a wall, and 'G' the goal.
# 11 lines (y) and 9 rows (x), agent begins at the top left corner (GRID[0][0])
'''GRID = [
[' ', ' ', ' ', ' ', ' ', ' ', ' ', '... | helia94/TUSP_BDPI | gym_envs/myGrid.py | myGrid.py | py | 5,610 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "gym.Env",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "gym.spaces.Discrete",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "gym.spaces.Box",
"lin... |
17845874703 | import configparser
from AuthenticationService import MongoReads, logging
""" This class is a common interface which gives flexibility to change or add other databases in future."""
class DataBaseInterface:
def __init__(self):
config = configparser.ConfigParser()
config.read('AuthenticationConf... | sreddy-bwi/Smart-Share-Backend | AuthenticationService/DataBaseInterface.py | DataBaseInterface.py | py | 1,147 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "AuthenticationService.logging.info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "AuthenticationService.logging",
"line_number": 17,
"usage_type": "name"
},... |
38416724169 | import pandas as pd
import torch
def read_file(path='./data/simplifyweibo_4_moods.csv'):
# 读取csv文件
df = pd.read_csv(path)
# sen_len = 0
# for line in df['review']:
# sen_len += len(line)
# print(sen_len / len(df)) # 69.48
return df['review'].to_list(), df['label'].to_li... | Bat-Reality/PyTorch_exp | 文本分类/BERT/utils.py | utils.py | py | 1,844 | python | zh | code | 13 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.eq",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 52,
"usage_type": "call"
}
] |
38400205053 | import json
import time
import pigpio
import os
from datetime import datetime
from time import localtime, strftime, mktime
from threading import Timer
from event import Event
from gra_afch import GraAfch
from ncs31x import Ncs31x
class RepeatTimer(Timer):
def __init__(self, interval, f, *args, **kwargs):
... | Software-Knife-and-Tool/retro | modules/display/__init__.py | __init__.py | py | 5,287 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "threading.Timer",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "threading.Timer",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_num... |
23242350778 | import torch
import torch.distributed as dist
from typing import List
class TorchNCCLCommunicator:
def __init__(self,
process_group):
self.process_group = process_group
@staticmethod
def barrier():
dist.barrier()
def send(self,
tensor: torch.Tensor,
... | FMInference/DejaVu | Decentralized_FM_alpha/comm/torch_nccl_backend.py | torch_nccl_backend.py | py | 3,040 | python | en | code | 86 | github-code | 18 | [
{
"api_name": "torch.distributed.barrier",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.distributed",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.d... |
5023309040 | import sys
import cv2
import numpy as np
from PyQt5.QtWidgets import QMainWindow, QFileDialog
from PyQt5.QtGui import QImage, QPixmap
from PyQt5.QtCore import QThread
from PyQt5 import QtCore
from mainWindow import Ui_Form
from models import ImageProcess, Mora
class StartWindow(QMainWindow, Ui_Form):
def __init_... | zxjte9411/dip_final_project | view.py | view.py | py | 5,237 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "mainWindow.Ui_Form",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.ImageProcess",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Py... |
34451553882 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="staroid", # Replace with your own username
version="0.1.0",
license='MIT',
author="Staroid",
author_email="support@staroid.com",
description="Python client library for Staroid cloud pl... | staroids/staroid-python | setup.py | setup.py | py | 1,511 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 16,
"usage_type": "call"
}
] |
25963315541 | import logging
from collections import defaultdict
from mii_sorter.models import Episode
logger = logging.getLogger(__name__)
def analyse_series():
series = defaultdict(lambda: defaultdict(list))
for episode in Episode.objects.values('number', 'season__number', 'season__serie__name'):
... | MiiRaGe/miilibrary | analysis/season_tool.py | season_tool.py | py | 1,135 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mii_sorter.models.Episode.objects.values",
"line_number": 13,
"usage_type": "call"
},
{
... |
28898880172 | import streamlit as st
import numpy as np
import pandas as pd
import streamlit as st
import plotly.express as px
import plotly.express as px
import plotly.graph_objects as go
import plotly.figure_factory as ff
import streamlit.components.v1 as components
df= st.empty()
brand_list = []
def data(data):
global ... | hemantharijan/StreamlitApp-MSc-Project- | pages/Models.py | Models.py | py | 4,395 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "streamlit.empty",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "plotly.express.bar",... |
13142027724 | from PIL import Image, ImageDraw
from random import randint
# TODO:
# - figure out how to deal w/more ambiguous inputs (i.e., just saying "middle")
# - add extra functionality to ensure that shapes don't overlap...
# - maybe an array of shape screen that has 1 if pixel is occupied, 0 otherwise
# Get coordinates,... | emiliolr/OxfordHack2022 | backend/generate_layout.py | generate_layout.py | py | 5,071 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "random.randint",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "random.randint",
"li... |
40257902813 | import numpy as np
from discretization.mesh import Mesh
import sympy as sym
import math
x = sym.Symbol('x')
y = sym.Symbol('y')
def compute_flux_error(fx,fy,u_fabric,mesh: Mesh):
u_x = sym.diff(u_fabric,x)
u_x = sym.lambdify([x,y],u_x)
u_y = sym.diff(u_fabric,y)
u_y = sym.lambdify([x,y],u_y)
norm... | trulsmoholt/masterthesis | utils/flux_error.py | flux_error.py | py | 2,734 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "sympy.Symbol",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sympy.Symbol",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "discretization.mesh.Mesh",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sympy.diff",
"lin... |
9899168067 | from typing import List
import requests
from requests import Response
from decouple import config
DJANGO_HOST = config('ENV_DJANGO_HOST', default='0.0.0.0')
DJANGO_PORT = config('ENV_DJANGO_PORT', default='8000')
PROTOCOL = config('ENV_API_PROTOCOL', default='http')
class ApiRequests:
api_req = '/api/v1/weath... | AvEgA-ChuDoTvoreC/weatherme | telegram_bots/bot_weather/api_req/api_requests.py | api_requests.py | py | 1,416 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "decouple.config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line... |
33516717012 | from aiogram import Bot, types #Сможем писать анотации типов
from aiogram.dispatcher import Dispatcher #Улавливает события отправки
import aiomysql
import asyncio
import configparser
from aiogram.contrib.fsm_storage.memory import MemoryStorage
import os
async def select(loop, sql, pool):
async with pool.acquire(... | Jurieno/BotCyfra | create_bot.py | create_bot.py | py | 2,198 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "aiomysql.create_pool",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "asyncio.ensure_future",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "asyncio.gather",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "aiomysql.co... |
14450798633 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 2 15:46:11 2018
@author: vsomdec
"""
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
import pandas as pd
import datetime
import os
#Get the da... | nrogals/NBA_HACKATHON | intl_viewers.py | intl_viewers.py | py | 2,873 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.getcwd",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
... |
36830197214 | from collections import defaultdict
from itertools import chain
from pathlib import Path
from typing import List, Optional, Tuple
from keras.layers import Flatten, Dense, Activation, np
from keras.losses import mean_squared_error
from keras.optimizers import Adam
from loguru import logger
from keras.models import Sequ... | Tjorriemorrie/ufc | ufcrl/__main__3.py | __main__3.py | py | 7,069 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "itertools.chain",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "trueskill.BETA",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "trueskill.global_env",
"... |
73284106599 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %%
imp... | anthonyjclark/cs152fa21 | lectures/l17-exponential-moving-average.py | l17-exponential-moving-average.py | py | 1,133 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "jupyterthemes.jtplot.style",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "jupyterthemes.jtplot",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "torch.linspace",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.... |
7529385666 | from helpers import getAccessKey
import time
import uuid
import json
import random
import string
import psycopg2
from psycopg2 import DatabaseError
# Alibaba Cloud SDK exception import
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
... | akashkumar58-zz/ali-apsara-pg-broker | postgres.py | postgres.py | py | 22,839 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "aliyunsdkrds.request.v20140815.CreateDBInstanceRequest.CreateDBInstanceRequest",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "aliyunsdkrds.request.v20140815.CreateDBInstanceRequest",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4"... |
75192381801 | import numpy as np
import trajectory_planning_helpers as tph
import matplotlib.pyplot as plt
from LocalMapRacing.LocalMapping.LocalMapUtils.local_map_utils import *
from scipy import interpolate
from scipy import optimize
from scipy import spatial
class LocalMap:
def __init__(self, track):
self.track = t... | BDEvan5/LocalMapRacing | LocalMapRacing/LocalMapping/LocalMapUtils/LocalMap.py | LocalMap.py | py | 6,341 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "scipy.interpolate.splprep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.interpolate",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.l... |
8271295738 |
dic = {}
login_dic = {
"using_name": "1",
"logined": True
}
from lib import commom
from conf import setting
File_PATH = setting.FILE_PATH
login = commom.login
msg = """
1.请登录
2.请注册
3.进入文章页面
4.进入评论页面
5.进入日记页面
6.进入收藏页面
7.注销账号
8.退出整个程序
请输入序号:
"""
f = open(File_PATH, "a+", encoding="utf-8")
f.seek(0, 0)
for i in... | guomuxin/CRM | 每日练习/DAY16练习/Blogyuan/core/src.py | src.py | py | 2,204 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "conf.setting.FILE_PATH",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "conf.setting",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "lib.commom.login",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "lib.comm... |
11201262564 | from collections import defaultdict
import numpy as np
import seaborn as sns
from sklearn.metrics import roc_auc_score
from sklearn.tree import DecisionTreeRegressor
import matplotlib.pyplot as plt
sns.set(style='darkgrid')
def score(clf, x, y):
return roc_auc_score(y == 1, clf.predict_proba(x)[:, 1])
class ... | katnotkat/university_projects | ML_year_3_1/07_boosting/boosting.py | boosting.py | py | 4,833 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "seaborn.set",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.roc_auc_score",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeRegressor",
"line_number": 28,
"usage_type": "name"
},
{
"api_... |
73036510759 | import tensorflow as tf
from common.net.net import Net
class Softmax(Net):
def __init__(self, **kwargs):
self.output_size = kwargs.get('output_size', 1)
return
def inference(self, data):
feature_size = data.get_shape()[1].value
with tf.name_scope('weights'):
W = tf.Variable(tf.zeros([feat... | Dong--Jian/Vision-Tutorial | code/01-neural-network/net/softmax.py | softmax.py | py | 1,168 | python | en | code | 17 | github-code | 18 | [
{
"api_name": "common.net.net.Net",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "tensorflow.name_scope",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.Variable",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflo... |
8105026758 | from collections import deque
def solution(priorities, location):
answer = 0
pp = sorted(priorities)
s = deque()
for i in range(len(priorities)):
s.append((priorities[i],i))
while True:
p, l = s.popleft()
if p == pp[-1]:
pp.pop()
... | jisuncho/Programmers-code | 42587.py | 42587.py | py | 470 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
44336109518 | """
DFS, BFS
Dijkstra for single source shortest path
SCC on Digraph
Application: 2-SAT
MST
PageRank (Markov Chains)
Connected components in undirected graph G
Run DFS and keep track of component#
"""
from collections import defaultdict
def edges_to_adjlist(edges):
adjlist = defaultdict(list)
for s,t in ... | alexchonglian/udacity | ud401-ga/1301-06DFS.py | 1301-06DFS.py | py | 2,728 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
}
] |
5808493135 | import torch
import torch.nn as nn
from torch import optim
from multiprocessing import cpu_count
import numpy as np
import argparse
import os
import time
from networks import LightSpeech
from dataset import DataLoader, collate_fn
from dataset import LightSpeechDataset
from loss import LigthSpeechLoss
import utils
impo... | entn-at/LightSpeech | train.py | train.py | py | 7,034 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.device",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.DataPar... |
21119618054 | """
Given n non-negative integers representing an elevation map where the width of each bar is 1,
compute how much water it is able to trap after raining.
Example:
Input: [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6
"""
from typing import List
def max_water(elevation: List[int]) -> int:
size = len(elevation)
... | rrwt/daily-coding-challenge | other_problems/trap_water.py | trap_water.py | py | 912 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
}
] |
71743401321 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
Example:
Input: [1,2,3,null,5,null,4]
Output: [1, 3, 4]
Explanation:
1 <---
/ \
2 3 <---
\ \
... | buxizhizhoum/leetcode | binary_tree_right_side_view.py | binary_tree_right_side_view.py | py | 1,436 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "Queue.Queue",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tools.construct_binary_tree.Construction",
"line_number": 63,
"usage_type": "call"
}
] |
20453310534 | import random
import time
from enum import Enum
import black
def add(*nums):
ret = 0
for num in nums:
ret += num
return ret
def prod(*nums):
ret = 1
for num in nums:
ret *= num
return ret
def _equal(*nums):
return int(len(set(nums)) <= 1)
class Special... | adamyedidia/werewords | bc.py | bc.py | py | 6,701 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "enum.Enum",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "random.random",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "black.format_str",
"line_number... |
13456087742 | #!/usr/bin/python3
"""index file of REST API
"""
from api.v1.views import app_views
from flask import jsonify
from models import storage
@app_views.route('/status', strict_slashes=False)
def service_status():
"""return the status of your API"""
return jsonify({'status': 'OK'})
@app_views.route('/stats', str... | haffs0/AirBnB_clone_v3 | api/v1/views/index.py | index.py | py | 681 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.jsonify",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "api.v1.views.app_views.route",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "api.v1.views.app_views",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "model... |
11830292263 | # coding: utf-8
"""
NiFi Rest API
The Rest API provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | Chaffelson/nipyapi | nipyapi/nifi/models/remote_process_group_status_dto.py | remote_process_group_status_dto.py | py | 11,999 | python | en | code | 228 | github-code | 18 | [
{
"api_name": "six.iteritems",
"line_number": 310,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
"line_number": 334,
"usage_type": "call"
}
] |
4900806365 | from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import *
import numpy as np
import random
from globals import *
from sklearn import preprocessing
def average(x: list[float]) -> float:
return sum(x) / len(x) if len(x) else 0.0
class Category(Enum):
I... | apangasa/pondweed-hydrilla-competition | utils.py | utils.py | py | 4,963 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "enum.Enum",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "sklearn.preprocess... |
71078554921 | import torch
from torch import nn
import torch.nn.functional as F
import math
import os
from knnbox.common_utils import read_config, write_config
from knnbox.combiner.utils import calculate_combined_prob, calculate_knn_prob
class RobustCombiner(nn.Module):
r""" Robust knn-mt Combiner """
def __init__(self,
... | NJUNLP/knn-box | knnbox/combiner/robust_combiner.py | robust_combiner.py | py | 7,663 | python | en | code | 95 | 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.Tensor",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"l... |
10760264064 | from __future__ import annotations
from typing import Optional
from range_typed_integers import u16
from skytemple_files.common.util import AutoString
class SsaHeader(AutoString):
"""
The header of a read SSA file.
Only contains information used during read-in of the data. Not used for saving.
"""
... | SkyTemple/skytemple-files | skytemple_files/script/ssa_sse_sss/header.py | header.py | py | 2,787 | python | en | code | 16 | github-code | 18 | [
{
"api_name": "skytemple_files.common.util.AutoString",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "range_typed_integers.u16",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"a... |
40684929483 | import json
# import difflib
from difflib import get_close_matches, SequenceMatcher
data = json.load(open("projects/wordbook/data.json"))
# input output
# if word data, status=success
# elif word date=null, status=similar_word, meta_data=[]
# wor... | sagarsangwan/sagarsangwan | projects/wordbook/dict.py | dict.py | py | 1,210 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "difflib.get_close_matches",
"line_number": 21,
"usage_type": "call"
}
] |
39524245668 | from django.http import HttpResponse
from django.shortcuts import render_to_response, get_object_or_404
from felicasite.simpleserver.models import Card
def card(request, card_id):
if request.method == 'GET':
card = get_object_or_404(Card, card_id=card_id)
return render_to_response('card.html',
... | toshi-kawanishi/felica-client-server | felicasite/simpleserver/views.py | views.py | py | 748 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "felicasite.simpleserver.models.Card",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 9,
"usage_t... |
20854569664 | from __future__ import print_function
import paddle
from PIL import Image
import paddle.fluid as fluid
import numpy as np
import sys
import os
import shutil
import math
import matplotlib.pyplot as plt
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import confusion_matrix
from sklearn.metrics ... | lliqi-echo/Comparative-analysis-and-prediction-of-nucleosome-positioning | classifier/cnn.py | cnn.py | py | 8,422 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
27590222064 | import pickle
import numpy as np
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
accuracy_ranking = pickle.load(open("/home/felix/phd/ranking_exeriments/accuracy_ranking.p", "rb"))
print(accuracy_ranking)
accuracy_ranking /= np.sum(accuracy_ranking)
#accuracy_ranking = scaler.fit_transform(accu... | BigDaMa/DFS | new_project/fastsklearnfeature/interactiveAutoML/new_bench/multiobjective/plot_rankings.py | plot_rankings.py | py | 1,806 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pickle.load",
... |
26517985375 | from absl import flags
from acme.agents.jax import impala
from acme.agents.jax.impala import builder as impala_builder
import helpers
from absl import app
from acme.jax import experiments
from acme.utils import lp_utils
import launchpad as lp
import optax
# Flags which modify the behavior of the launcher.
RUN_DISTRIB... | deepmind/acme | examples/baselines/rl_discrete/run_impala.py | run_impala.py | py | 2,334 | python | en | code | 3,100 | github-code | 18 | [
{
"api_name": "absl.flags.DEFINE_bool",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "absl.flags",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "absl.flags... |
14098018749 | from flask import Flask, send_file, request, abort
import os
from flask import Blueprint
from models.vt_request import getRequestParamters
from models.response_manager import ResponseManager
app = Flask(__name__)
response_manager = ResponseManager(app)
image_bp = Blueprint('images', __name__)
@image_bp.errorhandl... | stoull/Vault | api/api_images.py | api_images.py | py | 1,332 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.response_manager.ResponseManager",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mo... |
70303859561 | import tesserocr
from PIL import Image, ImageDraw
#二值化
def binImg(img,binMax):
img = img.convert('L')
table = []
for i in range(256):
if i < binMax:
table.append(0)
else:
table.append(1)
img = img.point(table, '1')
return img
# 二值数组
t2val = {}
#获取二值化数组
d... | huanghuizhou/pyTest | HttpTest/yzm.py | yzm.py | py | 2,683 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PIL.Image.new",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 72,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line_... |
70864124199 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import time
from datetime import datetime
import fnmatch
import tensorflow as tf
import numpy as np
import cfg
import net
import image
def train(model_dir, image_paths):
global... | tonyshadow/colorization-for-game-boy | train.py | train.py | py | 3,695 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tensorflow.train.get_or_create_global_step",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tensorflow.train",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 23,
"usage_type": "call"
},
... |
72406133480 | import sqlite3
import os
import psycopg2
from dotenv import load_dotenv
from PIL import Image
load_dotenv()
image_directory = os.getenv("IMAGE_DIRECTORY")
database_path = os.getenv("DB_LOCAL_PATH")
# List of image paths
image_paths = os.listdir(image_directory)
image_file_types = [
'.jpg',
'.png',
'.svg... | elizabethpearce/life-gives-you-pencils-backend | database/insertImagesIntoDB.py | insertImagesIntoDB.py | py | 1,215 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": ... |
29588956551 | import json
import os
import time
from multiprocessing import Process
import pickle
from config import DIC_AGENTS, DIC_ENVS
import sys
def check_all_workers_working(list_cur_p):
for i in range(len(list_cur_p)):
if not list_cur_p[i].is_alive():
return i
return -1
def downsample(path_to_l... | multi-commander/Multi-Commander | Multi_Agent/presslight/replay.py | replay.py | py | 9,194 | python | en | code | 107 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": ... |
26725981562 | #!/usr/bin/python3
import os
import sys
import subprocess
import re
import pandas as pd
from pathlib import Path
os.chdir(os.environ['HOME']) #Change directory to homespace
os.getcwd() #Make sure the current directory is your homespace
path_1 = os.environ['HOME']
os.system('rm -f -r ~/ICA2/protein_data_output') #Remo... | Caroline-personal/ICA2 | user_input.py | user_input.py | py | 11,552 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.chdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
... |
42081703912 | from datetime import datetime
from pathlib import Path
from typing import List, Tuple
import bs4 as bs
import nltk
import pandas as pd
import pytz
import requests
import traceback
import toml
from tqdm import tqdm
from get_data.financial import fetch_and_save_financials
from get_data.ohlcv import fetch_and_save_kline... | hyperwebpages/Technical-Stock-Screener | get_data/update.py | update.py | py | 5,802 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"li... |
72217778921 | """General purpose visualizer for semantic segmentation results on various datasets super-fueled by open3D.
"""
import os
import open3d
import torch
import numpy as np
from termcolor import colored
class ColorCompletionVisualizer:
"""Visualize meshes from various datasets with open3D. Key Events show RGB, ground ... | johnpeterflynn/surface-texture-inpainting-net | utils/ColorCompletionVisualizer.py | ColorCompletionVisualizer.py | py | 6,074 | python | en | code | 14 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_n... |
70435256680 | import pymongo
import json
import random
import calendar
import datetime
client = pymongo.MongoClient()
db = client.dummy_database
collection = db.sensorData
data = {}
now = calendar.timegm(datetime.datetime.now().timetuple())*1000
dates = [now + (i-5000)*100000 for i in range(10000)]
delta1 = [random.randint(-1,1)/... | freefood89/Fishtank | makeDummyDatabase.py | makeDummyDatabase.py | py | 609 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "calendar.timegm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.