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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7667261447 | import pandas as pd
import numpy as np
import pickle
from sklearn.base import TransformerMixin
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.pipeline import Pipeline
from sklearn.metrics import f1_score, cohen_kappa_score, accuracy_score, recall_score, precision_score, roc_auc_score, confusi... | Nicolas-Ferreira/ml-helper-functions | src/models/train_models.py | train_models.py | py | 6,420 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.recall_score",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.precision_score",
"line_number": 34,
"usage_type": "call"
}... |
3687742693 | import torch
def nanminmax(tensor, operation='min', dim=None, keepdim=False):
if operation not in ['min','max']:
raise ValueError("Operation must be 'min' or 'max'.")
mask = torch.isnan(tensor)
replacement = float('-inf') if operation == 'max' else float('inf')
replacement = torch.ten... | zzy99/torch_preprocessing | torch_preprocessing.py | torch_preprocessing.py | py | 2,744 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.isnan",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.where",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.min",
"line_number": 14... |
21680265073 | import torch
import numpy as np
'''
목표 MobileNet v2에 빠르게 QIL 적용
1. alexnet training <- success
2. apply QIL to alexnet (= reproduce)
- know How to quantize ex ) aware quantization - > pytorch source
- know How to apply QIL on alexnet
- conduct training
3. Apply QIL to MobileNet v2
'''
class ... | su9262/2020 | QIL.py | QIL.py | py | 2,120 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.manual_seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.round_",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torch.rand",
"line_num... |
13310547888 | import plotly.offline as py
import plotly.graph_objs as go
import sensor_input
import random
from pandas import Series
def plot_spectrum_from_files(name,files):
spectrums = []
for file in files:
spectrums.append(sensor_input.read_spectrum_from_file(file))
plot_spectrums(name,spectrums)
def plot_d... | zalum/tum-milk | sensor/sensor_output.py | sensor_output.py | py | 1,564 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sensor_input.read_spectrum_from_file",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Scatter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs",
"line_number": 17,
"usage_type": "name"
},
{
"... |
18187534019 | import pytest
from unittest.mock import sentinel, Mock
import bokeh.palettes
import pandas as pd
import pandas.testing as pdt
import datetime as dt
import numpy as np
import glob
import forest.drivers
from forest.drivers import earth_networks
LINES = [
"1,20190417T000001.440,+02.7514400,+031.9206400,-000001778,00... | MetOffice/forest | test/test_earth_networks.py | test_earth_networks.py | py | 4,847 | python | en | code | 38 | github-code | 1 | [
{
"api_name": "forest.drivers.earth_networks.Loader",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "forest.drivers.earth_networks",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "attribute"
},
... |
34529138843 | from pprint import pprint
from azdev.operations.regex import (
get_all_tested_commands_from_regex,
search_argument,
search_argument_context,
search_command,
search_command_group)
# pylint: disable=line-too-long
# one line test
def test_one_line_regex():
lines = [
# start with self.cmd.... | Azure/azure-cli-dev-tools | azdev/operations/tests/test_cmdcov.py | test_cmdcov.py | py | 19,031 | python | en | code | 71 | github-code | 1 | [
{
"api_name": "azdev.operations.regex.get_all_tested_commands_from_regex",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "azdev.operations.regex.get_all_tested_commands_from_regex",
"line_num... |
72765977315 | #!/usr/bin/env python
# list of packages that should be imported for this code to work
import cobra.mit.access
import cobra.mit.session
import cobra.mit.request
import cobra.mit.naming
import yaml
import argparse
import warnings
warnings.filterwarnings("ignore")
def get_args():
parser = argparse.ArgumentParser(de... | camrossi/aci-scripts | contractLookup.py | contractLookup.py | py | 3,057 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "cobra.mit.a... |
37441147060 | """
the simulation, simulates the motors and work in the same coordinate system.
"""
import pygame
import numpy as np
import time
import math
import matplotlib.pyplot as plt
import ArduinoCommunication as Ac
import Algorithmics as Algo
# ---------- CONSTANTS -------------
# COLORS
WHITE = (255, 255, 255)
BLACK = (0, ... | tomerpeled1/Projecton | Simulation.py | Simulation.py | py | 14,618 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.pi",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "math.pow",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "pygame.draw.line",
"line_number"... |
6213017763 | from functools import lru_cache
import csv
@lru_cache
def read(path):
data = []
with open(path) as file:
jobs_reader = csv.DictReader(file, delimiter=",", quotechar='"')
for row in jobs_reader:
data.append(row)
return data
| oelithon/estudo-projeto-job-insights | src/jobs.py | jobs.py | py | 265 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.DictReader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "functools.lru_cache",
"line_number": 5,
"usage_type": "name"
}
] |
2136965668 | import pygame
import time
pygame.mixer.init()
pygame.init()
pygame.mixer.music.set_volume(1)
window = pygame.display.set_mode((1800, 450))
pygame.display.set_caption('Guitar -> Piano Visualizer')
#### Maybe use this later for adding text to pygame screen #####
font = pygame.font.Font('freesansbold.ttf', 30)
eText = f... | wjudy/ForFunProjects | music/GUITARPIANO/guitarpiano.py | guitarpiano.py | py | 9,652 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.mixer.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.music.set_v... |
1091161094 | import cv2
print(cv2.__version__)
cam = cv2.VideoCapture(0)
while True:
output1, frame = cam.read()
greyFrame = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
cv2.imshow("CameraWindow", greyFrame)
cv2.moveWindow("CameraWindow", 500,0)
if cv2.waitKey(1) & 0xff == ord("q"):
break
cam.release()
... | kseeger-code/AI_for_Everyone | openCV-1.py | openCV-1.py | py | 321 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.__version__",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",... |
44344510292 | import os
import zipfile
if not os.path.isdir("dist"):
os.mkdir("dist")
zf = zipfile.ZipFile("dist/gcp-dumper-function.zip", "w")
for dirname, subdirs, files in os.walk("libs"):
if not dirname.endswith("__pycache__"):
zf.write(dirname)
for filename in files:
zf.write(os.path.join(d... | dhering/stock-scoring | gcp_dumper_build.py | gcp_dumper_build.py | py | 465 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "os.path.isdir",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number":... |
36902412685 | """For each root element in a XML file, count how many lines in the element.
The print out a list of the elements and the number of lines they have.
Optionally pass a flag to sort the elements by length
"""
from lxml import etree
import argparse
import re
import os
from pathlib import Path
from lxml.etree import XML... | marsfan/Farming-Simulator-Mod-Doc | utils/rootSizeCount.py | rootSizeCount.py | py | 2,187 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "lxml.etree._ElementTree",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree",
... |
24296607499 | ### stats.nba.com scraping ###
#region Imports
import pandas as pd
import numpy as np
from bs4 import BeautifulSoup
import requests
import datetime as dt
import os
import json
import time
from datetime import timedelta, date
#selenium imports
import selenium
from selenium import webdriver
from selenium.webdriver.chr... | HyunTruth/CSE6242-S20-PRJ-NBA-frontend | NBAPlayerDefensiveComparisons/Code/Scraping/nba_scraper.py | nba_scraper.py | py | 12,336 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.timedelta",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 80,
"usage_type": "call"
},
{
"api... |
18732404186 | from motor.motor_asyncio import AsyncIOMotorCollection, AsyncIOMotorClientSession
from pydantic import Field
import infrastructure
from models.base import EntityModel
class Organization(EntityModel):
name: str = Field()
class OrgCollectionRepository(infrastructure.LoggedCollectionRepository[Organization]):
... | paukstelom/sponsorbook | contexts/organization.py | organization.py | py | 542 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.base.EntityModel",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "infrastructure.LoggedCollectionRepository",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
43495796464 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 7 17:53:40 2023
@author: mingjunsun
This code is an example of solving LASSO-like optimization problems.
"""
import cvxpy as cp
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
from sklearn import linear_model
#f... | Sho-Shoo/36490-F23-Group1 | example_code/code_example.py | code_example.py | py | 4,282 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.chdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cvxpy.norm1",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "cvxpy.norm2",
"line_number":... |
38827167045 | """
The RAD record format defines what a flat record should look like. It's
an unifying format that is used through out the application.
This record is passed around the different components of the application
to keep a consistent data format. Also it is a good model for other people
in the team looking for data. It g... | radremedy/radrecord | radrecord/rad_record.py | rad_record.py | py | 9,585 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 112,
"usage_type": "name"
}
] |
24363636738 | import unittest
import uuid
from collections import namedtuple
from mock import Mock, patch
from spoppy import menus, responses
from . import utils
MockLoader = namedtuple('Loader', ('results', ))
class TestOptions(unittest.TestCase):
def setUp(self):
self.dct = {
'1': menus.MenuValue('A', ... | sindrig/spoppy | tests/test_menus.py | test_menus.py | py | 32,502 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "spoppy.menus.MenuValue",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "... |
70285110114 | from math import pi
import gym
import numpy as np
from math import pi, floor
from cmath import rect, phase
from gym import spaces
def wrap_to_pi(a):
"""
Wrap angle to [-pi pi]
:param a: angle to convert
:return: new angle in the [-pi pi]
"""
return a - (2 * pi * floor((a + pi) / (2 * pi))... | dam-grassman/Drone-Interception-Env | acas_wrappers.py | acas_wrappers.py | py | 4,342 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "math.pi",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "math.floor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cmath.phase",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 69,
... |
43565072112 | # encoding: utf-8
from collections import OrderedDict
import smtplib
import logging
from django import http
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.core.excepti... | colab/colab | colab/accounts/views.py | views.py | py | 11,704 | python | en | code | 23 | github-code | 1 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.views.generic.UpdateView",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "colab.accounts.forms.UserUpdateForm",
"line_number": 36,
"usage_type":... |
29055069542 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.forms.formsets import formset_factory
from django.forms import modelformset_factory
from django.core import serializers
from django.http import HttpResponse
from .models import Portfolio, PortfolioProduct, ... | cristianalecu/Django | monolith_alt/portfolios/views.py | views.py | py | 7,829 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.formsets.formset_factory",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "forms.ProductForm",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "portfolios.models",
"line_number": 20,
"usage_type": "name"
},
{
"api... |
35072126027 | import argparse
from datetime import datetime
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.remote.webdriver import WebDriver
import issuehandler.config as config
from issuehandler.pages import (Home... | Vernalhav/github-issue-tracker | issuehandler/issuehandler.py | issuehandler.py | py | 4,968 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.chrome.service.Service",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "issuehandler.config.DRIVER_PATH",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "issuehandler.config",
"line_number": 16,
"usage_type": "na... |
41897699827 | import smtplib
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
import traceback
import os
def build_content(sender, receiver, subject, body):
# 设置邮件正文,这里是支持HTML的
# 设置正文为符合邮件格式的HTML内容
m = MIMEText(_text=body, _subtype='h... | ChrisLi716/pythondemo | demo/email_01.py | email_01.py | py | 3,203 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "email.mime.text.MIMEText",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 27,
"usage_type": "call"
},
{
"api_... |
25894141826 | import datetime
import pytz
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from secrets import CALENDARS_TO_CHECK
# If modifying these scopes, delete the file token.json.
SCOPES = 'https://www.googleapis.com/auth/calendar.readonly'
def get_calendar... | jchorl/waker | server/gcalendar.py | gcalendar.py | py | 2,565 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "oauth2client.file.Storage",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "oauth2client.file",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "oauth2client.client.flow_from_clientsecrets",
"line_number": 17,
"usage_type": "call"
},
... |
33195845551 | # # # # # # # # # # # # # #
# CAPTAINHOOK IDENTIFIER #
# # # # # # # # # # # # # #
import os
import sys
from contextlib import contextmanager
from os.path import join
from .utils import filter_python_files, get_config_file
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
DEFAU... | alexcouper/captainhook | captainhook/checkers/flake8_checker.py | flake8_checker.py | py | 1,705 | python | en | code | 54 | github-code | 1 | [
{
"api_name": "utils.get_config_file",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.get_config_file",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "sys.stder... |
31369997290 | import sys
import unittest
sys.path.append("pig")
from unittest.mock import patch
from pig.computer_player import ComputerPlayer
from io import StringIO
class TestComputerPlayer(unittest.TestCase):
def test_take_turn_easy(self):
# Test that an easy computer player correctly holds their turn
player... | sams258/Dice-game-Pig- | test/test_computer_player.py | test_computer_player.py | py | 3,248 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pig.computer_player... |
42321692074 | import warnings
from typing import Tuple
import geopandas as gpd
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
# Use codes as defined by the [codebook](https://www.mass.gov/files/documents/2016/08/wr/classificationcodebook.pdf)
USE_CODES = {
"101": "Single Family",
"102": "Condominium... | ahasha/milton_maps | milton_maps/milton_maps.py | milton_maps.py | py | 7,614 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.Series",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "geopandas.GeoDataFrame",
"line_number": 97,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "warnings... |
28784194437 | '''
Author: Ding Pang
'''
import os
import io, csv
from re import S
from sqlalchemy import *
from sqlalchemy.pool import NullPool
from flask import Flask, request, render_template, g, redirect, make_response, flash, session, Response, url_for
from DBHelpers import *
from datetime import date
tmpl_dir = os.path.join(os... | DingPang/Shopify-Summer-2022-Challenge | server.py | server.py | py | 11,474 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line... |
7296684256 | import cv2
from cv2 import UMat
def crop_and_resize(frame:UMat,width:int,height:int)->UMat:
aspect=float(height)/float(width)
[original_height,original_width]=frame.shape[0:2]
original_aspect=float(original_height)/float(original_width)
if aspect < original_aspect:
# 高さが不要
temporary_height=int(original... | novogrammer/echo-of-art | echo_of_art/image_utils.py | image_utils.py | py | 758 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.UMat",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "cv2.resize",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_NEAREST",
"line_number": 18,
"usage_type": "attribute"
}
] |
11012367902 | from django.urls import path
from app1.views import *
urlpatterns = [
path('', inicio, name="Inicio"),
path('vuelo/', vuelo),
path('personal/', personal),
path('pasajero/', pasajero),
path('formulario1/', formulariovuelo, name="Crear Vuelos"),
path('formulario2/', formulariopersonal, name="Cr... | Luciano02-web/Entrega1-Bogarin | app1/urls.py | urls.py | py | 725 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
28211746299 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 27 21:40:34 2018
@author: deanng
"""
import pandas as pd
from security_3rd_property import DATA_PATH, DATA_TYPE, ROWS
import time
from contextlib import contextmanager
from security_3rd_model import tfidfModelTrain, nblrTrain
import scipy
# FEATURE... | DeanNg/3rd_security_competition | final_code/security_3rd_feature.py | security_3rd_feature.py | py | 9,978 | python | en | code | 53 | github-code | 1 | [
{
"api_name": "pandas.Series",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pandas.concat",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "security_3rd_mode... |
12771861930 | #!/usr/bin/python3
# runs VK modules in correct way
""" Developer and Author: Thomas Fire https://github.com/thomasfire (Telegram: @Thomas_Fire)
### Main manager: Uliy Bee
"""
from logging import exception
from os import getpid
import getmsg
import makeseq
import sendtovk
import updatemedia
def get_last_msg():
... | thomasfire/agent_smith | vk_run.py | vk_run.py | py | 1,972 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "getmsg.get_user_dict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "makeseq.load_keywords",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "updatemedia.main",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.getpid... |
23481077423 | # Recode By @mrismanaziz
# FROM Man-Userbot <https://github.com/mrismanaziz/Man-Userbot>
# t.me/SharingUserbot & t.me/Lunatic0de
import importlib
import logging
import os
import sys
from pathlib import Path
from userbot import CMD_HELP, DEVS, LOGS, TEMP_DOWNLOAD_DIRECTORY, bot
from userbot.events import register
from... | rainbowgirlidx/Man_Userbot | userbot/modules/core.py | core.py | py | 3,876 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "userbot.TEMP_DOWNLOAD_DIRECTORY",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "userbot... |
38904399549 | import pandas as pd
from silx.gui.qt import QMessageBox
from datetime import datetime
def save_csv(self):
filepath = self.imagepath
q_choice = self.q_combo.currentText()
loadedlist = self.loadedlistwidget
curvelist = [item.text() for item in loadedlist.selectedItems()]
curvenames = []
for curve... | IdanKes/SAXS | Main Code/saving_methods.py | saving_methods.py | py | 1,452 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "silx.gui.qt.QMessageBox",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetim... |
40785984696 | import pytest
from werkzeug.exceptions import NotFound, BadRequest
from app import api
from app.models import Camera
def test_get_query_string_params(application):
with application.test_request_context('/?foo=bar&life=42'):
assert api.get_query_string_params() == {'foo': 'bar', 'life': '42'}
... | percurnicus/opportunity | app/tests/test_api.py | test_api.py | py | 6,004 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "app.api.get_query_string_params",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.api",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "app.api.get_resource",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "app.mode... |
39273846847 | import os
import sys
import torch
import torch.utils.data as data
import numpy as np
from PIL import Image
import glob
import random
from torchvision import transforms
import matplotlib.pyplot as plt
import scipy.misc
class SALICON(data.Dataset):
def __init__(self, stimuli_train_path, stimuli_val_path, gt_train_... | pengqianli/ACNet | src/dataloader.py | dataloader.py | py | 1,863 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "glob.glob",
... |
74718431073 | import requests
from PIL import Image
from bs4 import BeautifulSoup
import os
import xlwt
import re
def get_captcha(si_code):
captcha_url = "http://my.ujs.edu.cn/" + si_code
print(captcha_url)
r = session.get(captcha_url, headers=header)
with open("captcha.jpg","wb") as f:
f.write(r.content)
... | beenlyons/Allspder | PySpider/ujsScore/get_score.py | get_score.py | py | 1,871 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
15127656412 | from collections import Counter
# O(n*log(n)) time | O(n) space
class Solution:
def findOriginalArray(self, changed: List[int]) -> List[int]:
# if list is not of even length, original cannot exist
if len(changed) % 2 != 0:
return []
changed.sort()
count = Counte... | mmichalak-swe/Algo_Expert_Python | LeetCode/2007_Find_Original_Array_From_Doubled/attempt_1.py | attempt_1.py | py | 682 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
}
] |
1586045599 | # -*- coding: utf-8 -*-
"""
*******************
tests.conftest
*******************
Utility functions that are used to configure Py.Test context.
"""
import os
import pytest
def pytest_addoption(parser):
"""Define options that the parser looks for in the command-line.
Pattern to use::
parser.addopt... | highcharts-for-python/highcharts-core | tests/conftest.py | conftest.py | py | 2,420 | python | en | code | 40 | github-code | 1 | [
{
"api_name": "pytest.xfail",
"line_number": 64,
"usage_type": "call"
}
] |
6649268514 | import copy
import logging
from typing import Optional
import requests
from ocean_provider.utils.basics import get_web3
from ocean_provider.utils.consumable import ConsumableCodes
from ocean_provider.utils.credentials import AddressCredential
from ocean_provider.utils.data_nft import get_data_nft_contract
from ocean_p... | oceanprotocol/provider | ocean_provider/utils/asset.py | asset.py | py | 4,033 | python | en | code | 25 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ocean_provider.utils.services.Service.from_json",
"line_number": 24,
"usage_type": "call"
},
{
"a... |
11038920804 | import os
import boto3
import time
import copy
import subprocess
import threading
import multiprocessing
MAX_WORKERS = 1
SRC_ACCESS_KEY = os.environ['SRC_ACCESS_KEY']
SRC_SECRET_KEY = os.environ['SRC_SECRET_KEY']
SRC_REGION = os.environ['SRC_REGION']
DST_ACCESS_KEY = os.environ['DST_ACCESS_KEY']
DST_SECRET_KEY ... | quintilesims/d.ims.io | tools/migrate.py | migrate.py | py | 3,876 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"lin... |
37670160302 | ## Top 5 restaurant types
from pymongo import MongoClient
def get_node(db):
return list(db.OSMLagny.aggregate([{"$match":{"amenity":{"$exists":1}, "amenity":"restaurant"}},
{"$group":{"_id":"$cuisine", "count":{"$sum":1}}},{"$sort":{"count":-1}}, {"$limit":5}]))
def get_db():
client = MongoC... | narquie/Data-Wrangling-Nanodegree | Python Scripts Queries/Top 5 Restaurants.py | Top 5 Restaurants.py | py | 461 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 7,
"usage_type": "call"
}
] |
42568375826 | import os
import shutil
from typing import List
def main(source_dir: str, des_dir: str, ext: str):
files = list_file_with_ext(source_dir, ext)
for file in files:
shutil.copy(file, des_dir)
# List all music files with path. Get file type by extension name.
def list_file_with_ext(file_path: str, ext_l... | zhiwenliang/scripts | file/colect_files_from_folder.py | colect_files_from_folder.py | py | 747 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "shutil.copy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.walk",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": ... |
73967433954 | import discogs_client
import config
import pandas as pd
#Connect using auth token
d = discogs_client.Client('discogsAnalytics', user_token=config.discogs_token)
me=d.identity()
collection_data = []
for album in me.collection_folders[1].releases:
formatlist = album.release.formats[0]
format_desc = formatlist[... | scottpmchugh/DiscogsAnalytics | extraction/discogsExtraction.py | discogsExtraction.py | py | 684 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discogs_client.Client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "config.discogs_token",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 27,
"usage_type": "call"
}
] |
3176992392 | import tweepy
from app.models.twitter import auth
from app.models.twitter import utils
def get_friends(username):
api = auth.get_api()
return api.friends(screen_name=username, include_user_entities='false',
skip_status='true')
def screen_names_of_friends(username):
friends = get_... | amtsh/vdeos.me | app/models/twitter/Twitter.py | Twitter.py | py | 883 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "app.models.twitter.auth.get_api",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.models.twitter.auth",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.models.twitter.auth.get_api",
"line_number": 19,
"usage_type": "call"
},
{
... |
37022607442 | import matplotlib
matplotlib.use('Agg')
import time
import argparse
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
import gc
# Models Packages
from sklearn import metrics
from sklearn.metrics import mean_squared_error
from sklearn import feature_se... | vuhoangminh/Kaggle-Avito | codes/train_tune_params.py | train_tune_params.py | py | 10,360 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "lib.prepare_training.get_string_time",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "... |
74262849954 | from app.models import Booking,db,SCHEMA,environment
from sqlalchemy.sql import text
from datetime import datetime
from faker import Faker
fake = Faker()
def seed_bookings():
booking1 = Booking(
class_id=1,
user_id=3,
time_start=datetime(2023,7,6, hour = 9,minute = 30),
time_end= ... | xuantien93/IronReligion | app/seeds/bookings.py | bookings.py | py | 1,731 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "faker.Faker",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.models.Booking",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
34007380981 | from django.urls import path
from . import views
urlpatterns = [
path('',views.index,name='home'),
path('submit',views.submit,name='submit'),
path('retrieve/',views.retrieve,name='retrieve'),
path('register',views.register,name="register"),
path('login',views.login,name='login'),
path('update... | satyampathakk/SIHPROJECT | SIHP/project/urls.py | urls.py | py | 682 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
32232085798 | import sys
sys.path.append("..")
import util.image_processing as impro
from util import mosaic
from util import data
import torch
def run_unet(img,net,size = 128,use_gpu = True):
img=impro.image2folat(img,3)
img=img.reshape(1,3,size,size)
img = torch.from_numpy(img)
if use_gpu:
img=img.cuda()
... | Synchronized2/DeepMosaics | models/runmodel.py | runmodel.py | py | 1,626 | python | en | code | 83 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "util.image_processing.image2folat",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "util.ima... |
43128390785 | """
__author__: Jiaming Shen
__description__: extract entity pair document level co-occurrence features
Input: 1) the sentence.json
Output: 1) eidDocPairCounts.txt, 2) eidDocPairPPMI.txt
"""
import sys
import json
import itertools
import math
from collections import defaultdict
import mmap
from tqdm import tqdm... | mickeysjm/HiExpan | src/featureExtraction/extractEidDocPairFeature.py | extractEidDocPairFeature.py | py | 2,434 | python | en | code | 71 | github-code | 1 | [
{
"api_name": "mmap.mmap",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"... |
18075673144 | import numpy as np
import pandas as pd
from scipy.interpolate import make_interp_spline, BSpline
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.switch_backend('agg')
mpl.rcParams['svg.hashsalt'] = 42
np.random.seed(42)
#print (plt.style.available)
#https://matplotlib.org/3.1.1/gallery/style_sheets/style_... | adithya8/ContextualEmbeddingDR | nvskplotter.py | nvskplotter.py | py | 7,467 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.switch_backend",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name... |
8272993033 | # MAGIC CODEFORCES PYTHON FAST IO
import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER
@atexit.register
def write():
sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
# END OF MAGIC CODEFORCES P... | elsantodel90/cses-problemset | stick_divisions.py | stick_divisions.py | py | 852 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin.read",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number"... |
14467272098 | """
Dimensionality Reduction using Dense_AutoEncoder
input:data in shape (784,n), Dimension
output:data in shape (Dimension,n)
"""
from keras.layers import *
from keras.models import Model
def dense_AE(data,dim):
x_train = data / 255
x_train = x_train.reshape((x_train.shape[0], -1))
encoding_dim = dim
... | Mateguo1/KMNIST | cluster/Dense_AutoEncoder.py | Dense_AutoEncoder.py | py | 1,300 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.models.Model",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "keras.models.Model",
"line_number": 34,
"usage_type": "call"
}
] |
16736609895 | import random as r
import math
import numpy as np
import tkinter as tk
import heapq
import itertools
import random
class Player:
polygons = []
n = None
def __init__(self, n, score=0):
self.n = n
self.polygons = []
self.score = 0
def add_pol(self, pol):
self.polygons.ap... | PaulWtlr/projet_info_2022 | DataType.py | DataType.py | py | 5,451 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "math.sqrt",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 167,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 177,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_... |
5719940935 | # correlation between googleTrendsCovidValue and cdcValue in path
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import ttest_ind
path = "./data/cdcAnxiety_googleCovid_COMBINED.csv"
missingPath = "./data/cdcAnxiety_googleCovid_COMBINED_withMissing.csv"
cdcOGPath = "./data/cdc/c... | Xyloidzzz/covid-depression-social | Correlations/cdc_google_correlation.py | cdc_google_correlation.py | py | 3,257 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scipy.stats.ttest_ind... |
71222805155 | # coding=utf-8
from functools import reduce
num = [1, 2, 3]
nums = [num for i in range(3)]
def all_aa(nums):
mfunc = lambda x, y: ["%s%s" % (i, j) for i in x for j in y]
# reduce(mfunc, nums)
# result1 = mfunc(nums[0], nums[1])
# result2 = mfunc(result1, nums[2])
dataresult = reduce(mfunc, nums... | FYPYTHON/PathOfStudy | Algorithm/python_reduce.py | python_reduce.py | py | 1,157 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functools.reduce",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 23,
"usage_type": "call"
}
] |
25730146075 | import shutil
import gradio as gr
import time
import yaml
import openai
import os
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.vectorstores import Chroma
from prepare_vectordb import PrepareVectorDB
from typing import List, Tuple
import re
import ast
import html
from cfg import l... | Farzad-R/LLM-playground | RAG-GPT/gradio_app_utils.py | gradio_app_utils.py | py | 10,047 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cfg.load_cfg",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "langchain.embeddings.open... |
29860315580 | import collections
def get_matrix(path_to_file="input.txt"):
matrix_str = ""
with open(path_to_file,"r") as file:
count = file.readline()
matrix_str = file.read()
matrix = []
lines = matrix_str.split("\n")
for line in lines:
elements = line.split(" ")
... | KeiserKholod/Cycles_BFS_Python | KA1.py | KA1.py | py | 3,093 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 19,
"usage_type": "call"
}
] |
11286756056 | import argparse
import cv2
import minerl
import numpy as np
import plotly.express as px
import random
import streamlit as st
from pathlib import Path
import time
@st.cache(suppress_st_warning=True, allow_output_mutation=True, max_entries=1)
def get_timeseries_actions_fig(actions_wide, action_labels, rewards):
st.... | JunShern/minerl-trajectory-viewer | main.py | main.py | py | 6,347 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.warning",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "plotly.express.imshow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "plotly.express",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "streamlit.cach... |
75143000674 | import os
import imageio.v3 as iio
import imageio
import torch
import argparse
import torchvision
import matplotlib.pyplot as plt
import numpy as np
from torchvision import datasets, transforms
from torchvision.transforms.functional import hflip, vflip
from utils import initialize_equi_model, set_seed
device = torch.... | basusourya/lambda_equitune | EquiClassification/feature_visualization.py | feature_visualization.py | py | 5,072 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torchvision.tran... |
25626976499 | from django import forms
from .models import ContinuingEducationLog, UserProfile
from django.contrib.auth.models import User
class CELogForm(forms.ModelForm):
class Meta:
model = ContinuingEducationLog
fields = ('required_CE', 'oversight_entity', 'repeat', 'hours', 'date_completed', 'top_items_learned',)
class ... | lydia-rodriguez/compliance | compliance/forms.py | forms.py | py | 1,024 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.ContinuingEducationLog",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "d... |
6912557640 | #!/usr/bin/env python3
"""
Benchmark on calling C methods for FASTCALL.
http://bugs.python.org/issue29263
Created at 2017-01-14 by INADA Naoki.
"""
import pyperf
runner = pyperf.Runner()
runner.timeit('b"".decode()',
"empty_bytes.decode()",
setup="empty_bytes = b''",
duplic... | vstinner/pymicrobench | bench_fastcall_c_method.py | bench_fastcall_c_method.py | py | 611 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "pyperf.Runner",
"line_number": 12,
"usage_type": "call"
}
] |
40823649994 | import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import time
import torch.utils.model_zoo as model_zoo
import numpy as np
import torch.utils.data as data_utils
import math
from collections import OrderedDict
... | htcao/AI_project | train.py | train.py | py | 3,891 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 42,
... |
9925796207 | import json
import logging
from typing import Optional
from ph4_walkingpad.profile import Profile, calories_walk2_minute, calories_rmrcb_minute
from ph4_walkingpad.reader import reverse_file
logger = logging.getLogger(__name__)
class StatsAnalysis:
def __init__(self, profile=None, profile_file=None, stats_file=... | ph4r05/ph4-walkingpad | ph4_walkingpad/analysis.py | analysis.py | py | 6,736 | python | en | code | 47 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ph4_walkingpad.profile.Profile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "ph4_walking... |
12943532357 | import timeit
import matplotlib.pyplot as plt
def algoritm1(item):
uniq_dict = {}
for x in item:
if x in uniq_dict:
return False
uniq_dict[x] = True
return True
def algoritm2(item):
uniq_lst = []
for x in item:
if x in uniq_lst:
return False
... | Polinaaa567/university_ipynb | 5_term/Alg/lab1_begin/2.2.py | 2.2.py | py | 817 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "timeit.timeit",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "timeit.timeit",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplo... |
3281837914 | # -*- coding: utf-8 -*-
# import accounts
from raven.contrib.flask import Sentry
from flask import Flask, request, redirect, abort
import ses
import urlparse
# from util import jsonify
app = Flask(__name__)
sentry = Sentry()
sentry.init_app(app)
@app.route('/')
def hello():
return 'Hello World!\n'
@app.route('... | Unholster/unholster-forms | web.py | web.py | py | 2,366 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "raven.contrib.flask.Sentry",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
2033204475 | import gzip
from keybert import KeyBERT
from yake import KeywordExtractor
import re
import setup_dir
NWORDS=100
FMT="{}\t{}\t{}\t{}\t{}\n"
cleans={ #important give all in lowercase!!!
r"international\s+water\s+management\s+institute": "iwmi",
r"sunil\s+mawatha": "",
r"the\s+consultative\s+group\s+on\s+international\... | asselapathirana/waybackcrawler | src/process_keywords.py | process_keywords.py | py | 2,190 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "yake.KeywordExtractor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "keybert.KeyBERT",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "setup_dir.DIR_KW",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "gzip.open... |
30211562412 | from concurrent.futures.thread import ThreadPoolExecutor
from contextlib import asynccontextmanager
import asyncio
class AsyncFile:
def __init__(self, file, loop=None, executor=None):
if not loop:
loop = asyncio.get_running_loop()
if not executor:
executor = ThreadPoolExecu... | Smile-Cats/asyncio-demo | my_asyncio_demo/编写异步上下文管理器.py | 编写异步上下文管理器.py | py | 1,765 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "asyncio.get_running_loop",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.thread.ThreadPoolExecutor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "asyncio.get_running_loop",
"line_number": 32,
"usage_type": "call"
... |
2931427678 | import email
from typing import Any, List
from fastapi import APIRouter, Body, Depends, HTTPException
from fastapi.encoders import jsonable_encoder
from pydantic.networks import EmailStr
from app import crud, models
from app.models.user import *
from app.api import deps
from app.core.config import settings
from app.u... | VittorioYan/full-stack-fastapi-mongodb | {{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/users.py | users.py | py | 4,083 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "app.crud.user.get_multi",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "app.crud.user",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "app.crud... |
2962763568 | import torch
def eval_model(model, loader, device):
with torch.no_grad():
test_accuracy = []
for input, target in loader:
input, target = input.to(device), target.to(device)
output = model(input)
batch_accuracy = (output.argmax(dim=1) == target).float()
... | kefirski/pruning | utils.py | utils.py | py | 421 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.no_grad",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 15,
"usage_type": "call"
}
] |
41880736603 | from django.conf import settings
from django.conf.urls.static import static
from django.urls import path
from django.contrib.auth.views import LoginView, LogoutView
from users.views import home, register, profileDetials, question1, question2, question3, compatibility, editProfile
urlpatterns = [
path('', home, na... | NethraGunti/ProfileCompatibility | users/urls.py | urls.py | py | 1,015 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "users.views.home",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "users.views.regi... |
29882430075 | from rest_framework.response import Response
from rest_framework import status, mixins, generics, viewsets
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from rest_framework.exceptions import NotFound
from .models import Drop
from .renderers import DropJSONRenderer
from .serializers import DropSerial... | rmbrntt/deaddrop | deaddrop-api/deaddrop/apps/drops/views.py | views.py | py | 2,893 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.mixins.CreateModelMixin",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.mixins",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.ListModelMixin",
"line_number": 32,
"usage_type":... |
4213543541 | """berrybeef.beef: provides entry point main()."""
import sys
from PyQt5.QtWidgets import QApplication
from .Info import Info
from BERRYBEEF.Main import MainWindow
from BERRYBEEF.constants import *
def main():
try:
app = QApplication(sys.argv)
screen = app.primaryScreen()
print('Scre... | ferlete/BerryBeef | BERRYBEEF/berrybeef.py | berrybeef.py | py | 849 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "Info.Info",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "BERRYBEEF.Main.M... |
15725734700 | from os import listdir, path
from time import clock
from pickle import dumps, loads
from gzip import compress, decompress
from random import shuffle
from sklearn.feature_selection import SelectKBest
import logging
class Vectors(object):
def __init__(self, corpos_folder_path, corpora_label_dict, debugging_output_f... | Orenef11/NLP-Lab | Vectors.py | Vectors.py | py | 11,821 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 25,... |
40239161316 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# external
import numpy as np
import matplotlib.pyplot as plt
import pandas
# local
from dtk import walk
obinna = pandas.read_csv('../data/obinna-walking.txt', delimiter='\t',
index_col="TimeStamp", na_values='0.000000')
# change the degrees to ... | csu-hmc/gait-control-direct-id-paper | src/control_solver_example.py | control_solver_example.py | py | 1,779 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.deg2rad",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dtk.walk.WalkingData",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dtk.walk",
"li... |
45645200524 | from django.http import JsonResponse
from django.shortcuts import redirect, get_object_or_404
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from vigil.models import AlertChannel, Alert
from celery import uuid, signature
from vigil import tasks
from vigil.models import VigilTaskRes... | inuitwallet/vigil | vigil/views/api_views.py | api_views.py | py | 2,058 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.views.View",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "vigil.models.Alert.objects.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "vigil.models.Alert.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"... |
10990266944 | from torch import nn
from towhee.models.vis4mer.transposelinear import TransposedLinear
from towhee.models.vis4mer.activation import Activation
from towhee.models.vis4mer.get_initializer import get_initializer
def LinearActivation(
d_input,
d_output,
bias=True,
zero_bias_init=False,
... | towhee-io/towhee | towhee/models/vis4mer/linearactivation.py | linearactivation.py | py | 1,645 | python | en | code | 2,843 | github-code | 1 | [
{
"api_name": "towhee.models.vis4mer.transposelinear.TransposedLinear",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 34,
"usage_type": "name"
},
{
... |
19547549511 | import datetime
import subprocess
log_file = open("logs.log", "a")
def log(message: str) -> None:
text = str(datetime.datetime.now()) + ": " + message + "\n"
print(text, end="")
log_file.write(text)
log("Checking to see if package 'MariaDB' is installed...")
check_stat_proc = subprocess.run(["dpkg", "-s"... | anay-p/mysql-for-termux | installer.py | installer.py | py | 2,407 | python | en | code | 36 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "subprocess.run",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "subprocess.... |
10603942515 | from django.shortcuts import render, redirect
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import login_required
def signup(request):
'''signup function'''
if re... | nopalpite/OCP9 | LITReview/accounts/views.py | views.py | py | 1,175 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 16,
"usa... |
40793798969 | import uuid
import speech_recognition as sr
r = sr.Recognizer()
language='ru_RU'
def recognise(filename):
with sr.AudioFile(filename) as source:
audio_text = r.listen(source)
try:
text = r.recognize_google(audio_text,language=language)
print(text)
return text
... | setta1a/bot_god | first/botTelegram/for stt/stt.py | stt.py | py | 1,251 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "speech_recognition.AudioFile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 23,
"usage_type": "call"
}
] |
5796985227 | import torch
import torchvision
from torch import nn
import os
class autoencoder(nn.Module):
def __init__(self, n_channel=1, n_class=36):
super(autoencoder, self).__init__()
self.encoder = nn.Sequential(
nn.Conv2d(n_channel, 32, 5, stride=3, padding=2), # b, 16, 10, 10
nn.R... | purelyvivid/captcha5 | model.py | model.py | py | 1,442 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
11003028307 | import collections
import heapq
class Solution:
def leastInterval(self, tasks: List[str], n: int) -> int:
lookup = {}
for item in tasks:
lookup[item] = lookup.get(item, 0) + 1
hold = []
for value in lookup.values():
heapq.heappush(hold, -value)
time =... | peaqi/mock | Python/621. Task Scheduler/heap, queue.py | heap, queue.py | py | 725 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "heapq.heappush",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"... |
31509600396 | from django import forms
from .models import General, HotWorks, ElectricalWorks
form_styles = {'contractor': forms.TextInput(attrs={'class': 'textinputfield'}),
'contractor_name': forms.TextInput(attrs={'class': 'textinputfield'}),
'facility': forms.TextInput(attrs={'class': 'textinputfi... | Megaprotas/work_project | permits/forms.py | forms.py | py | 3,621 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.TextInput",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.TextInput",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.forms"... |
73696765472 | import os, sys
import gym
import torch
import cv2
import numpy as np
import random
import time
import schedule
sys.path.append("./")
from network.backbone import BasicNet
from policy_optimizer import Optimizer
from network.dqn import DQN
from utils.dataloader import tnx2batch, batch4net
from utils.atari_wrapper import ... | fangyuedong/rainbow-with-ray | agent.py | agent.py | py | 8,661 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "utils.atari_wrapper.w... |
6255000766 | from python_graphql_client import GraphqlClient
import feedparser
import httpx
import json
import pathlib
import re
import os
import datetime
root = pathlib.Path(__file__).parent.resolve()
client = GraphqlClient(endpoint="https://api.github.com/graphql")
TOKEN = os.environ.get("GH_TOKEN", "")
def replace_chunk(con... | wintermorn1ng/wintermorn1ng | build_readme.py | build_readme.py | py | 2,078 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "python_graphql_client.GraphqlClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.en... |
42631122942 | from tkinter.filedialog import askopenfilename, asksaveasfile
import numpy as np
import matplotlib.pyplot as plt
class Calibration:
def __init__(self, defaultPath="calibration_files/kalib.txt", plot=None):
self.filepath = defaultPath
self.nm = []
self.pixels = []
self.model = None
... | TIS2022-FMFI/spektroskop-mikroskop | gui_widgets/Calibration.py | Calibration.py | py | 5,407 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.asksaveasfile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.poly1d",
"line_number": 69,
"usage_type": "call"
},
{
"... |
5299224856 | # -*- coding: utf-8 -*-
import torch as t
import sys
sys.path.append("../")
from models import HRcanNet
import cv2
import numpy as np
import h_psnr
import os
import time
class CIR:
def __init__(self, weights_file="../weights/dejpeg_HRcanNet2_1_33_best.pth"):
self._device = 'cuda'
# self._net = HS... | riverlight/HSR | scripts/ir_video.py | ir_video.py | py | 2,697 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_numb... |
29558607777 |
from pathlib import Path
from . import data
from . import plot
from . import excel
from . import config
from . import latex
import subprocess
class Document:
def __init__(self, prefix, title, subtitle, author, date):
self.prefix = prefix
self.title = title
self.subtitle = subtitle
... | HerveFrezza-Buet/bilan | pybilan/pybilan/report.py | report.py | py | 3,261 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_n... |
22525702483 | import collections
import glob
import logging
import os
from typing import List
import torch
from torch import nn
from torch.optim.lr_scheduler import LambdaLR
from torch.serialization import default_restore_location
logger = logging.getLogger()
CheckpointState = collections.namedtuple(
"CheckpointState",
[
... | microsoft/LMOps | uprise/DPR/dpr/utils/model_utils.py | model_utils.py | py | 4,819 | python | en | code | 2,623 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "torch.n... |
41330510557 | from databases import Database
from sqlalchemy import select, func
from typing import Dict
from db import models
from schemas import companies_members as schema_cm
from utils.exceptions import MyExceptions
class GenericDatabase:
def __init__(self, db: Database):
self.db = db
self... | zxc322/fast_api_app | repositories/services/generic_database.py | generic_database.py | py | 1,363 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "databases.Database",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "db.models.company_members",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "db.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "db.models... |
71015536355 | # Title: 감소하는 수
# Link: https://www.acmicpc.net/problem/1038
import itertools
import sys
sys.setrecursionlimit(10 ** 6)
def read_list_int():
return list(map(int, sys.stdin.readline().strip().split(' ')))
def read_single_int():
return int(sys.stdin.readline().strip())
def add_to_one(d_numb... | yskang/AlgorithmPractice | baekjoon/python/decreasing_number_1038.py | decreasing_number_1038.py | py | 1,814 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.read... |
32105962555 | #!/usr/bin/env python3
"""Contains function sum_list"""
from typing import Union, List
def sum_mixed_list(mxd_list: List[Union[int, float]]) -> float:
"""Calculates the sum of floats in the given list"""
sum: float = 0.00
for num in mxd_list:
sum += num
return sum
| Caesar-12/alx-backend-python | 0x00-python_variable_annotations/6-sum_mixed_list.py | 6-sum_mixed_list.py | py | 292 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 6,
"usage_type": "name"
}
] |
36250456309 | #bfs1 단지번호 붙이기
from collections import deque
n = int(input())
maps = []
for _ in range(n):
tmp = [int(i) for i in input()]
maps.append(tmp)
def bfs(coord,maps,visited):
dirs = [(1,0),(-1,0),(0,1),(0,-1)]
queue = deque()
queue.append((coord))
count = 0
while queue:
y,x = queue.poplef... | Choisiz/coding-test-Team | 김수빈/BFS/단지번호붙이기.py | 단지번호붙이기.py | py | 1,293 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 11,
"usage_type": "call"
}
] |
24913233421 | import requests
from get_access_token_by_refresh_token import get_access_token
def get_modules():
url = 'https://www.zohoapis.in/crm/v2/settings/modules'
access_token = get_access_token()
headers = {
'Authorization': 'Zoho-oauthtoken {}'.format(access_token)
}
response = requests.get(url=... | kirankigi5/remote_pregnancy_monitor | Remote-pregnancy-monitor-main/zoho_apis/fetch_modules.py | fetch_modules.py | py | 484 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "get_access_token_by_refresh_token.get_access_token",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
}
] |
21150388793 | import flet as ft
import views as views_handle
def main(page: ft.Page):
#defining the fonts
page.fonts = {
"SF Pro": "https://raw.githubusercontent.com/google/fonts/master/ofl/sfprodisplay/SFProDisplay-Bold.ttf",
}
#defining the window size
page.window_min_width = 425
page.win... | Sirapobchon/CPE334Project | fletapp/main.py | main.py | py | 997 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flet.Page",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "flet.CrossAxisAlignment",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flet.Theme",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flet.ThemeMode"... |
15718283398 | # import eventlet
# eventlet.monkey_patch()
from flask import Flask, request, jsonify, render_template
from flask_socketio import SocketIO, emit
from flask_cors import CORS
import time
import pandas as pd
import numpy as np
from math import sqrt
import heapq
from copy import deepcopy
import json
app = Flask(__name__... | GunjanAS/RepeatedAStar-algo-visualizer | app.py | app.py | py | 13,501 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
... |
42956395054 | __all__ = ["load", "save", "load_single_particle_model", "load_multi_particle_model"]
import os
import numpy as np
import tensorflow as tf
import deeptrack as dt
from tqdm import tqdm
import glob
import pandas as pd
def load(filename: str):
*_, ext = filename.split(os.path.extsep)
if os.path.isdir(filename):... | BenjaminMidtvedt/AutoTracking | autotracker/fs.py | fs.py | py | 2,200 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_... |
29928571724 |
import networkx as nx
import numpy as np
import torch
from datanetAPI import DatanetAPI
POLICIES = np.array(['WFQ', 'SP', 'DRR'])
def sample_to_dependency_graph(sample):
G = nx.DiGraph(sample.get_topology_object())
R = sample.get_routing_matrix()
T = sample.get_traffic_matrix()
P = sample.get_perf... | Mengxue12/RouteNet-E_pytorch | scheduling/read_dataset.py | read_dataset.py | py | 8,871 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_... |
18720834678 | #길이제한 해주는 프로그램 GPT3 최대 2048개의 토큰 처리 가능
import pandas as pd
from transformers import GPT2Tokenizer
def trim_to_combined_token_limit(csv_file, max_tokens=2048):
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
df = pd.read_csv(csv_file)
for idx, row in df.iterrows():
# convert 'nan' or empty inputs... | Dumul-KJH/everytime_ai | everytime_length.py | everytime_length.py | py | 1,693 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "transformers.GPT2Tokenizer.from_pretrained",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "transformers.GPT2Tokenizer",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
}
] |
73782221473 | # coding: utf-8
from pycparser import c_parser, c_ast
from cflags_loader import read_compiler_dflags_lib, get_cpp_dflags
from c_preprocessing import preprocess
def parse_text(text):
parser = c_parser.CParser()
ast = parser.parse(text, filename="<none>")
return ast
def get_ast(grouprep, filename, includ... | sa2c/shoplifter | files_and_functions/ast_parsing.py | ast_parsing.py | py | 1,801 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pycparser.c_parser.CParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pycparser.c_parser",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "cflags_loader.read_compiler_dflags_lib",
"line_number": 15,
"usage_type": "call"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.