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
33013803925
"""Config flow to configure Axis devices.""" from ipaddress import ip_address import voluptuous as vol from homeassistant import config_entries from homeassistant.const import ( CONF_HOST, CONF_MAC, CONF_NAME, CONF_PASSWORD, CONF_PORT, CONF_USERNAME, ) from homeassistant.util.network import i...
84KaliPleXon3/home-assistant-core
homeassistant/components/axis/config_flow.py
config_flow.py
py
5,044
python
en
code
1
github-code
6
[ { "api_name": "homeassistant.config_entries.ConfigFlow", "line_number": 35, "usage_type": "attribute" }, { "api_name": "homeassistant.config_entries", "line_number": 35, "usage_type": "name" }, { "api_name": "const.DOMAIN", "line_number": 35, "usage_type": "name" }, {...
36879836893
import numpy as np import matplotlib.pyplot as plt from implementations import * from implementations_modified import * from proj1_helpers import * ######################################### # Data preprocessing # ######################################### def standardize(x,data_mean,data_std): n...
kevinxqiu/machine-learning
impl_proj1.py
impl_proj1.py
py
6,886
python
en
code
0
github-code
6
[ { "api_name": "numpy.where", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.delete", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 3...
7436796972
""" Evaluates an MPG Ranch coarse classifier, version 3.0. The script must be run in a directory that contains an archive with only tseep or thrush clips. The clips must have been classified already by the coarse classifier to be evaluated, running in evaluation mode. The script takes a single command line argument, e...
HaroldMills/Vesper
scripts/evaluate_mpg_ranch_coarse_classifier_3_0.py
evaluate_mpg_ranch_coarse_classifier_3_0.py
py
6,124
python
en
code
47
github-code
6
[ { "api_name": "vesper.util.django_utils.set_up_django", "line_number": 28, "usage_type": "call" }, { "api_name": "vesper.util.django_utils", "line_number": 28, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 35, "usage_type": "call" }, { "api_...
72934903547
import zipfile from pathlib import Path import requests import torch import torchvision from torchvision import transforms from tqdm.auto import tqdm DATA_DIR = Path("data") NUM_WORKERS = 4 SIZE_H = SIZE_W = 96 BATCH_SIZE = 256 IMAGE_MEAN = (0.485, 0.456, 0.406) IMAGE_STD = (0.229, 0.224, 0.225) transformer = trans...
antony-frolov/cats-vs-dogs
cats_vs_dogs/utils.py
utils.py
py
1,765
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "torchvision.transforms.Compose", "line_number": 18, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 18, "usage_type": "name" }, { "api_name": "to...
9084217644
import logging from rdflib import Graph, Namespace, URIRef, Literal, BNode from rdflib.namespace import DCTERMS, RDF, RDFS import threading import time from oslcapi.api.helpers import module_to_service_provider, element_to_oslc_resource, list_buckets, list_instances, \ list_clusters log = logging.getLogger('teste...
AlexVaPe/pyOSLC_GCP
oslcapi/models/oslc.py
oslc.py
py
14,358
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "rdflib.Namespace", "line_number": 12, "usage_type": "call" }, { "api_name": "rdflib.Namespace", "line_number": 13, "usage_type": "call" }, { "api_name": "rdflib.Namespace"...
37955285503
from django.contrib.auth.models import User from django.forms import DateInput from django_filters import FilterSet, ModelChoiceFilter, DateFilter from .models import Post class PostFilter(FilterSet): author__user = ModelChoiceFilter( field_name='author__author', queryset=User.objects.all(), ...
DmitryZZZZZZ/Portal
news/filters.py
filters.py
py
610
python
en
code
1
github-code
6
[ { "api_name": "django_filters.FilterSet", "line_number": 7, "usage_type": "name" }, { "api_name": "django_filters.ModelChoiceFilter", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.all", "line_number": 10, "usage_type": "c...
24605705945
from PIL import Image import os sr21 = Image.open('sreekesh2021.png') vi20 = Image.open('vivek2020.jpeg') ku19 = Image.open('kumar2019.png') sh14 = Image.open('shaafi2014.jpeg') for f in os.listdir('.'): if f.endswith('.png') or f.endswith('.jpeg'): image = Image.open(f) width, height = image.siz...
hanok-e/SV-website
images/heat transfer/resize.py
resize.py
py
562
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 5, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 5, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 6...
23088075075
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Object Tracking Test Code by: Magnus Øye, Dated: 05.10-2018 Contact: magnus.oye@gmail.com Website: https://github.com/magnusoy/Balancing-Platform """ # Importing packages import cv2 from src.balancing_platform.video_processing import BallTracking # Run test if __name...
magnusoy/Balancing-Platform
tests/video_processing_test.py
video_processing_test.py
py
705
python
en
code
7
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 17, "usage_type": "call" }, { "api_name": "src.balancing_platform.video_processing.BallTracking", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 26, "usage_type": "call" } ]
19330919869
import pytest from unittest.mock import patch, MagicMock from src.chains import run_chain # Mock CONFIG using pytest fixture @pytest.fixture def mock_config(): with patch('src.chains.CONFIG', {'llm': 'gpt-3.5-turbo'}): yield # Mock external classes and run test @patch('src.chains.ChatOpenAI') @patch('src....
clarevoyance/acumen
tests/test_chains.py
test_chains.py
py
1,468
python
en
code
0
github-code
6
[ { "api_name": "unittest.mock.patch", "line_number": 8, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "attribute" }, { "api_name": "unittest.mock.MagicMock", "line_number": 17, "usage_type": "call" }, { "api_name": "unittes...
14986384190
import os from typing import Optional, Union, List, Tuple from langml import TF_KERAS if TF_KERAS: import tensorflow.keras as keras import tensorflow.keras.backend as K else: import keras import keras.backend as K import numpy as np import tensorflow as tf from typeguard import typechecked from langm...
ant-research/TDEER
langml/langml/third_party/crf.py
crf.py
py
26,788
python
en
code
9
github-code
6
[ { "api_name": "langml.TF_KERAS", "line_number": 5, "usage_type": "name" }, { "api_name": "langml.tensor_typing.Tensors", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.zeros_like", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.ze...
19932578718
import importlib import importlib.machinery import logging import os import re import socket from collections import OrderedDict from functools import lru_cache from signac.common import config from .directives import ( _EXECUTABLE, _NGPU, _NP, _NRANKS, _OMP_NUM_THREADS, _PROCESSOR_FRACTION, ...
shandave/signac-flow
flow/environment.py
environment.py
py
16,735
python
en
code
null
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 31, "usage_type": "call" }, { "api_name": "socket.getfqdn", "line_number": 40, "usage_type": "call" }, { "api_name": "functools.lru_cache", "line_number": 34, "usage_type": "call" }, { "api_name": "setuptools.comma...
23885132904
import common as day6 fishes = day6.makeFish(day6.getData("day6/data.txt")) days = 256 fishToAdd = 0 print("Initial State: {} ".format(fishes)) for day in range(days): if fishToAdd > 0: for _ in range(0, fishToAdd): fishes.append(day6.LanternFish()) fishToAdd = 0 for fish in fishes: ...
markwpearce/adventofcode2021
day6/day6.py
day6.py
py
430
python
en
code
0
github-code
6
[ { "api_name": "common.makeFish", "line_number": 4, "usage_type": "call" }, { "api_name": "common.getData", "line_number": 4, "usage_type": "call" }, { "api_name": "common.LanternFish", "line_number": 12, "usage_type": "call" } ]
7271318930
import calendar, csv, datetime, json, requests, time, urllib from bs4 import BeautifulSoup FANDOM = 'Warrior Nun (TV)' START_PAGE = 62 END_PAGE = 70 PAUSE = 70 #seconds to wait in between batches to avoid rate-limits OUTPUT_FILE = 'output/{fandom}_{date}.csv'.format( fandom=FANDOM, date=datetime.datetime.isoforma...
tlee911/ao3-scripts
fandom.py
fandom.py
py
7,980
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.isoformat", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name...
72331727868
"""Ручное управление транзакцией""" import asyncio import asyncpg from config import conf_load from asyncpg.transaction import Transaction import os async def main(): await conf_load() connection = await asyncpg.connect( host=os.environ["host"], port=os.environ["port"], user=os.environ...
Shcherbakov98/asyncio
chapter_5/listing_5_12.py
listing_5_12.py
py
1,495
python
ru
code
1
github-code
6
[ { "api_name": "config.conf_load", "line_number": 10, "usage_type": "call" }, { "api_name": "asyncpg.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "li...
32554351863
from collections import deque for t in range(10): n=input();l=deque(list(map(int,input().split())));r='' while l[-1]!=0: for i in range(5): tmp=l.popleft() if tmp-1-i>0:l.append(tmp-i-1) else:l.append(0);break for i in l:r+=str(i)+' ' print(f'#{t+1}',r)
jbsam2/algo_problem
swea/D3/1225. 암호생성기.py
1225. 암호생성기.py
py
313
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 3, "usage_type": "call" } ]
11871243250
"""Does the typing work with a generic function that zips? Yes""" from typing import Iterable, TypeVar, TYPE_CHECKING _T1 = TypeVar("_T1") _T2 = TypeVar("_T2") def zip_func(a: Iterable[_T1], b: Iterable[_T2]) -> list[tuple[_T1, _T2]]: a = list(a) b = list(b) length = min(len(a), len(b)) return [(a[i],...
Wattsy2020/zip_typing
experimentation/generic_function.py
generic_function.py
py
1,332
python
en
code
0
github-code
6
[ { "api_name": "typing.TypeVar", "line_number": 4, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 5, "usage_type": "call" }, { "api_name": "typing.Iterable", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.TYPE_CHECKING", ...
8310498208
import pytest from unittest import mock from share.regulate import Regulator from share.regulate.steps import NodeStep, GraphStep, ValidationStep from share.util.graph import MutableGraph @pytest.mark.parametrize('num_node_steps', [0, 1, 5]) @pytest.mark.parametrize('num_graph_steps', [0, 1, 5]) @pytest.mark.paramet...
dwtcourses/SHARE
tests/share/regulate/test_regulator.py
test_regulator.py
py
1,665
python
en
code
null
github-code
6
[ { "api_name": "unittest.mock.Mock", "line_number": 17, "usage_type": "call" }, { "api_name": "share.regulate.steps.NodeStep", "line_number": 17, "usage_type": "argument" }, { "api_name": "unittest.mock", "line_number": 17, "usage_type": "name" }, { "api_name": "un...
28806146206
from __future__ import print_function import subprocess import os import tempfile from . import exceptions, sessions from .template import get_installed_templates from .formatter import get_installed_formatters def benzo_request(template_name, formatter_name, session_path=None): all_templates = get_installed_te...
coddingtonbear/benzo
benzo/editor.py
editor.py
py
3,471
python
en
code
3
github-code
6
[ { "api_name": "template.get_installed_templates", "line_number": 13, "usage_type": "call" }, { "api_name": "formatter.get_installed_formatters", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { ...
39314324620
from bs4 import BeautifulSoup import requests import re url = 'https://www.google.com' url_EL = 'https://www.gasbuddy.com/station/195230' url_COM = 'https://www.gasbuddy.com/station/24786' # Types of gas: Regular and Premium # Site also displays prices at other gas stations # I can add some logic(conditiona...
stephenfong/Gasprices-webscraper
Gasprices.py
Gasprices.py
py
1,843
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" } ]
22218621466
import os import math import types import functools import numpy as np import director from director import matlab from director import callbacks from director.asynctaskqueue import AsyncTaskQueue from director.ikconstraints import * from director import drcargs class AsyncIKCommunicator(): STARTUP_COMPLETED = '...
RobotLocomotion/director
src/python/director/matlabik.py
matlabik.py
py
24,418
python
en
code
176
github-code
6
[ { "api_name": "director.callbacks.CallbackRegistry", "line_number": 31, "usage_type": "call" }, { "api_name": "director.callbacks", "line_number": 31, "usage_type": "name" }, { "api_name": "os.path.relpath", "line_number": 44, "usage_type": "call" }, { "api_name":...
36341333864
# 정수를 저장하는 큐를 구현한 다음, 입력으로 주어지는 명령을 처리하는 프로그램을 작성하시오. # 명령은 총 여섯 가지이다. # push X: 정수 X를 큐에 넣는 연산이다. # pop: 큐에서 가장 앞에 있는 정수를 빼고, 그 수를 출력한다. 만약 큐에 들어있는 정수가 없는 경우에는 -1을 출력한다. # size: 큐에 들어있는 정수의 개수를 출력한다. # empty: 큐가 비어있으면 1, 아니면 0을 출력한다. # front: 큐의 가장 앞에 있는 정수를 출력한다. 만약 큐에 들어있는 정수가 없는 경우에는 -1을 출력한다. # back: 큐의 가장 뒤에 있는...
jujinyoung/CodingTest
bakjjun_codingTest/18258.py
18258.py
py
1,507
python
ko
code
0
github-code
6
[ { "api_name": "sys.stdin.readline", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 14, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdin.readlin...
28831529050
import json import sys from rdp import rdp input_file_name = 'data/contours.json' output_file_name = 'data/compacted_contours.json' rdp_epsilon = 0.1 if __name__ == "__main__": arg_count = len(sys.argv) print(f"Arguments count: {arg_count}") proc_args = sys.argv for i, arg in enumerate(proc_args): ...
denorlov/isolines
compact.py
compact.py
py
1,507
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 33, "usage_type": "call" }, { "api_name": "rdp.rdp", "line_number": 47...
9002492644
from service._globals import labels from service.helpers import decode_b64_to_img import cv2 import numpy as np from models.db.classifications import DBClassification, DBImages, DBResult from service.util import time_ from base64 import b64encode from models.extraction.extraction import TextExtractor import joblib fro...
Crischinaldo/OCR
src/API/src/models/classification.py
classification.py
py
2,475
python
en
code
0
github-code
6
[ { "api_name": "service._globals.labels", "line_number": 23, "usage_type": "name" }, { "api_name": "models.extraction.extraction.TextExtractor", "line_number": 24, "usage_type": "name" }, { "api_name": "joblib.load", "line_number": 25, "usage_type": "call" }, { "ap...
20340721588
import streamlit as st import pandas as pd import joblib,os # NLP Packages import spacy nlp = spacy.load("en_core_web_sm") from nltk.corpus import wordnet import string import re import nltk from nltk import pos_tag from nltk.corpus import stopwords from nltk.tokenize import WhitespaceTokenizer from nltk.stem import W...
NJF0029/final_project
App/sentiment_app_v2.py
sentiment_app_v2.py
py
5,343
python
en
code
1
github-code
6
[ { "api_name": "spacy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 17, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 18, "usage_type": "call" }, { "api_name": "nltk.download", "line_numbe...
28156145484
""" Hilarious script written for automating score calculation (quality diversity metrics) for one set of experiments""" import argparse import subprocess import sys from pathlib import Path from typing import List from thre3d_atom.utils.logging import log def parse_arguments(args: List[str]) -> argparse.Namespace: ...
akanimax/3inGAN
projects/thre3ingan/automated_scripts/compute_quality_diversity_metrics_for_experiment_set.py
compute_quality_diversity_metrics_for_experiment_set.py
py
4,125
python
en
code
3
github-code
6
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 17, "usage_type": "attribute" }, { "a...
34399888296
from collections import namedtuple import struct import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset ''' ! types of cells, in/outflow can be combined, e.g., TypeFluid|TypeInflow CellType { TypeNone = 0, TypeFluid = 1, TypeObstacle = 2, ...
cshouu/mypack
FluidNet_2d4c.py
FluidNet_2d4c.py
py
13,779
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 28, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.float32", ...
20894237624
from django import template from datetime import datetime register=template.Library() @register.filter(name='dec') def dec(value1=None ,value2=None): if (value1!=None): end=str(value1).split() start=str(value2).split() delta =[] end=end[1].split(':') start...
SanazSafaei/hoursRecorder
hoursRecorder/boards/templatetags/custom.py
custom.py
py
576
python
en
code
0
github-code
6
[ { "api_name": "django.template.Library", "line_number": 4, "usage_type": "call" }, { "api_name": "django.template", "line_number": 4, "usage_type": "name" } ]
22825469323
from __future__ import (absolute_import, division, print_function, unicode_literals) from datetime import date from tornado.ioloop import IOLoop from tornado.testing import AsyncTestCase, gen_test from tornado.test.util import unittest import tornado.platform.twisted import mysql.connector impo...
geerk/toradbapi
tests.py
tests.py
py
5,396
python
en
code
3
github-code
6
[ { "api_name": "tornado.ioloop.platform.twisted.install", "line_number": 18, "usage_type": "call" }, { "api_name": "tornado.ioloop.platform", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tornado.ioloop", "line_number": 18, "usage_type": "name" }, { ...
71654558267
import os import time from pytz import utc from flask import Flask, request, render_template, flash, redirect, url_for, session, send_file from flask import Blueprint, g from flask_mysqldb import MySQL from flask_session import Session from twilio.rest import Client from flask_apscheduler import APScheduler from dateti...
dpmittal/Amnesia-Helper
app/views/main.py
main.py
py
4,784
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 14, "usage_type": "call" }, { "api_name": "twilio.rest.Client", "line_number": 19, "usage_type": "call" }, { "api_name": "flask_apscheduler.APScheduler", "line_number": 22, "usage_type": "call" }, { "api_name": "app....
40602337015
#coding:utf-8 import numpy as np import matplotlib.pyplot as plt np.random.seed(42) m = 100 n_epochs = 50 # エポック数 batch_size = 20 # バッチサイズ t0, t1 = 200, 1000 def learning_schedule(t): return t0/float(t+t1) X = 2 * np.random.rand(m, 1) y = 4 + 3 * X + np.random.randn(m, 1) X_b = np.c_[np.ones((m, 1)), X] # add...
Sadaku1993/gradient_descent
minibatch_gradient_descent.py
minibatch_gradient_descent.py
py
1,173
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", ...
70513195389
from django.utils.translation import ugettext_lazy as _ from lcs_client import validate_token, RequestError, CredentialError, InternalServerError from rest_framework import exceptions from mentorq_user.models import MentorqUser # defines the backend used to authenticate users given an email and an lcs auth token cla...
HackRU/mentorq-backend
mentorq_user/backends.py
backends.py
py
1,529
python
en
code
0
github-code
6
[ { "api_name": "lcs_client.validate_token", "line_number": 17, "usage_type": "call" }, { "api_name": "lcs_client.InternalServerError", "line_number": 18, "usage_type": "name" }, { "api_name": "lcs_client.RequestError", "line_number": 18, "usage_type": "name" }, { "...
33847832983
from .models import Login import numpy as nm from django.shortcuts import render ,redirect from django.contrib import messages from django.contrib.auth.models import User,auth import matplotlib.pyplot as plt import pandas as pd from matplotlib.colors import ListedColormap from sklearn.metrics import accuracy_score from...
Dhanu6568/Dsp
views.py
views.py
py
9,407
python
en
code
1
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 16, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.filter", "line_number": 30, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 30, "usag...
32006111093
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2017/12/30 10:23 # @Author : Xsh # @File : location_contacts.py # @Software: PyCharm import traceback from cache.helper import hgetall from cache.keys import get_token from config.order_app import db from tools import constant as cs from model.location_c...
xushuhai/OrderSystem
order_v1/service/location_contacts.py
location_contacts.py
py
1,794
python
en
code
0
github-code
6
[ { "api_name": "model.location_contacts.LocationContacts.query.filter_by", "line_number": 25, "usage_type": "call" }, { "api_name": "model.location_contacts.LocationContacts.query", "line_number": 25, "usage_type": "attribute" }, { "api_name": "model.location_contacts.LocationCont...
21354348625
from typing import List class Solution: def mergeSimilarItems(self, items1: List[List[int]], items2: List[List[int]]) -> List[List[int]]: val2weigh = dict() for v, w in items1: val2weigh[v] = val2weigh.get(v, 0) + w for v, w in items2: val2weigh[v] = val2weig...
Alex-Beng/ojs
FuckLeetcode/2363. 合并相似的物品.py
2363. 合并相似的物品.py
py
403
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
25689401983
import requests import math import re import pandas as pd ##################################################### # USER DEFINED VARIABLES: # You can construct your boolean logic on the search form and copy the query string from the results page (English only for now). query = '(TITLE:(water) AND (testing) AND (ontari...
scholarsportal/text-mining
corpus-builder.py
corpus-builder.py
py
2,760
python
en
code
6
github-code
6
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 31, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 83, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 9...
29578469420
# -*- coding: utf-8 -*- """ https://jakevdp.github.io/PythonDataScienceHandbook/04.11-settings-and-stylesheets.html Created on Fri Oct 26 14:38:36 2018 @author: Akitaka """ import matplotlib.pyplot as plt import numpy as np x = np.random.randn(1000) plt.hist(x); #%% # use a gray background ax = plt.ax...
nakanishi-akitaka/python2018_backup
1026/04.11_settings_and_stylesheets.py
04.11_settings_and_stylesheets.py
py
2,045
python
en
code
5
github-code
6
[ { "api_name": "numpy.random.randn", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotli...
13110910882
from flask import request, jsonify from data_provider import * from rest_api.api_config import ma from app import app from tabledef import Watchlist class WatchlistSchema(ma.ModelSchema): class Meta: model = Watchlist watchlistSchema = WatchlistSchema(only=('name', 'description', 'id', 'user_id')) watc...
spachava753/project-viper
rest_api/watchlist_api.py
watchlist_api.py
py
2,425
python
en
code
0
github-code
6
[ { "api_name": "rest_api.api_config.ma.ModelSchema", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_api.api_config.ma", "line_number": 9, "usage_type": "name" }, { "api_name": "tabledef.Watchlist", "line_number": 11, "usage_type": "name" }, { "a...
73414638908
import json def carregar(user) -> None: with open("config.json", "r") as arquivo: try: dados = json.load(arquivo) except Exception: return False if all(valor == "" for valor in dados.values()): return False user.username = dados['name'] ...
lorenzolpandolfo/firescript
config.py
config.py
py
1,675
python
pt
code
1
github-code
6
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 46, "usage_type": "call" } ]
1336215979
#!/usr/bin/python ''' filter MulTiXcan and PrediXcan WB results Mappability>0.8 and no cross-mappability between pairs needed for Table 1 tested count and Fig 2 QQ plot ''' import gzip import sys import argparse import os def check_arg(args=None): parser = argparse.ArgumentParser(description='Script to filter poo...
WheelerLab/trans-PrediXcan
scripts_filter-results/01_filter_full_results_rm_bad_map.py
01_filter_full_results_rm_bad_map.py
py
2,085
python
en
code
2
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "gzip.open", "line_number": 42, "usage_type": "call" }, { "api_name": "gzip.open", "line...
5751783727
""" Benjamin Stanton Tech2Protect Denver HeartLink 9/28/19 """ import sqlite3 as sql import json as js def getDataSnapshot(): teamSize = 5 records = [] conn = sql.connect("HeartLink_DB.db") conn.cursor() for record in conn.execute("SELECT * FROM FR_DATA ORDER BY TS desc LIMIT " + str(teamSi...
happyklans/T2P-challenge-7-backend
DB_to_websocket.py
DB_to_websocket.py
py
816
python
en
code
1
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 36, "usage_type": "call" } ]
18101428514
from turtle import right from typing import List, Optional from unittest import main, TestCase from queue import Queue """ 6 2 4 1 6 2 1 4 2 1 6 4 """ # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val...
hirotake111/leetcode_diary
leetcode/recover_bst/solution.py
solution.py
py
3,561
python
en
code
0
github-code
6
[ { "api_name": "turtle.right", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 38, "usage_type": "name" }, { "api_name": "unittest.TestCase", ...
29121016093
from web_flask.views import app_views from flask import render_template, url_for, redirect, request from flask_login import login_required, current_user from models import storage @app_views.route('/account') @login_required def account(): user = storage.get("User", current_user.get_id()) return render_templa...
mostafaehab96/Handmade
web_flask/views/account.py
account.py
py
891
python
en
code
0
github-code
6
[ { "api_name": "models.storage.get", "line_number": 10, "usage_type": "call" }, { "api_name": "models.storage", "line_number": 10, "usage_type": "name" }, { "api_name": "flask_login.current_user.get_id", "line_number": 10, "usage_type": "call" }, { "api_name": "fla...
24377720255
from ..thriftpy2 import load from ..thriftpy2.thrift import TApplicationException, TMessageType from ..thriftpy2.http import THttpClient from ..thriftpy2.protocol import TCompactProtocol from ..thriftpy2.protocol import TBinaryProtocol from ..thriftpy2.transport import TBufferedTransport from ..thriftpy2.Thrift.TCCompa...
Alfinonh-fn/linepoll
line/curve/console.py
console.py
py
10,226
python
en
code
1
github-code
6
[ { "api_name": "itertools.zip_longest", "line_number": 19, "usage_type": "call" }, { "api_name": "thriftpy2.load", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "l...
40698835265
import json from channels.generic.websocket import WebsocketConsumer from asgiref.sync import async_to_sync from django.utils import timezone import redis from django.conf import settings import ast CHAT_SIZE = 20 class MyMessage: message = '' user = '' datetime = '' def __init__(self, message): ...
watislaf/django_blog
chat/consumers.py
consumers.py
py
2,371
python
en
code
0
github-code
6
[ { "api_name": "django.utils.timezone.now", "line_number": 27, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 27, "usage_type": "name" }, { "api_name": "channels.generic.websocket.WebsocketConsumer", "line_number": 31, "usage_type": "name" ...
27825826891
import os import sys import subprocess from PyQt5 import QtWidgets from PyQt5.QtWidgets import * from PyQt5 import QtGui from PyQt5 import QtCore from ldap3 import Connection, AUTO_BIND_NO_TLS, SUBTREE import dlg import gui import threading import re import yaml class ParentWindow(QMainWindow, gui.Ui_MainWindow): ...
MikhailParkin/MikhailParkin
Other/RDP/main.py
main.py
py
16,758
python
en
code
0
github-code
6
[ { "api_name": "gui.Ui_MainWindow", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "yaml.dump", "l...
30298843350
import talib as ta import pandas as pd import numpy as np import os import shap from pandas_finance import Equity from sklearn.metrics import mean_squared_error from sklearn.ensemble import RandomForestRegressor from matplotlib import pyplot as plt def get_candle_features(df, target='return_t+1', remove_zero_days=Fal...
miladhamzelou/playground
python/equity.py
equity.py
py
2,019
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_squared_error", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas...
74741436667
import dash import dash_core_components as dcc import dash_html_components as html from datetime import datetime as dt from datetime import date from dash.dependencies import Input, Output, State import yfinance as yf import pandas as pd import plotly.express as px from dash.exceptions import PreventUpdate from model ...
sujithyadav998/Stock-Dash
app.py
app.py
py
6,756
python
en
code
0
github-code
6
[ { "api_name": "dash.Dash", "line_number": 13, "usage_type": "call" }, { "api_name": "dash_html_components.Div", "line_number": 25, "usage_type": "call" }, { "api_name": "dash_html_components.H1", "line_number": 27, "usage_type": "call" }, { "api_name": "dash_html_...
24835181731
import requests from bs4 import BeautifulSoup import re import json import csv from multiprocessing import Pool import argparse fieldNames = ['url', 'bodyType', 'brand', 'color', 'fuelType', 'modelDate', 'name', 'numberOfDoors', 'productionDate', 'vehicleTransmission', 'engineDisplacement', 'enginePow...
vorontsovdg/autoru_parser
downloadContent.py
downloadContent.py
py
8,976
python
en
code
1
github-code
6
[ { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 174, "usage_type": "call" }, { "api_name": "json.dumps", "line_num...
24168978952
from bs4 import BeautifulSoup import requests response = requests.get("https://news.ycombinator.com/") yc_webpage = response.text soup = BeautifulSoup(yc_webpage, "html.parser") articles = soup.find_all(name="span", class_="titleline") text_articles = [] link_articles = [] for article in articles: article_text =...
Shd-Dan/Udemy_100_days_beatiful_soup_web_scaping
main.py
main.py
py
1,002
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" } ]
6794416900
from __future__ import annotations from . import ( cancel_order_params, ) import typing from dataclasses import dataclass from construct import Container, Construct import borsh_construct as borsh class CancelMultipleOrdersByIdParamsJSON(typing.TypedDict): orders: list[cancel_order_params.CancelOrderParamsJSO...
Ellipsis-Labs/phoenixpy
phoenix/types/cancel_multiple_orders_by_id_params.py
cancel_multiple_orders_by_id_params.py
py
1,627
python
en
code
5
github-code
6
[ { "api_name": "typing.TypedDict", "line_number": 11, "usage_type": "attribute" }, { "api_name": "typing.ClassVar", "line_number": 17, "usage_type": "attribute" }, { "api_name": "borsh_construct.CStruct", "line_number": 17, "usage_type": "call" }, { "api_name": "bo...
3367913796
import random import re from datetime import datetime from io import BytesIO from pathlib import Path from typing import Union, Optional import discord import imageio import requests from PIL import Image, ImageOps from discord.utils import get from collections import namedtuple from constants import GUILD_ID, beer_e...
Traus/discord_bot
utils/guild_utils.py
guild_utils.py
py
7,645
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 22, "usage_type": "call" }, { "api_name": "init_bot.bot.get_guild", "line_number": 26, "usage_type": "call" }, { "api_name": "constants.GUILD_ID", "line_number": 26, "usage_type": "argument" }, { "api_name": "...
25010857605
from sys import setrecursionlimit setrecursionlimit(3000) def atob(a, b): if a == b: return f"{a}" if a > b: return f"{a} , {atob(a - 1, b)}" if a < b: return f"{a}, {atob(a + 1, b)}" # глубина рекурсси в Питоне - 1000 def akk(m, n): if m == 0: return n + 1 eli...
the-nans/py2-repo_gb
lesson2_sandbox/sandbox.py
sandbox.py
py
6,490
python
en
code
0
github-code
6
[ { "api_name": "sys.setrecursionlimit", "line_number": 3, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 204, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 223, "usage_type": "call" }, { "api_name": "collections.named...
23182389166
# -*- coding: utf-8 -*- """ Created on Mon Jul 8 15:04:23 2019 @author: cheng """ import numpy as np import matplotlib.pyplot as plt import math import os from scipy.spatial import ConvexHull def plot_loss(history, scale, real_scale, timestr, dataname): loss = history.history['loss'] val_loss = ...
haohao11/MCENET
scripts/plots.py
plots.py
py
8,249
python
en
code
10
github-code
6
[ { "api_name": "math.sqrt", "line_number": 18, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
72788396989
# -*- coding: utf-8 -*- import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from bs4 import BeautifulSoup import re...
LonEdit120/testing_codes
selenium_test_04.py
selenium_test_04.py
py
1,502
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 13, "usage_type": "call" }, ...
16659747174
import nltk from taggers import reg_exp_tagger, query_tagger import thulac with open("Leipzig10ksents_500.txt","r") as f: origin_text = f.read() # get test words and tag of test words thu_tag = thulac.thulac() train_word = thu_tag.cut(origin_text) test_word = [i[0] for i in train_word] print('test words:') print...
dufengtong/NLPHomeWork
hw2/combine_tagger.py
combine_tagger.py
py
706
python
en
code
0
github-code
6
[ { "api_name": "thulac.thulac", "line_number": 10, "usage_type": "call" }, { "api_name": "taggers.query_tagger", "line_number": 19, "usage_type": "call" }, { "api_name": "taggers.reg_exp_tagger", "line_number": 22, "usage_type": "call" }, { "api_name": "nltk.Unigra...
21071729203
import wandb import seaborn as sns import matplotlib.pyplot as plt api = wandb.Api() run = api.run("chcaa/gjallarhorn/254xlvgj") loss = run.history(keys=["train_inner/loss", "valid/loss"]) loss = loss.set_index(loss["_step"]) loss = loss.drop("_step", axis=1) p = sns.lineplot(data=loss) p.set_xlabel("Steps") p.set...
centre-for-humanities-computing/Gjallarhorn
plot_loss.py
plot_loss.py
py
559
python
en
code
1
github-code
6
[ { "api_name": "wandb.Api", "line_number": 5, "usage_type": "call" }, { "api_name": "seaborn.lineplot", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.legend", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
21024535797
""" Miscellaneous utilities. These are mostly used in templates, for presentation purposes. """ try: import pygments from pygments import highlight from pygments import lexers from pygments.formatters import HtmlFormatter except ImportError: pygments = None try: import markdown except ImportE...
oz123/git-arr
utils.py
utils.py
py
3,435
python
en
code
0
github-code
6
[ { "api_name": "pygments.lexers.DiffLexer", "line_number": 71, "usage_type": "call" }, { "api_name": "pygments.lexers", "line_number": 71, "usage_type": "name" }, { "api_name": "pygments.formatters.HtmlFormatter", "line_number": 72, "usage_type": "call" }, { "api_n...
26211369524
import numpy as np import matplotlib.pyplot as plt t = np.linspace(0,2200,10000) x = 16*np.sin(t)**3+25 y = 13*np.cos(t)-5*np.cos(2*t)-2*np.cos(3*t)-np.cos(4*t)+20 plt.figure(figsize = (7,5)) plt.plot(x,y,color="pink",linewidth=5) plt.text(14,19,"Happy Birthday Python",fontsize=20,color="red")
Charlie-37/ITVedant
Teachers Practice Questions/love.py
love.py
py
298
python
en
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_...
36096455205
import numpy as np import networkx as nx import matplotlib.pyplot as plt def create_graph(): adj_mat = np.loadtxt(r'C:\Users\Connor Moore\Desktop\365 Project Uber\Code\base_files\network.csv', delimiter=',') graph_ = nx.from_numpy_matrix(adj_mat, create_using=nx.MultiGraph) return graph_ # This just print...
cplm98/Uber-Destinations
ReadFiles.py
ReadFiles.py
py
547
python
en
code
0
github-code
6
[ { "api_name": "numpy.loadtxt", "line_number": 6, "usage_type": "call" }, { "api_name": "networkx.from_numpy_matrix", "line_number": 7, "usage_type": "call" }, { "api_name": "networkx.MultiGraph", "line_number": 7, "usage_type": "attribute" }, { "api_name": "networ...
23053640393
import datetime as dt import matplotlib.pyplot as plt import numpy as np import data_loader start = dt.datetime(2019, 6, 1) now = dt.datetime.now() df = data_loader.load_price_history("amd", start, now) df["High"].plot(label="High") pivots = [] dates = [] counter = 0 last_pivot = 0 value_range = [0, 0, 0, 0, 0, ...
liam-e/finance
pivots.py
pivots.py
py
1,222
python
en
code
2
github-code
6
[ { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "data_load...
72600898749
# Core library import import os import json # External library imports import spotipy import spotipy.oauth2 as oauth2 # Personal imports from spotify_info import CLIENT_ID, CLIENT_SECRET from tools import ms_to_min_sec_text class SpotifyPlaylistExport: def __init__(self): self.token = None self.s...
Coul33t/spotify-to-youtube
spotify_export.py
spotify_export.py
py
3,098
python
en
code
0
github-code
6
[ { "api_name": "spotipy.oauth2.SpotifyClientCredentials", "line_number": 23, "usage_type": "call" }, { "api_name": "spotipy.oauth2", "line_number": 23, "usage_type": "name" }, { "api_name": "spotify_info.CLIENT_ID", "line_number": 24, "usage_type": "name" }, { "api...
10966120077
import os import pdb import time os.environ["CUDA_VISIBLE_DEVICES"] = '1,2,3,4' import torch.nn as nn from datasets import Action_DATASETS from torch.utils.data import DataLoader from tqdm import tqdm import wandb import argparse import shutil from pathlib import Path import yaml from dotmap import DotMap import pprin...
Lycus99/SDA-CLIP
train.py
train.py
py
11,015
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 34, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 34, "usage_type": "name" }, { "api_name": "torch.nn.Module", "l...
32149684467
# Upload Gold-3 BFS 다리 만들기 import sys from collections import deque input = sys.stdin.readline N = int(input()) maps = [list(map(int,input().split())) for _ in range(N)] visited = [[0]*(N) for _ in range(N)] border = [] ways = [[0,1],[1,0],[-1,0],[0,-1]] answer = N*N def changeMaps(x,y,irelandNum): ...
HS980924/Algorithm
src/13.BFS/B#2156_다리만들기.py
B#2156_다리만들기.py
py
1,965
python
en
code
2
github-code
6
[ { "api_name": "sys.stdin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 49, "usage_type": "call" } ]
2083446916
from typing import Any import hydra import torch from omegaconf import DictConfig from pytorch_lightning import LightningModule class BaseLitModule(LightningModule): def __init__( self, network: DictConfig, optimizer: DictConfig, scheduler: DictConfig, logging: DictConfig,...
gorodnitskiy/yet-another-lightning-hydra-template
src/modules/components/lit_module.py
lit_module.py
py
1,897
python
en
code
128
github-code
6
[ { "api_name": "pytorch_lightning.LightningModule", "line_number": 9, "usage_type": "name" }, { "api_name": "omegaconf.DictConfig", "line_number": 12, "usage_type": "name" }, { "api_name": "omegaconf.DictConfig", "line_number": 13, "usage_type": "name" }, { "api_na...
35031053803
"""Module Docstring""" import subprocess import isort # noqa: F401 import snoop from kombu import Connection from loguru import logger fmt = "{time} - {name} - {level} - {message}" logger.add("../logs/info.log", level="INFO", format=fmt, backtrace=True, diagnose=True) # noqa: E501 logger.add("../logs/error.log", le...
miccaldas/celery_and_friends
celery_and_friends/vivaldi/kom.py
kom.py
py
693
python
en
code
0
github-code
6
[ { "api_name": "loguru.logger.add", "line_number": 10, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 10, "usage_type": "name" }, { "api_name": "loguru.logger.add", "line_number": 11, "usage_type": "call" }, { "api_name": "loguru.logger", ...
14161218685
import json import logging import os import httpx import telegram from telegram import constants from pynamodb.attributes import BooleanAttribute, NumberAttribute from pynamodb.models import Model from pynamodb.pagination import ResultIterator from telegram.error import BadRequest, Unauthorized import atoma logger =...
seik/dailywikipedia
bot.py
bot.py
py
4,296
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "json.dumps", ...
12137617767
#!/usr/bin/env python # -*- coding: UTF-8 -*- """word count. Usage: word_count.py --conf_file_path=<conf_file_path> --output_dir_path=<output_dir_path> word_count.py -h | --help Options: -h --help show this screen and exit. """ from datetime import datetime from docopt import docopt impo...
sugitaka64/selenium
tenshoku_kaigi/scripts/word_count.py
word_count.py
py
2,097
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.today", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "name" }, { "api_name": "docopt.docopt", "line_number": 26, "usage_type": "call" }, { "api_name": "yaml.load", ...
3597712427
from __future__ import print_function import torch import torchvision.transforms as transforms import click import os import random import sys import datetime import dateutil import dateutil.tz dir_path = (os.path.abspath(os.path.join(os.path.realpath(__file__), './.'))) sys.path.append(dir_path) from datasets impo...
jindal2309/Text2Image-DL-Project
main.py
main.py
py
4,968
python
en
code
0
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.realpath", "lin...
71621941627
from ast import Delete from gc import get_objects from optparse import check_builtin from select import select from typing import ItemsView from django.shortcuts import render, redirect from django.http import HttpResponse from .models import Orders, Product, Category, Seller, Cart, Tracker, Review from django.contrib...
divyansh383/Flipkart_Clone
shop/views.py
views.py
py
13,925
python
en
code
2
github-code
6
[ { "api_name": "django.shortcuts.redirect", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 28, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 30, "usage_type": "call" }, { ...
22323829942
import cv2 as cv import numpy as np #Callback function def cross(x): pass #Creating a black image using numpy array of 800x600 dimensions and three channels. img = np.zeros((800,600,3), np.uint8) #Creating a named window cv.namedWindow("Color Picker") #Creating an ON/OFF switch for the color picker cv.createTrac...
vermaprince123/Computer-Vision-and-Image-Processing
CV and IP/ImgData/colorPicker.py
colorPicker.py
py
1,401
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.namedWindow", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.createTrackbar", "...
25266889115
import torch.nn.functional as F import torch.nn as nn class NN_model(nn.Module): def __init__(self): super(NN_model, self).__init__() self.layer1 = nn.Linear(50, 10) self.M_out = nn.Linear(10, 2) self.soft = nn.Softmax(dim=1) def forward(self, x): x = F.relu(self.lay...
M0hammadmahdi/Semi-Supervised-Learning-with-covariate-shift
Experiment 1/CSSL_models.py
CSSL_models.py
py
1,306
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
34104789852
from flask import Blueprint, request, jsonify from flask_login import login_required, current_user from app.models import Board, Pin from app import db from app.forms import BoardForm, BoardPinForm from app.models import board_pins import json # from app.forms import PinForm board_routes = Blueprint('boards', __name__...
tmarks98/Spinterest
app/api/board_routes.py
board_routes.py
py
3,434
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "app.models.Board.query.all", "line_number": 26, "usage_type": "call" }, { "api_name": "app.models.Board.query", "line_number": 26, "usage_type": "attribute" }, { "api_name":...
20835146345
import streamlit as st import webbrowser st.title("First Assignment Innomatics Research Labs") st.header("Create Streamlit Data App") st.subheader("Khushboo Singh") linkedin = 'https://www.linkedin.com/in/khushboo-singh-94934a105' if st.button('Linkedin'): webbrowser.open_new_tab(linkedin) github = ...
Khushb123/Innomatics-StreamLit-Assignment
app.py
app.py
py
414
python
en
code
0
github-code
6
[ { "api_name": "streamlit.title", "line_number": 4, "usage_type": "call" }, { "api_name": "streamlit.header", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit.subheader", "line_number": 6, "usage_type": "call" }, { "api_name": "streamlit.button", ...
44437397334
from pymongo import MongoClient import sys client = MongoClient() db = client['LogsUnitDB'] arguments = { 'EventID' : 1, 'TimeCreated': 2 } def insertRow(): db.Logs.insert_one( { "EventId": sys.argv[arguments['EventID']], "Time": sys.argv...
oreloffir/FinalProject
eventListener.py
eventListener.py
py
408
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" } ]
1446995601
import adagio from adagio import keys from adagio_backtest.config import * from adagio.utils.mongo import get_library adagio.AdagioConfig.quandl_token = QUANDL_TOKEN if __name__ == '__main__': library = get_library(keys.backtest) # common parameters lo_vol_scale_params = { keys.vs_chg_rule: '+We...
thoriuchi0531/adagio_backtest
adagio_backtest/run_trend_following_benchmark.py
run_trend_following_benchmark.py
py
10,341
python
en
code
0
github-code
6
[ { "api_name": "adagio.AdagioConfig", "line_number": 7, "usage_type": "attribute" }, { "api_name": "adagio.utils.mongo.get_library", "line_number": 10, "usage_type": "call" }, { "api_name": "adagio.keys.backtest", "line_number": 10, "usage_type": "attribute" }, { "...
23376036894
from django.contrib.auth import login from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.shortcuts import render, get_object_or_404, redirect from django.utils import timezone from django.contrib import messages import time from django.http import HttpRespo...
joekariuki3/mysite_blog_django
blog/views.py
views.py
py
6,615
python
en
code
0
github-code
6
[ { "api_name": "models.Post.objects.filter", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 19, "usage_type": "name" }, { "api_name": "djang...
19266279103
import import_string from pathlib import Path from uuid import uuid4 from chamber.models import SmartModel from django.core.exceptions import ValidationError from django.core.files.base import ContentFile from django.utils.functional import cached_property from django.db import models from django.utils.translation im...
druids/django-pymess
pymess/models/emails.py
emails.py
py
10,611
python
en
code
9
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 34, "usage_type": "call" }, { "api_name": "pymess.config.settings.EMAIL_STORAGE_PATH", "line_number": 34, "usage_type": "attribute" }, { "api_name": "pymess.config.settings", "line_number": 34, "usage_type": "name" }, { ...
22417920761
from flask import request, jsonify from application import app import db import utils @app.route('/api/users', methods=['GET']) def users_get(): if request.method == 'GET': user_id = request.args.get("userId") response_data = [] if user_id: success, user = db.get_one( ...
dericf/twitter-clone-api
application/routes/users.py
users.py
py
2,935
python
en
code
0
github-code
6
[ { "api_name": "flask.request.method", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.request.args.get", "line_number": 11, "usage_type": "call" }, { "api_name": "flask....
73060228029
from time import sleep import pytest from physical.signals import H, L from test_utils import CPUTestCase, Probe from .clock import AdjustableInterval, Clock, Pulse class AdjustableIntervalTest(CPUTestCase): def setUp(self): self.probe = Probe() self.ai = AdjustableInterval() def test_adju...
tp86/be-cpu
logical/test_clock.py
test_clock.py
py
3,371
python
en
code
0
github-code
6
[ { "api_name": "test_utils.CPUTestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "test_utils.Probe", "line_number": 13, "usage_type": "call" }, { "api_name": "clock.AdjustableInterval", "line_number": 14, "usage_type": "call" }, { "api_name": "time...
4556525265
# -*- coding: utf-8 -*- """ Created on Sun Jun 28 19:20:04 2020 @author: joost """ from pyquil_interp_function import interp_pyquil import pandas as pd import networkx as nx p_max = 10 # maxdepth N = 20 # number of graphs per node number n d = 3 # degree of regular graphs # creating dataframe output = pd.DataFrame...
soosub/bsc-thesis
Implementation/NewPlan/experiments/pyquil_interp_experiment_koen.py
pyquil_interp_experiment_koen.py
py
919
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "networkx.random_regular_graph", "line_number": 22, "usage_type": "call" }, { "api_name": "pyquil_interp_function.interp_pyquil", "line_number": 25, "usage_type": "call" } ]
40377824235
import gym from gym import spaces import ray from ray.rllib.algorithms import ppo import numpy as np import pandas as pd import config REWARD_PENALTY = config.REWARD_PENALTY ''' reward -> add latency requirement remove read_lat from features toggle between two actions and three actions reward penalty toggle ''' de...
TreeinRandomForest/nic-tuning-experiments
rl/env.py
env.py
py
6,338
python
en
code
0
github-code
6
[ { "api_name": "config.REWARD_PENALTY", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.sort", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.roll", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.roll", "li...
74197629309
from datetime import datetime, timedelta import pandas as pd from rest_framework import viewsets from rest_framework.decorators import action from rest_framework.response import Response from common.dates_interval import get_days_interval from des.dao import DesSkybotJobResultDao from des.dao.exposure import Exposure...
linea-it/tno
backend/des/views/skybot_job_result.py
skybot_job_result.py
py
6,465
python
pt
code
1
github-code
6
[ { "api_name": "rest_framework.viewsets.ReadOnlyModelViewSet", "line_number": 15, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 15, "usage_type": "name" }, { "api_name": "des.models.SkybotJobResult.objects.select_related", "line_number": ...
14764045044
from collections import namedtuple, deque from typing import List Request = namedtuple("Request", ["arrived_at", "time_to_process"]) Response = namedtuple("Response", ["was_dropped", "started_at"]) class Buffer: def __init__(self, size): self._size = size self._current_time = 0 self._fini...
JoeLove100/data-structures-and-algorithms
data_structures/basic_data_structures/network_packets_sim.py
network_packets_sim.py
py
1,990
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 12, "usage_type": "call" }, { "api_name": "typing....
43632909793
u""" Tools for programmatically generating config files for AllenNLP models. """ # pylint: disable=protected-access,too-many-return-statements from __future__ import absolute_import from __future__ import print_function #typing import collections import inspect import importlib import json import re import torch fro...
plasticityai/magnitude
pymagnitude/third_party/allennlp/common/configuration.py
configuration.py
py
12,879
python
en
code
1,607
github-code
6
[ { "api_name": "itertools.izip", "line_number": 33, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 38, "usage_type": "call" }, { "api_name": "allennlp.nn.initializers.Initializer", "line_number": 48, "usage_type": "argument" }, { "api_name": "collec...
22990506156
from http.server import BaseHTTPRequestHandler, HTTPServer import os import mysql.connector import time hostname = "0.0.0.0" port = 8080 time.sleep(5) class weatherHTTP(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) self.send_header("Content-type", "text/html") self.en...
KacperS22/weatherscript
httpserver.py
httpserver.py
py
1,012
python
en
code
0
github-code
6
[ { "api_name": "time.sleep", "line_number": 9, "usage_type": "call" }, { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 11, "usage_type": "name" }, { "api_name": "mysql.connector.connector.connect", "line_number": 17, "usage_type": "call" }, { "ap...
4931651084
import matplotlib.pyplot as plt import numpy train_cost = [] test_cost = [] with open('log', 'r') as f: lines = f.readlines() for line in lines: if line[0] == 'T': # test elements = line.rstrip('\n\r').split(':') cost = float(elements[1]) test_cost.append(cost) elif line[0]...
wondervictor/DeepLearningWithPaddle
OCR-CTC/draw_curve.py
draw_curve.py
py
719
python
en
code
5
github-code
6
[ { "api_name": "matplotlib.pyplot.subplot", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 24, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 25, "usage_type": "call" }, { "api_name": "ma...
7239881010
from importlib import import_module from django.conf import settings from .items import SubMenu MENU_DICT = ".menubase.MENUS" #! need an all(), cached #? lazy data gathering, to cache #? API needs multiple query, so not stock map API? #? but if recursion ok, stash map... #? use attributes, not string keys class Me...
rcrowther/django_menus
manager.py
manager.py
py
2,878
python
en
code
0
github-code
6
[ { "api_name": "importlib.import_module", "line_number": 31, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 36, "usage_type": "argument" }, { "api_name": "items.SubMenu", "line_number": 53, "usage_type": "argument" } ]
70848631869
#import useful modules here #import pygame import pygame.display from GameData import loadImage, ImageBank class DrawableObject(object): """ This is the super class of all object that can be drawn to the screen. """ # Class variable shared by all objects which will be drawn to the # screen. S...
jceipek/Complete-Galactic-Dominion
game_code/DrawableObject.py
DrawableObject.py
py
5,915
python
en
code
2
github-code
6
[ { "api_name": "GameData.ImageBank", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.display.display.get_init", "line_number": 41, "usage_type": "call" }, { "api_name": "pygame.display.display", "line_number": 41, "usage_type": "attribute" }, { "ap...
19324646724
import torch import torch.optim as optim from torch.optim.lr_scheduler import StepLR import time from vgg import vgg from torch.autograd import Variable import numpy as np import argparse import csv import pickle import os import matplotlib.pylab as plt from resnet import * from torch.utils.data.sampler import Subset...
gsin4455/pytorch_mod
run_net_pkl_old.py
run_net_pkl_old.py
py
10,666
python
en
code
4
github-code
6
[ { "api_name": "torch.nn.CrossEntropyLoss", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.optim.SGD", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.optim",...
21547256600
#!/usr/bin/env python # -*- coding: utf-8 -*- '''A simple script to setup dataset files ''' import re import sys import requests import hashlib import shutil import numpy as np from pathlib import Path from sklearn.preprocessing import MultiLabelBinarizer from sklearn.datasets import load_svmlight_file, dump_svmlight_f...
MrinalJain17/ml-tools-project
src/setup.py
setup.py
py
6,939
python
en
code
1
github-code
6
[ { "api_name": "re.sub", "line_number": 24, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.datasets.load_svmlight_file", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.preprocessi...
12676470496
""" File: webcrawler.py Name: -------------------------- This file collects more data from https://www.ssa.gov/oact/babynames/decades/names2010s.html https://www.ssa.gov/oact/babynames/decades/names2000s.html https://www.ssa.gov/oact/babynames/decades/names1990s.html Please print the number of top200 male and female o...
gj94851225/andrew-s-
stanCode_project/info from internet/webcrawler.py
webcrawler.py
py
1,796
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 35, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 37, "usage_type": "call" } ]
30070244528
import os import sys assert sys.version_info >= (3, 5) # make sure we have Python 3.5+ import numpy as np from pyspark.sql import SparkSession, functions, types from pyspark.sql.types import ArrayType, IntegerType, FloatType, StringType from pyspark.sql.functions import ltrim, rtrim, trim, regexp_replace from pyspark...
irisjiayuema/big-data-lab-I-final
NLP/Trials/step1_tfidf.py
step1_tfidf.py
py
4,016
python
en
code
3
github-code
6
[ { "api_name": "sys.version_info", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pyspark.sql.functions.ltrim", "line_number": 37, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.rtrim", "line_number": 37, "usage_type": "call" }, { "api_...
35961998196
import socket import threading import queue import time import os import hashlib from difflib import SequenceMatcher import datetime my_uuid = os.popen("wmic diskdrive get serialnumber").read().split()[-1] # peer'ın uuid'si tutuluyor.(harddisk'e göre) class loggerThread(threading.Thread): ...
keremdndr/DagitikProject
peer.py
peer.py
py
16,302
python
en
code
0
github-code
6
[ { "api_name": "os.popen", "line_number": 10, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 13, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "threading.Th...
21414701396
from . import has_energy from . import game_object from game import world import pygame class SpareBattery(has_energy.HasEnergy, game_object.GameObject): def __init__(self, x, y, battery_loading): self.battery_loading = battery_loading game = world.Game.get_instance() pos = game.get_middle...
buecktobias/RobotBatteryGame
game/spare_battery.py
spare_battery.py
py
951
python
en
code
0
github-code
6
[ { "api_name": "game.world.Game.get_instance", "line_number": 10, "usage_type": "call" }, { "api_name": "game.world.Game", "line_number": 10, "usage_type": "attribute" }, { "api_name": "game.world", "line_number": 10, "usage_type": "name" }, { "api_name": "game.get...
6773822325
from collections import defaultdict import collections from statistics import mean import multiprocessing as mp import json from typing import List import ray import torch import torch.optim as optim from compiled_jss.CPEnv import CompiledJssEnvCP from torch.utils.tensorboard import SummaryWriter from torch.utils....
ingambe/End2End-Job-Shop-Scheduling-CP
main.py
main.py
py
33,247
python
en
code
16
github-code
6
[ { "api_name": "typing.List", "line_number": 43, "usage_type": "name" }, { "api_name": "Network.Agent", "line_number": 43, "usage_type": "name" }, { "api_name": "torch.no_grad", "line_number": 44, "usage_type": "call" }, { "api_name": "compiled_jss.CPEnv.CompiledJs...
36118669223
# Dependencies from bs4 import BeautifulSoup import requests import pymongo from splinter import Browser from webdriver_manager.chrome import ChromeDriverManager import pandas as pd import json def scrape_info(): executable_path = {'executable_path': ChromeDriverManager().install()} browser = Browser('chrome'...
rachelverner/web-scraping-challenge
scrape_mars.py
scrape_mars.py
py
4,398
python
en
code
0
github-code
6
[ { "api_name": "webdriver_manager.chrome.ChromeDriverManager", "line_number": 11, "usage_type": "call" }, { "api_name": "splinter.Browser", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" }, { "a...
70398638907
"""utilities for collision checking Author: Keisuke Okumura Affiliation: TokyoTech & OSX Note: We used the FLC library at the beginning so the library includes those wrappers. However, the latest one does not rely on FCL because it assumes that all agents and obstacles are 2D circle. Currently, only "continuous_collid...
omron-sinicx/ctrm
src/ctrm/environment/fcl_utils.py
fcl_utils.py
py
6,564
python
en
code
21
github-code
6
[ { "api_name": "numpy.ndarray", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.pad", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 43, "usage_type": "attribute" }, { "api_name": "fcl.Sphere", "lin...
26863737560
import json import os from app import app, db from flask import render_template, request, redirect, url_for, flash, session from flask_login import login_required, login_user, logout_user from app.forms import UserForm, EmployeeForm, RoomForm from app.models import User, Employee, Rooms from app.helper import save_chan...
sachisabya28/Peopleportal
app/views.py
views.py
py
6,084
python
en
code
0
github-code
6
[ { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.flash", "line_number": 20, "usage_type": "call" }, { "api_name": "app.models.Employee.query.all", "line_number": 29, "usage_type": "call" }, { "api_name": "app.models.Employ...
26413762502
import requests import json import numpy as np import pandas as pd class Connection: def __init__(self, api_key): """ A class to handle connections to the alphavantage api Attributes ---------- api_endpoint : str endpoint for api api_key : str ...
carsonaj/pymarket
pymarket/api.py
api.py
py
2,778
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 48, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 55, "usage_type": "call" }, { "api_name": "pandas.DatetimeIndex", "line_number": 91, "usage_type": "call" }, { "api_name": "numpy.array", "line_...
20315010636
import pandas as pd import pymysql class SqlHelper(object): def __init__(self, host, db, user, pwd, port=3306, charset='utf8'): """ :param host: 主机ip地址或者域名 :param db: 该主键的对应的数据库 :param user: 该数据库的用户名称 :param pwd: 该数据库的用户密码 :param port: 该主键的对应的数据库的端口,默认是3306 ...
okcdev/okcdev-script
autoRpt/utils/DataSource.py
DataSource.py
py
2,749
python
en
code
0
github-code
6
[ { "api_name": "pymysql.connect", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 77, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 78, "usage_type": "call" } ]