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
27728505423
import os import sys import builtins import versioneer if sys.version_info[:2] < (3, 7): raise RuntimeError("Python version >= 3.7 required.") builtins.__CALLSEQ_SETUP__ = True if os.path.exists('MANIFEST'): os.remove('MANIFEST') CONDA_BUILD = int(os.environ.get('CONDA_BUILD', '0')) CONDA_ENV = os.environ.g...
pearu/callseq
setup.py
setup.py
py
2,892
python
en
code
2
github-code
6
[ { "api_name": "sys.version_info", "line_number": 6, "usage_type": "attribute" }, { "api_name": "builtins.__CALLSEQ_SETUP__", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os...
40445929542
from abc import abstractmethod, ABCMeta from typing import Type, Union, Callable, Literal from turbosnake._utils0 import have_differences_by_keys class LayoutManagerABC(metaclass=ABCMeta): __slots__ = ('container', 'settings', 'active') SELF_LAYOUT_PROPS = () CHILD_LAYOUT_PROPS = () def __init__(sel...
AlexeyBond/turbosnake
turbosnake/ttk/_layout.py
_layout.py
py
7,683
python
en
code
1
github-code
6
[ { "api_name": "abc.ABCMeta", "line_number": 7, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 17, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 25, "usage_type": "name" }, { "api_name": "turbosnake._utils0.h...
42604977343
#!/usr/bin/env python """ Young-Jae Choi Computational Nano-Physics Laboratory Physics Dept. POSTECH, Pohang, South Korea. """ import numpy as np import datetime import pickle as pckl from subprocess import call def get_neighbors( alist, bond_cutoff, bond_rules=None, dtype='float64', ...
hitergelei/tools
structure_analyses.py
structure_analyses.py
py
64,218
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 40, ...
19143426803
#!/usr/bin/env python # # test_texttag.py - # # Author: Paul McCarthy <pauldmccarthy@gmail.com> # import wx from . import run_with_wx, simclick, simtext, simkey, addall, realYield import fsleyes_widgets.texttag as tt def simtexttt(panel, text): panel.newTagCtrl.ChangeValue(text) panel._TextTagPanel__onTextC...
pauldmccarthy/fsleyes-widgets
fsleyes_widgets/tests/test_texttag.py
test_texttag.py
py
11,510
python
en
code
1
github-code
6
[ { "api_name": "wx.GetApp", "line_number": 22, "usage_type": "call" }, { "api_name": "fsleyes_widgets.texttag.StaticTextTag", "line_number": 23, "usage_type": "call" }, { "api_name": "fsleyes_widgets.texttag", "line_number": 23, "usage_type": "name" }, { "api_name"...
2555614427
import sys import os import numpy as np from PIL import Image import torchvision from torch.utils.data.dataset import Subset from sklearn.metrics.pairwise import cosine_similarity, euclidean_distances import torch import torch.nn.functional as F import random def get_webvision(root, cfg_trainer, num_samples=0, train=...
shengliu66/ELR
ELR_plus/data_loader/webvision.py
webvision.py
py
4,866
python
en
code
271
github-code
6
[ { "api_name": "torch.utils", "line_number": 29, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 50, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 50, "usage_type": "name" }, { "api_name": "torch.utils", "line_num...
22702592699
import logging import random import traits from alleles import * logging.basicConfig(filename='debug.txt',level=logging.DEBUG, filemode='w') class Organism(dict): def __init__(self, alleles, traits, id): self.id = id self.alleles = alleles self.traits = traits for trait in traits: ...
Adrian-Grey/EvoProject
traitexample.py
traitexample.py
py
1,808
python
en
code
1
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 6, "usage_type": "attribute" }, { "api_name": "logging.debug", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.debug", ...
26040183296
from __future__ import annotations import dataclasses import logging from dataclasses import dataclass from typing import Any, Iterable from pants.backend.helm.dependency_inference import chart as chart_inference from pants.backend.helm.resolve import fetch from pants.backend.helm.resolve.artifacts import ResolvedHel...
pantsbuild/pants
src/python/pants/backend/helm/util_rules/chart.py
chart.py
py
10,507
python
en
code
2,896
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 54, "usage_type": "call" }, { "api_name": "pants.engine.target.Target", "line_number": 58, "usage_type": "name" }, { "api_name": "pants.backend.helm.target_types.HelmChartTarget.alias", "line_number": 59, "usage_type": "at...
13266626912
from django.shortcuts import render, HttpResponseRedirect from .forms import ShopUserLoginForm, ShopUserRegistrationForm, ShopUserEditForm from django.contrib import auth from django.urls import reverse def login(request): if request.method == 'POST': username = request.POST['username'] password =...
lulek4ever/SNV_project
bookshop/authapp/views.py
views.py
py
1,756
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.authenticate", "line_number": 11, "usage_type": "call" }, { "api_name": "django.contrib.auth", "line_number": 11, "usage_type": "name" }, { "api_name": "django.contrib.auth.login", "line_number": 13, "usage_type": "call" }, { "ap...
39465467650
from flask import render_template, request, render_template_string, flash, current_app, redirect from multiprocessing import Process import re import urlparse from ..app import db from . import dankblog from .models import Post @dankblog.before_app_first_request def init_flag(): if (db.session.query(Post).count() ...
Himanshukr000/CTF-DOCKERS
FreeLancerCTF/web/simpleior/content/app/dankblog/views.py
views.py
py
1,430
python
en
code
25
github-code
6
[ { "api_name": "app.db.session.query", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Post", "line_number": 11, "usage_type": "argument" }, { "api_name": "app.db.session", "line_number": 11, "usage_type": "attribute" }, { "api_name": "app.db", ...
37430060253
# -*- coding: utf-8 -*- """ Created on Fri Nov 3 11:07:00 2017 BP test @author: OneTree """ import numpy as np import NeuralNetwork as nn import matplotlib.pyplot as plt # ============================================================================= # # XOR problem # X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]]) ...
onetree1994/CI-Course--WangTian
20171103_BP_XOR_SIN.py
20171103_BP_XOR_SIN.py
py
1,127
python
en
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 32, "usage_type": "attribute" }, { "api_name": "numpy.sin", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "...
9020023484
import networkx as nx from liftoff import aligned_seg, liftoff_utils, new_feature import numpy as np def find_best_mapping(alignments, query_length, parent, feature_heirarchy, previous_feature_start, previous_feature_ref_start, previous_gene_seq, inter,lifted_features_list,...
agshumate/Liftoff
liftoff/find_best_mapping.py
find_best_mapping.py
py
19,036
python
en
code
360
github-code
6
[ { "api_name": "liftoff.liftoff_utils.merge_children_intervals", "line_number": 10, "usage_type": "call" }, { "api_name": "liftoff.liftoff_utils", "line_number": 10, "usage_type": "name" }, { "api_name": "networkx.DiGraph", "line_number": 29, "usage_type": "call" }, { ...
7456286085
#!/usr/bin/env python3 import os import re import argparse import subprocess DEPEND = { "basis.f": ["eval.f", ], "rhf.f": ["mtrx.f", "eval.f", "basis.f", ], "uhf.f": ["mtrx.f", "eval.f", "basis.f", ], "rohf.f": ["mtrx.f", "eval.f", "basis.f", "uhf.f", ], "ci.f": ["mtrx.f", "eval.f", "basis.f", "uga...
kyasci/qcref
src/_utest.py
_utest.py
py
1,825
python
en
code
0
github-code
6
[ { "api_name": "re.sub", "line_number": 31, "usage_type": "call" }, { "api_name": "subprocess.check_call", "line_number": 34, "usage_type": "call" }, { "api_name": "subprocess.CalledProcessError", "line_number": 35, "usage_type": "attribute" }, { "api_name": "subpr...
22459973531
import pandas as pd from tqdm import tqdm import json import config from tweet_parser.tweet import Tweet from tweet_parser.tweet_parser_errors import NotATweetError from os import path import glob import gzip def create_tweet_df(): """ Creates a pandas dataframe representing all of the coronavirus tweets stor...
kyranstar/chrp-twitter-analysis
build_tweet_df.py
build_tweet_df.py
py
2,750
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "call" }, { "api_name": "config.DATA_FOLDERS", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", ...
5775197489
from zypr.fpga import Build as FPGA from zypr.utils import logging import sys from pathlib import Path import pytest logger = logging.init_logger( __name__, verbose=True, testing_mode=True) f = FPGA(json="demo/test.json", logger=logger, force=True) f.protocol_dict = {'SIGNAL': {'CLOCK': [['clk']], 'INTERRUPT': [[...
accl-kaust/zypr
zypr/tests/unit/test_fpga.py
test_fpga.py
py
2,106
python
en
code
0
github-code
6
[ { "api_name": "zypr.utils.logging.init_logger", "line_number": 8, "usage_type": "call" }, { "api_name": "zypr.utils.logging", "line_number": 8, "usage_type": "name" }, { "api_name": "zypr.fpga.Build", "line_number": 10, "usage_type": "call" }, { "api_name": "pathl...
41963632921
import gevent import numpy from PyMata.pymata import PyMata def main(): port = '/dev/ttyACM0' base = 0.3 gust = numpy.sin(numpy.linspace(0, 2 * 3.14, 100)) wind = base + (0.1) * gust print(wind) board = PyMata(port, verbose=True) GAUGE_PIN = 6 POTENTIOMETER_ANALOG_PIN = 0 board...
mastensg/windportal
firmware/gauge.py
gauge.py
py
1,067
python
en
code
2
github-code
6
[ { "api_name": "numpy.sin", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 10, "usage_type": "call" }, { "api_name": "PyMata.pymata.PyMata", "line_number": 14, "usage_type": "call" }, { "api_name": "gevent.sleep", "lin...
29579825180
# -*- coding: utf-8 -*- """ Created on Fri Dec 7 11:57:54 2018 @author: Akitaka """ # 1:ライブラリのインポート-------------------------------- import numpy as np #numpyという行列などを扱うライブラリを利用 import pandas as pd #pandasというデータ分析ライブラリを利用 import matplotlib.pyplot as plt #プロット用のライブラリを利用 from sklearn import cluster, preproces...
nakanishi-akitaka/python2018_backup
1207/ml9.py
ml9.py
py
1,893
python
ja
code
5
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 20, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 25, "usage_type": "call" }, { "api_name": ...
33063558215
from concurrent import futures import os import grpc import mensaje_pb2 import mensaje_pb2_grpc from google.protobuf.json_format import MessageToDict HOST = '[::]:50051' class ProductService(mensaje_pb2_grpc.ProductServiceServicer): def AddProduct(self, request, context): print(request) if str(requ...
Jpyepes/topicosTelematica
gRPC/server.py
server.py
py
1,060
python
es
code
0
github-code
6
[ { "api_name": "mensaje_pb2_grpc.ProductServiceServicer", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "me...
21371508136
from typing import Optional, List import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.loss import _Loss import numpy as np BINARY_MODE: str = "binary" MULTICLASS_MODE: str = "multiclass" MULTILABEL_MODE: str = "multilabel" def to_tensor(x, dtype=None) -> torch.Tensor: if isin...
PhysiologicAILab/SAM-CL
lib/loss/dice_loss.py
dice_loss.py
py
6,423
python
en
code
12
github-code
6
[ { "api_name": "torch.Tensor", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.from_numpy", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", ...
30163192096
import numpy as np from torch.utils import data from typing import Any # Data generator class data_generator(data.Dataset): def __init__(self, u, y, s): self.u, self.y, self.s = u, y, s self.len = self.u.shape[0] def __len__(self): return self.len def __getitem__(self, idx): ...
cmoyacal/DeepONet-Grid-UQ
src/utils/data_structures.py
data_structures.py
py
1,057
python
en
code
1
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.load", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.utils.d...
23762011609
#create a sqlite3 data base 1st using the command # sqlite3 test.db # and then run the code import sqlite3 conn = sqlite3.connect('/home/avishek/test.db') c = conn.cursor() def create_table(): c.execute('DROP TABLE IF EXISTS Data2 ') c.execute('CREATE TABLE Data2 (TX TEXT, RX TEXT, SNR TEXT)') def inser...
pursuitdan/integration
database_entry.py
database_entry.py
py
867
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" } ]
72002258428
from django.shortcuts import render from django.http import HttpResponse from django.http import Http404 from .models import Product # import the logging library import logging # Get an instance of a logger logger = logging.getLogger(__name__) # Create your views here. def StronaGlowna(request): try: if...
JakubNaskretski/test-ln-site
mainapp/views.py
views.py
py
2,040
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 22, "usage_type": "call" }, { "api_name": "dj...
45364855473
from airflow.hooks.postgres_hook import PostgresHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults import logging class DataQualityOperator(BaseOperator): """ DataQualityOperator for data quality check of data pipelines INPUT: - tables : List tabl...
pakpoom66/Udacity_DataPipelines_with_Airflow_Project
home/airflow/plugins/operators/data_quality.py
data_quality.py
py
1,699
python
en
code
0
github-code
6
[ { "api_name": "airflow.models.BaseOperator", "line_number": 6, "usage_type": "name" }, { "api_name": "airflow.utils.decorators.apply_defaults", "line_number": 21, "usage_type": "name" }, { "api_name": "airflow.hooks.postgres_hook.PostgresHook", "line_number": 36, "usage_t...
20346241537
#python script to comunicate with arduino and performs actions #pip3 install pyserial pynput ansicon import ctypes print("Hiding console window quickly") import serial import serial.tools.list_ports import os import time import sys import ansicon import threading from pystray import MenuItem as item,Menu ...
NCPlyn/ArDash
ArDash.py
ArDash.py
py
4,085
python
en
code
0
github-code
6
[ { "api_name": "ansicon.load", "line_number": 17, "usage_type": "call" }, { "api_name": "ctypes.windll.user32.ShowWindow", "line_number": 36, "usage_type": "call" }, { "api_name": "ctypes.windll", "line_number": 36, "usage_type": "attribute" }, { "api_name": "ctype...
34245530713
# Import module from tkinter import * import os from tkinter import * import tkinter as tk import cv2 import os import string from tkinter import filedialog from PIL import Image from PIL import Image, ImageTk def resize_image(event): window_width = event.width window_height = event.heigh...
Sukeerthi123/Image-Steganography
imagesteganography.py
imagesteganography.py
py
8,007
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.ANTIALIAS", "line_number": 19, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 19, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.ImageTk...
6385501933
import json def clear_avito_json(json_file, utf=True): with open('./data/avito.json', 'rb') as f: avito_json = json.load(f) avito_json_clear = [] avito_unic_urls = [] for t_p in avito_json: if t_p['title'] is not None: t_p_title = t_p['title'].strip() t_p_price ...
MindVersal/test_scrapy
tutorial/tutorial/avito_test_clear.py
avito_test_clear.py
py
1,123
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 28, "usage_type": "call" } ]
15867579774
# -*- coding: utf-8 -*- """ Created on Wed May 26 14:56:26 2021 @author: Zigron """ #import libraries import numpy as np import pandas import matplotlib.pyplot as plt from tabulate import tabulate from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from ...
junaid340/BTC_Price-Predictor
Training.py
Training.py
py
3,281
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "tabulate.tabulate", "line_number": 25, "usage_type": "call" }, { "api_name": "tabulate.tabulate", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
9058541597
"""Flask app for Cupcakes""" from flask import Flask, request, redirect, render_template, flash, jsonify from flask_debugtoolbar import DebugToolbarExtension import flask_sqlalchemy from models import db, connect_db, Cupcake from functions import serial_cupcake from form import AddCupcakeForm app = Flask(__name__) ap...
shawn0531-max/Springboard
Cupcakes/app.py
app.py
py
2,313
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_debugtoolbar.DebugToolbarExtension", "line_number": 15, "usage_type": "call" }, { "api_name": "models.connect_db", "line_number": 17, "usage_type": "call" }, { "api_name":...
35176830235
import os, time, sys from pathlib import Path os.system("cls" if os.name=="nt" else "clear") os.chdir(Path(__file__).parent) def check(noprint=None): if os.path.exists("users"): if not any(os.scandir("users")): os.system("python3 3login.py register") else: if not noprint =...
Jiusoft/PyLiteOS
2bootloader.py
2bootloader.py
py
896
python
en
code
0
github-code
6
[ { "api_name": "os.system", "line_number": 4, "usage_type": "call" }, { "api_name": "os.name", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number": 5, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 5, ...
23412413832
from django.db import models from django.db.models.signals import pre_save,post_save,post_delete from django.dispatch import receiver from django.contrib.auth.models import User, UserManager, Group as DjangoGroup import settings import datetime import ldap import logging import os from uuid import uuid4 from django.cor...
acm-uiuc/liquid
liquid/intranet/models.py
models.py
py
19,208
python
en
code
15
github-code
6
[ { "api_name": "django.contrib.auth.models.User", "line_number": 36, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 37, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 37, "usage_type": "name" }, { "api_n...
40686498933
import logging import time from typing import Any, List, NamedTuple import grpc import metrics_pb2 as metrics_proto from integ_tests.gateway.rpc import get_rpc_channel from orc8r.protos.common_pb2 import Void from orc8r.protos.service303_pb2 import ServiceInfo from orc8r.protos.service303_pb2_grpc import Service303Stu...
magma/magma
lte/gateway/python/integ_tests/common/service303_utils.py
service303_utils.py
py
11,365
python
en
code
1,605
github-code
6
[ { "api_name": "typing.NamedTuple", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 18, "usage_type": "name" }, { "api_name": "orc8r.protos.service303_pb2_...
38035592812
import requests from bs4 import BeautifulSoup import json url = "https://results.jntukucev.ac.in/helper.php?gamaOne=getResult" headers = { "accept": "*/*", "accept-language": "en-US,en;q=0.9,te;q=0.8", "content-type": "application/x-www-form-urlencoded; charset=UTF-8", "sec-ch-ua": "\"Google Chrome\";v=...
adityakaredla/JNTUGV-Results-Scraping
resultScraper.py
resultScraper.py
py
4,438
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 36, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 39, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 111, "usage_type": "call" } ]
36817367018
"""Loader call fixtures""" import re import typing as t from pathlib import Path import pytest from _pytest.fixtures import SubRequest from cjunct import exceptions # Get all sample files list SAMPLES_DIR: Path = Path(__file__).parent / "samples" SAMPLES: t.List[Path] = [item for item in SAMPLES_DIR.iterdir() if it...
reartnew/cjunct
tests/config/loaders/conftest.py
conftest.py
py
1,820
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Dict", "line_nu...
3677492450
#!/usr/bin/env python # -*- coding: utf-8 -*- #date: 13.02.12 import sys from collections import defaultdict import xlrd from pyautocad import Autocad, ACAD, APoint from pyautocad.utils import timing from pyautocad.contrib.tables import Table HEADER_TEXT_HEIGHT = 3.5 TEXT_HEIGHT = 3.0 ROW_HEIGHT = 8.0 TABLE_WIDTH =...
reclosedev/pyautocad
examples/cables_xls_to_autocad.py
cables_xls_to_autocad.py
py
7,317
python
en
code
436
github-code
6
[ { "api_name": "pyautocad.APoint", "line_number": 24, "usage_type": "call" }, { "api_name": "pyautocad.APoint", "line_number": 25, "usage_type": "call" }, { "api_name": "pyautocad.APoint", "line_number": 27, "usage_type": "call" }, { "api_name": "pyautocad.APoint",...
35182385130
import requests from PIL import Image from io import BytesIO import base64 import os SERV_URL = "http://localhost:5001/js/walker_run" HEADERS = { 'Content-Type': 'application/json', 'Authorization': f"token {os.environ('JASECI_TOKEN')}" } def summarize(text:str) -> str: '''Summarizes the text using text-t...
ssaravanan21/text_summary_to_image
utils.py
utils.py
py
956
python
en
code
1
github-code
6
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 33, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_num...
9673107020
# Package imports import numpy as np import matplotlib.pyplot as plt from testCases import * import sklearn import sklearn.datasets import sklearn.linear_model from planar_utils import plot_decision_boundary, sigmoid, load_planar_dataset, load_extra_datasets np.random.seed(1) X, Y = load_planar_dataset() plt.scatter(...
okarimpour/Deep_Learning_projects
Data_Classification_NN/data_classification.py
data_classification.py
py
5,478
python
en
code
1
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "planar_utils.load_planar_dataset", "line_number": 12, "usage_type": "call" }, { "api_name": "...
72306463227
import re from pyquery import PyQuery def housetype(housetype): detailInfo = {} housetype = housetype.replace('\xa0', '') housetype = housetype.replace('\n', '') housetype = housetype.replace(' ', '\n') htype = re.findall('型態:(.*)\n', housetype) state = re.findall('現況:(.*)\n', housetype) ...
YX-Zang/rent-house-crawler
get591.py
get591.py
py
2,481
python
en
code
0
github-code
6
[ { "api_name": "re.findall", "line_number": 11, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 12, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 13, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 29, ...
35488765326
"""Defines the functions used for gathering and reporting xp.""" from datetime import datetime import asyncio import json import logging import aiohttp import discord import numpy as np import matplotlib.pyplot as plt import pandas as pd from discord.ext import commands from utils.config import player_url from utils.he...
roscroft/math-bot
cogs/xp.py
xp.py
py
14,589
python
en
code
1
github-code
6
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 37, "usage_type": "call" }, { "api_name": "discord.ext.commands.Cog", "line_number": 46, "usage_type": "attribute" }, { "api_name": "discord.ext.comm...
7645917680
import pymongo # Define the list of Dow Jones stock symbols dow_symbols = [ "AAPL", "MSFT", "GOOGL", "AMZN", "META", "JPM", "V", "JNJ", "WMT", "PG", "UNH", "HD", "T", "PYPL", "VZ", "CSCO", "XOM", "CVX", "INTC", "KO", "MRK", "PEP", ...
quinncheong/goldman-sachs-portfolio-manager
backend/initScripts/trackedStocksSeed.py
trackedStocksSeed.py
py
992
python
en
code
1
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 43, "usage_type": "call" } ]
40378007155
import os import sys import json from sasctl.services import microanalytic_score as mas from sasctl import Session import base64 from io import BytesIO from PIL import Image import numpy as np import pdb def run_inference_for_base64(base64img): host = os.getenv('OPENMM_HOST', '') user = os.getenv('OPENMM_USER...
TreeinRandomForest/logo-detector
server/inference_api/logo_search/inference/inference.py
inference.py
py
5,204
python
en
code
0
github-code
6
[ { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, ...
11781972911
import glob import pandas as pd import logging import asyncio logging.basicConfig(level=logging.WARNING, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) all_files = glob.glob("/home/amit/projects/python-workspace/upwork-dataset/short_data/*.txt") li = [] async ...
mickymots/up_dataset
short_loader.py
short_loader.py
py
1,011
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "glob.glob", ...
24594501982
import pytest from tapeworm.model_link import Link from .conftest import telegram_callback_query_with_data @pytest.mark.parametrize("cq_data", [(None), ("qqq")]) def test_invalid_links_query_format( cq_data, incoming, telegram_callback_query_generator ): data = telegram_callback_query_generator() data["d...
bananers/tapeworm-bot
tests/test_links_callback_query.py
test_links_callback_query.py
py
1,832
python
en
code
0
github-code
6
[ { "api_name": "pytest.mark.parametrize", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 7, "usage_type": "attribute" }, { "api_name": "conftest.telegram_callback_query_with_data", "line_number": 20, "usage_type": "call" }, { ...
16621578810
""" tenants.py Methods to interact with Agave tenants. """ from __future__ import print_function import requests import sys from ..utils import handle_bad_response_status_code def get_tenants(url): """ Get Agave tenants Get all Agave tenants for a given Agave host. PARAMETERS ---------- url...
tapis-project/tapispy
tapispy/tenants/tenants.py
tenants.py
py
1,725
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 33, "usage_type": "call" }, { "api_name": "utils.handle_bad_response_statu...
38462998793
from fastapi import FastAPI from fastapi.responses import JSONResponse from pydantic import BaseModel from fastapi.middleware.cors import CORSMiddleware from sage import getMessage, describeMessage, cutMessage, Status api = FastAPI() class Prompt(BaseModel): prompt: str api.add_middleware( CORSMiddleware, ...
legit-programmer/squeeze-ai
server/server.py
server.py
py
1,305
python
en
code
1
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 7, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 10, "usage_type": "name" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 15, "usage_type": "argument" }, { "api_...
73815029306
import logging from peewee import * from twitter.models import * from .config import pretty_json_string, DATABASE_FILE _db = SqliteDatabase(DATABASE_FILE) logger = logging.getLogger(__name__) def get(self, attr, default=None): if hasattr(self, attr): return getattr(self, attr) else: return ...
python-cli/twitter-cli
twitter_cli/models.py
models.py
py
6,739
python
en
code
66
github-code
6
[ { "api_name": "config.DATABASE_FILE", "line_number": 8, "usage_type": "argument" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "config.pretty_json_string", "line_number": 87, "usage_type": "call" }, { "api_name": "co...
20933756370
# Imports import argparse import random # Global Constants POSSIBLE_INTEGERS = ["-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] # Create the argument parser. parser = argparse.ArgumentParser(description="Reads in a number between.") # Add arguments to the parse...
zenofchaos/CS4341
Assignment 2/createTest.py
createTest.py
py
824
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 25, "usage_type": "call" } ]
13060478762
from pyspark import SparkConf, SparkContext import sys import json assert sys.version_info >= (3, 5) # make sure we have Python 3.5+ # add more functions as necessary def make_pairs(data): subreddit = data["subreddit"] score = data["score"] count = 1 yield (subreddit, (count, score)) def add_pairs(...
Janetsun63/Big-Data-Lab-1
A3/reddit_averages.py
reddit_averages.py
py
1,095
python
en
code
0
github-code
6
[ { "api_name": "sys.version_info", "line_number": 4, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 32, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 36, "usage_type": "attribute" }, { "api_name": "pyspark.SparkCon...
7438604652
import itertools from vesper.tests.test_case import TestCase from vesper.util.time_difference_formatter import TimeDifferenceFormatter class TimeDifferenceFormatterTests(TestCase): def test_get_min_time_increment(self): get_increment = TimeDifferenceFormatter.get_min_time_increment ...
HaroldMills/Vesper
vesper/util/tests/test_time_difference_formatter.py
test_time_difference_formatter.py
py
8,244
python
en
code
47
github-code
6
[ { "api_name": "vesper.tests.test_case.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "vesper.util.time_difference_formatter.TimeDifferenceFormatter.get_min_time_increment", "line_number": 12, "usage_type": "attribute" }, { "api_name": "vesper.util.time_differe...
30052514668
from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect from django.urls import reverse_lazy from django.views.generic import CreateView, UpdateView, DeleteView from pet_owners.utils import DataMixin from posts.models imp...
classytoast/four-paws-social-network
four_paws/comments/views.py
views.py
py
4,763
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 13, "usage_type": "name" }, { "api_name": "pet_owners.utils.DataMixin", "line_number": 13, "usage_type": "name" }, { "api_name": "django.views.generic.CreateView", "line_number": 13, "usage_type...
7090026383
import re import asyncio from hydrogram import filters from hydrogram.enums import MessageEntityType from hydrogram.errors import FloodWait, UserNotParticipant, BadRequest, ChatWriteForbidden from hydrogram.types import Message from datetime import datetime from whiterkang import WhiterX, Config from whi...
BubbalooTeam/WhiterRobot
whiterkang/plugins/afk.py
afk.py
py
3,104
python
en
code
0
github-code
6
[ { "api_name": "whiterkang.WhiterX", "line_number": 30, "usage_type": "name" }, { "api_name": "hydrogram.types.Message", "line_number": 30, "usage_type": "name" }, { "api_name": "whiterkang.helpers.find_user", "line_number": 31, "usage_type": "call" }, { "api_name"...
28468344076
import requests URL = "https://rapidapi.p.rapidapi.com/api/spelling/AutoComplete" HEADERS = { "x-rapidapi-host": "contextualwebsearch-websearch-v1.p.rapidapi.com", "x-rapidapi-key": "Your-X-RapidAPI-Key" } text = "tay" querystring = {"text": text} response = requests.get(URL, headers=HEADERS, params=querystr...
roikra/usearch-api
AutoSuggestAPITest.py
AutoSuggestAPITest.py
py
348
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" } ]
15751587087
from sklearn.decomposition import LatentDirichletAllocation from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.decomposition import NMF class TopicsModelingLDA(): n_topics = 3 nb_top_words = 3 tf_vectorizer = None tf = None lda = None ...
flabastie/news-analysis
project/processing/modeling.py
modeling.py
py
5,069
python
en
code
0
github-code
6
[ { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.decomposition.LatentDirichletAllocation", "line_number": 32, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer",...
22959576539
from flask_cache import Cache from flask_sqlalchemy import SQLAlchemy from injector import Module, singleton from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class AppModule(Module): def __init__(self, app): self.app = app """Configure the application.""" def co...
ecdeise/flask_ioc_lab
modules.py
modules.py
py
940
python
en
code
0
github-code
6
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 6, "usage_type": "call" }, { "api_name": "injector.Module", "line_number": 9, "usage_type": "name" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 19, "usage_type": "argument" }, ...
36341393044
# 'Dummy' 라는 도스게임이 있다. 이 게임에는 뱀이 나와서 기어다니는데, 사과를 먹으면 뱀 길이가 늘어난다. 뱀이 이리저리 기어다니다가 벽 또는 자기자신의 몸과 부딪히면 게임이 끝난다. # 게임은 NxN 정사각 보드위에서 진행되고, 몇몇 칸에는 사과가 놓여져 있다. 보드의 상하좌우 끝에 벽이 있다. 게임이 시작할때 뱀은 맨위 맨좌측에 위치하고 뱀의 길이는 1 이다. # 뱀은 처음에 오른쪽을 향한다. # 뱀은 매 초마다 이동을 하는데 다음과 같은 규칙을 따른다. # 먼저 뱀은 몸길이를 늘려 머리를 다음칸에 위치시킨다. # 만약 이동한 칸에 사과가 있다면...
jujinyoung/CodingTest
bakjjun_codingTest/3190.py
3190.py
py
2,314
python
ko
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 45, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 45, "usage_type": "attribute" }, { "api_name": "sys.stdin.readlin...
29284293707
# -*- coding: utf-8 -*- '''config file''' import os import pygame # FPS FPS = 100 # 屏幕大小 SCREENSIZE = (800, 700) # room desc rect room_desc_rec = (10,90,500,200) # room items rec room_items_rec = (10,300,500,100) # action buttons rec action_area_rec = (10,500,500,100) # command_line rec command_line_rec = (10,580,30...
Tubao/xkx
pkuxkx/py/cfg_gui.py
cfg_gui.py
py
4,903
python
en
code
2
github-code
6
[ { "api_name": "pygame.Rect", "line_number": 32, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 33, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 34, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": ...
70722470587
import sys from typing import List min_diff = sys.maxsize total = 0 def subset_diff(index: int, nums: List[int], subnum:int): global total, min_diff # 베이스 케이스 if index == len(nums): print(total, subnum) min_diff = min(min_diff, abs((total - subnum) - subnum)) return subset_diff(index + 1, nums, subnum +...
Jeongseup/TIL
programming/data_structure/SubsetDiff.py
SubsetDiff.py
py
481
python
en
code
1
github-code
6
[ { "api_name": "sys.maxsize", "line_number": 5, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 9, "usage_type": "name" } ]
74598068348
import nltk from nltk.corpus import wordnet import inflect import operator inflect = inflect.engine() class Aspect: def __init__(self, reviews): self.reviews = reviews self.aspect_dict = dict() def findMax(self,dic): maxSoFar = 0 word = "" for i in dic.keys(): ...
abdelmaaboud/sentiment_analysis_with_django
aspectExtractor.py
aspectExtractor.py
py
1,526
python
en
code
1
github-code
6
[ { "api_name": "inflect.engine", "line_number": 6, "usage_type": "call" }, { "api_name": "inflect.plural", "line_number": 38, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number": 52, "usage_type": "call" }, { "api_name": "nltk.pos_tag", "l...
18194962461
from rest_framework import serializers from rest_framework.fields import Field from contents.models import Answer, Blog, Review from contents.serializers import BlogSerializer, AnswerSerializer, ReviewSerializer from movies.models import Movie from movies.serializers import MovieSerializer from suggestions.models impo...
SivakumarSkr/Movieclub
suggestions/serializers.py
serializers.py
py
2,980
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.fields.Field", "line_number": 13, "usage_type": "name" }, { "api_name": "contents.models.Blog", "line_number": 21, "usage_type": "argument" }, { "api_name": "contents.serializers.BlogSerializer", "line_number": 22, "usage_type": "call" }, ...
37660523382
import bpy from bpy_extras.view3d_utils import ( region_2d_to_origin_3d, region_2d_to_vector_3d, region_2d_to_location_3d ) import mathutils def get_3d_for_2d(pos_2d, context): result = None, None scene = context.scene origin, direction = get_origin_and_direction(pos_2d, context) # Tr...
jayanam/jsculpt-tools
utils/fsc_view_utils.py
fsc_view_utils.py
py
1,986
python
en
code
166
github-code
6
[ { "api_name": "mathutils.Vector", "line_number": 36, "usage_type": "call" }, { "api_name": "bpy_extras.view3d_utils.region_2d_to_location_3d", "line_number": 46, "usage_type": "call" }, { "api_name": "bpy.app", "line_number": 49, "usage_type": "attribute" }, { "ap...
26627485736
# this is an extremely simple Satchmo standalone store. import logging import os, os.path LOCAL_DEV = True DEBUG = True TEMPLATE_DEBUG = DEBUG if LOCAL_DEV: INTERNAL_IPS = ('127.0.0.1',) DIRNAME = os.path.dirname(os.path.abspath(__file__)) SATCHMO_DIRNAME = DIRNAME gettext_noop = lambda s:s LANGUAGE_CODE...
dokterbob/satchmo
satchmo/projects/skeleton/local_settings.py
local_settings.py
py
1,509
python
en
code
30
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line...
6836832887
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Experimental crawler to grab data from websites. This project is for educational purposes only. Usage: crawlyn BASEURLS... [--output=<OUTFILE>] [--proxyhost=<PROXYHOST> --proxyport=<PROXYPORT> --proxytype=<PROXYTYPE>] [--tor] crawlyn -h | --help crawlyn -...
iamcryptoki/crawlyn
crawlyn/cli.py
cli.py
py
1,657
python
en
code
5
github-code
6
[ { "api_name": "docopt.docopt", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.warning", "line_number": 40, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 41, "usage_type": "call" }, { "api_name": "logging.warning", "line_nu...
13649793245
from dataclasses import dataclass from typing import List, Dict, Tuple, Optional # offsets & game_entities: Guidelines for Game-Specific Data # if shared by a majority of windows games (>= 10) # offsets.py: defined Optional for all offset objects, set to None when absent # game_entities: defined Optional for a...
Guy-L/parakit
offsets.py
offsets.py
py
62,005
python
en
code
4
github-code
6
[ { "api_name": "typing.Optional", "line_number": 36, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 29, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 45, "usage_type": "name" }, { "api_name": "dataclass...
40224378453
from .input_example import Entity, EntityType, InputExample, Relation, RelationType import os import json import logging import numpy as np from typing import Dict, List from .base_dataset import BaseDataset import torch from transformers import PreTrainedTokenizer, PreTrainedModel from arguments import DataTrainingArg...
ManHieu/EventCausalityIdentification
data_modules/datasets.py
datasets.py
py
5,454
python
en
code
7
github-code
6
[ { "api_name": "typing.Dict", "line_number": 12, "usage_type": "name" }, { "api_name": "base_dataset.BaseDataset", "line_number": 12, "usage_type": "name" }, { "api_name": "base_dataset.BaseDataset", "line_number": 15, "usage_type": "name" }, { "api_name": "argumen...
38705093416
# -*- coding: utf-8 -*- """Definition of the evento content type """ from zope.interface import implements, directlyProvides from DateTime.DateTime import * from Products.Archetypes import atapi from Products.ATContentTypes.content import folder from Products.ATContentTypes.content import schemata from Products.AT...
lflrocha/ebc.pauta
ebc/pauta/content/evento.py
evento.py
py
10,615
python
en
code
0
github-code
6
[ { "api_name": "Products.ATContentTypes.content.folder.ATFolderSchema.copy", "line_number": 27, "usage_type": "call" }, { "api_name": "Products.ATContentTypes.content.folder.ATFolderSchema", "line_number": 27, "usage_type": "attribute" }, { "api_name": "Products.ATContentTypes.con...
5309701060
#!/usr/bin/env python # coding: utf-8 # In[ ]: import os import sys import random import math import multiprocessing import h5py import json import numpy as np import tensorflow as tf import keras as K import keras.backend.tensorflow_backend as KTF from keras.models import Model from keras.callbacks import ModelChec...
lrscy/Unsupervised-Dual-Learning-Neural-Machine-Translation-Model
baseline/baseline.old.py
baseline.old.py
py
14,212
python
en
code
3
github-code
6
[ { "api_name": "keras.backend.clear_session", "line_number": 26, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 26, "usage_type": "attribute" }, { "api_name": "tensorflow.Session", "line_number": 27, "usage_type": "call" }, { "api_name": "ten...
13504242679
import csv import pandas as pd import numpy as np import matplotlib.pyplot as plt filelocation = "../../../data/example csv/annual-enterprise-survey-2020-financial-year-provisional-csv.csv" filelocation = "../../../data/html_files/College of Liberal Arts Schedule of Classes Fall 2018.csv" def read_csv(file = fileloca...
gebe678/CS_Honors_Project
src/code/test/example_scripts/csv_stuff.py
csv_stuff.py
py
1,729
python
en
code
1
github-code
6
[ { "api_name": "csv.reader", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
16100999205
from django import forms from django.core.files.uploadedfile import SimpleUploadedFile class VendeurConnect(forms.Form): """ Pour gérer la connection d'un vendeur à son compte """ identifiant = forms.CharField(max_length = 30, required = True) mot_de_passe = f...
kelly564/Elvis-codeur
forms.py
forms.py
py
4,946
python
en
code
0
github-code
6
[ { "api_name": "django.forms.Form", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 7, "usage_type": "call" }, { "api_name": "django.forms"...
32809848064
from itertools import product class Solution: def letterCombinations(self, digits: str) -> List[str]: dic = { 2:['a','b','c'], 3:['d','e','f'], 4:['g','h','i'], 5:['j','k','l'], 6:['m','n','o'], 7:['p','q','r','s'], 8:['t','u','v'], 9:['w','x','y','z'] } combi=[] ...
dongjun0128/Algorithm_Study
Python_Algorithm_Interview/그래프/2. 전화번호 문자 조합(itertools).py
2. 전화번호 문자 조합(itertools).py
py
557
python
en
code
2
github-code
6
[ { "api_name": "itertools.product", "line_number": 24, "usage_type": "call" } ]
31907116454
from manager import Manager from util import DataController import model as model from model import Security, Exchange, DataVendor, Quotation from database import db_session, db_engine, Base from datetime import datetime, timedelta, date from sqlalchemy import exc manager = Manager() dc = DataController() @manager....
FabianHeinemann/Stock_Analyzer
manage.py
manage.py
py
4,018
python
en
code
2
github-code
6
[ { "api_name": "manager.Manager", "line_number": 9, "usage_type": "call" }, { "api_name": "util.DataController", "line_number": 11, "usage_type": "call" }, { "api_name": "database.Base.metadata.drop_all", "line_number": 17, "usage_type": "call" }, { "api_name": "da...
71732541308
from abc import ABC, abstractmethod from dataclasses import dataclass from typing import Any, List, Type, Union from .defs import ILEException from .numerics import MinMax, VectorFloatConfig, VectorIntConfig INDENTATION = ' ' NEWLINE = '\n' def exceptions_to_text(exceptions: List[str]) -> str: return f'{(NEW...
NextCenturyCorporation/mcs-scene-generator
ideal_learning_env/validators.py
validators.py
py
10,505
python
en
code
3
github-code
6
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 25, ...
14894972613
from pprint import pprint from pyquery import PyQuery as pq import requests import json import datetime import collections import sys import os # Where to write to. OUTFILE = "resto/1.0/menu/{}/{}.json" OUTFILE_2_0 = "resto/2.0/menu/{}/{}/{}/{}.json" OVERVIEWFILE_2_0 = "resto/2.0/menu/{}/overview.json" LINK_FORMAT = ...
daveromana2/hydra
scraper/resto.py
resto.py
py
11,770
python
en
code
null
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 39, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 56, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 57, "usage_type": "call" }, { "api_name": "pyquery.PyQuery", ...
14598919345
import datetime from rest_framework.generics import CreateAPIView, ListAPIView, DestroyAPIView, UpdateAPIView from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from .models import (FavoriteDoctor, Review, Doctor, Banner, Specia...
Ahmedbadr22/medita_api
medita_clinic/views.py
views.py
py
7,074
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 32, "usage_type": "name" }, { "api_name": "models.Banner.objects.all", "line_number": 33, "usage_type": "call" }, { "api_name": "models.Banner.objects", "line_number": 33, "usage_type": "attribute" },...
30423836891
#!/usr/bin/env python3 import pandas as pd from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from sklearn import svm from sklearn.linear_model import Perceptron from sklearn.linear_model import LinearRegression def main(): filename = "data3.csv" headers = getheaders(fil...
jeffaustin32/SENG474
clean.py
clean.py
py
3,525
python
en
code
1
github-code
6
[ { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.linear_model.Perceptron", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", "line_number": 35, "usage_type": "call" }, { ...
35942778078
from PyQt5.QtCore import * from PyQt5.QtGui import QMouseEvent from PyQt5 import QtCore, QtGui from PyQt5.QtWidgets import * from PyQt5 import QtWidgets from Windows import AddingNewUser_ui from Windows.weightScreen import WeightScreen from Database.UserDatabase import * from Widgets.virtualKeyboardBox import VirtualF...
mikedinh1997/WaterDispenser
Windows/addingNewUser.py
addingNewUser.py
py
6,772
python
en
code
1
github-code
6
[ { "api_name": "Windows.AddingNewUser_ui.Ui_AddingNewUser", "line_number": 16, "usage_type": "attribute" }, { "api_name": "Windows.AddingNewUser_ui", "line_number": 16, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QApplication.instance", "line_number": 22, "usage...
8384341511
from __future__ import absolute_import from __future__ import print_function import os import sys from collections import defaultdict import optparse import math sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..')) from sumolib.output import parse # noqa from sumolib.miscutils import Statistics, geh # no...
ngctnnnn/DRL_Traffic-Signal-Control
sumo-rl/sumo/tools/output/edgeDataDiff.py
edgeDataDiff.py
py
3,424
python
en
code
17
github-code
6
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
33259538045
import numpy as np from keras import models, layers import matplotlib.pyplot as plt from src.utils import split_data def auto_encoder(data_pth = '../data/mode_padding.npz', outdir='../fig'): data = np.load(data_pth) x = data['x'] y = data['y'] x_train, y_train, x_test, y_test = split_data(x,y) # in ...
ruiyangsong/nlp
src/auto_encoder.py
auto_encoder.py
py
1,587
python
en
code
1
github-code
6
[ { "api_name": "numpy.load", "line_number": 6, "usage_type": "call" }, { "api_name": "src.utils.split_data", "line_number": 9, "usage_type": "call" }, { "api_name": "keras.layers.Input", "line_number": 12, "usage_type": "call" }, { "api_name": "keras.layers", "...
21842529764
# ../gungame/core/logger.py """Provides the GunGame logger instance.""" # ============================================================================= # >> IMPORTS # ============================================================================= # Source.Python from config.manager import ConfigManager from loggers imp...
GunGame-Dev-Team/GunGame-SP
addons/source-python/plugins/gungame/core/logger.py
logger.py
py
1,230
python
en
code
7
github-code
6
[ { "api_name": "translations.strings.LangStrings", "line_number": 17, "usage_type": "call" }, { "api_name": "config.manager.ConfigManager", "line_number": 21, "usage_type": "call" }, { "api_name": "loggers.LogManager", "line_number": 36, "usage_type": "call" } ]
11445504911
__author__ = 'xueyan' # coding:utf-8 import unittest import sys,os BASE_DIR=os.path.dirname(os.path.dirname(__file__)) sys.path.append(BASE_DIR) from Page.BaseLoginPage import BaseLogin from Page.homePage import HomePage from model import Model from Page.singleCoursePlanChargePage import singleCoursePlanChargePage fr...
liuhf1980/pythonAutoYes
TestCase/createCoursePlanCharge0001.py
createCoursePlanCharge0001.py
py
3,263
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number...
16406941020
import mysql.connector import csv import matplotlib.pyplot as plt import matplotlib from matplotlib import colors as mcolors import datetime colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS) # Sort colors by hue, saturation, value and name. by_hsv = sorted((tuple(mcolors.rgb_to_hsv(mcolors.to_rgba(color)[:3...
natashaarmbrust/github-sentiment
contributions.py
contributions.py
py
2,567
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.colors.BASE_COLORS", "line_number": 8, "usage_type": "attribute" }, { "api_name": "matplotlib.colors", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.colors.CSS4_COLORS", "line_number": 8, "usage_type": "attribute" }, { ...
72182395387
from configparser import ConfigParser def config(filename='weather_api_key.ini', section='openweather'): '''Get API key Params: ------- filename - str: .INI file with API key stored. section - str: section name. Retunr: ------- str: API key ''' # create a p...
felipedmnq/streaming-weather-kafka
kafka/config.py
config.py
py
622
python
en
code
3
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 16, "usage_type": "call" } ]
24168973572
import requests from bs4 import BeautifulSoup URL = "https://web.archive.org/web/20200518073855/https://www.empireonline.com/movies/features/best-movies-2/" # Write your code below this line 👇 """ Steps: 1) Read the website 2) Create soup object """ response = requests.get(URL) movie_page = response.text soup = Be...
Shd-Dan/Udemy_100_days_beatiful_soup_web_scaping
100_movies.py
100_movies.py
py
638
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" } ]
34469120872
import torch from object_detection.utils.classes import COCO_CLASSES def box_cxcywh_to_xyxy(x): x_c, y_c, w, h = x.unbind(1) b = [(x_c - 0.5 * w), (y_c - 0.5 * h), (x_c + 0.5 * w), (y_c + 0.5 * h)] return torch.stack(b, dim=1) def rescale_bboxes(out_bbox, size): img_w, img_h = size b = box_cxcyw...
lmyybh/object-detection
object_detection/object_detectors/DETR.py
DETR.py
py
1,283
python
en
code
0
github-code
6
[ { "api_name": "torch.stack", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.hub.load", "line...
11295688167
from datetime import datetime import copy filename = "input/day12input.txt" file = open(filename, "r") file = file.readlines() now = datetime.now() routes = {} for f in file: f = f.replace('\n', '').split('-') if f[0] not in routes: routes[f[0]] = [f[1]] else: routes[f[0]].append(f[1]) ...
mykreeve/advent-of-code-2021
day12.py
day12.py
py
1,765
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 37, "usage_type": "call" }, { "api_name": "datetime.datetime...
37864446828
"""powerpoint_pptx.py implements App and Presentation for Powerpoint using python-pptx, the pptx file manipulation package. """ import copy from enum import IntEnum from io import BytesIO import re from typing import Any, Callable, Optional, Tuple from pptx import Presentation as PptxPres from pptx.enum.shapes import...
juria90/service_ppt
powerpoint_pptx.py
powerpoint_pptx.py
py
15,595
python
en
code
0
github-code
6
[ { "api_name": "enum.IntEnum", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 30, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 30, "usage_type": "name" }, { "api_name": "re.escape", "line_nu...
71974067388
import os from tkinter import * import tkinter as tk import tkinter.font as font import requests import webbrowser import os from datetime import date import discord from dotenv import load_dotenv load_dotenv() ''' functions ''' async def startUI(message): #download function def dlAttach(status): ...
webealt/SarahMessanger
sarahMessenger.py
sarahMessenger.py
py
2,962
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_nu...
38631449292
import unittest from unittest.mock import patch, mock_open import requests_mock from requests.models import Response from parameterized import parameterized from utils import CensysTestCase from censys.base import CensysAPIBase from censys.api import CensysSearchAPI from censys.asm.api import CensysAsmAPI from censy...
VK9D/Censys
tests/test_api.py
test_api.py
py
5,313
python
en
code
0
github-code
6
[ { "api_name": "utils.CensysTestCase", "line_number": 22, "usage_type": "name" }, { "api_name": "censys.api.CensysSearchAPI", "line_number": 46, "usage_type": "call" }, { "api_name": "requests_mock.Mocker", "line_number": 38, "usage_type": "call" }, { "api_name": "...
21275771036
import logging import os import mindspore as ms from ...utils.download import DownLoad from .backbone import Backbone def load_pretrained( net: Backbone, ckpt_url: str, download_dir: str = "./cache/pretrained/" ) -> None: """Loading the pretrained backbone's weight from url. Args: net: network ...
mindspore-lab/mindpose
mindpose/models/backbones/utils.py
utils.py
py
1,396
python
en
code
15
github-code
6
[ { "api_name": "backbone.Backbone", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.isfile", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line...
39120577302
import numpy as np import pandas as pd import matplotlib.pyplot as plt import random import time from collections import deque from sklearn import preprocessing from keras.models import Sequential from keras.layers import Dense, Dropout, CuDNNLSTM, BatchNormalization from keras.callbacks import TensorBoard, ...
albertoferreirademelo/19-DNN-LSTM-SwedishStockMarket
Mano_ANN.py
Mano_ANN.py
py
5,689
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot",...
24034433286
# local imports import xmatters import config # python3 package imports import logging import json from logging.handlers import RotatingFileHandler # main process def main() -> object: groups = members_file.get_rows(["name", "supervisors", "observers"], {"name"}, True, ";") log.info("Executing upload for " ...
matthewhenry1/integrator_py
src/add_members.py
add_members.py
py
3,358
python
en
code
1
github-code
6
[ { "api_name": "config.add_members", "line_number": 51, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 64, "usage_type": "call" }, { "api_name": "config.add_members", "line_number": 64, "usage_type": "attribute" }, { "api_name": "l...
9864519345
import json as jsonlib import os import time import typing from concurrent import futures from concurrent.futures import ThreadPoolExecutor from typing import Any, Dict, List, Optional, Union import requests from requests.adapters import HTTPAdapter from urllib3 import Retry from bot.error import APIError...
nazerkerysbekovva1/Summarization-Bot
bot/client.py
client.py
py
8,172
python
kk
code
0
github-code
6
[ { "api_name": "typing.Optional", "line_number": 37, "usage_type": "name" }, { "api_name": "os.getenv", "line_number": 41, "usage_type": "call" }, { "api_name": "bot.response.COHERE_API_URL", "line_number": 42, "usage_type": "name" }, { "api_name": "bot.response.CO...
17286691960
# -*- coding: utf-8 -*- """ Created on Thu May 9 14:59:17 2019 @author: Mamzi """ import cv2 def callback(value): if value == 1: cv2.namedWindow("greyFrame") gray = cv2.imread("images/pic.jpg", 0) cv2.imshow("greyFrame", gray) cv2.waitKey(3000) cv2.destroyWindow("greyFr...
osoulim/Computer-Vision
Python/Week1/trackbar.py
trackbar.py
py
488
python
en
code
0
github-code
6
[ { "api_name": "cv2.namedWindow", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number"...
42551217694
from absl.testing import absltest from absl.testing import parameterized import chex from flax import optim from jax.example_libraries import optimizers import jax.numpy as jnp from optax._src import alias from optax._src import update STEPS = 50 LR = 1e-2 LR_SCHED = lambda _: LR # Trivial constant "schedule". c...
viethoang204/audioBook
venv/lib/python3.11/site-packages/optax/_src/equivalence_test.py
equivalence_test.py
py
5,185
python
en
code
0
github-code
6
[ { "api_name": "chex.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "jax.numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "jax.numpy", "line_number": 22, "usage_type": "name" }, { "api_name": "jax.numpy.array", "l...
40308309211
from django.core.urlresolvers import reverse from django.http import Http404, HttpResponse from django.shortcuts import redirect, get_object_or_404 from django.views.generic import DetailView, View from .models import Innovation class InnovationRedirect(View): def get(self, request): innovation = Innova...
kabroncelli/Nicolock
nicolock/innovation/views.py
views.py
py
1,128
python
en
code
0
github-code
6
[ { "api_name": "django.views.generic.View", "line_number": 9, "usage_type": "name" }, { "api_name": "models.Innovation.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Innovation.objects", "line_number": 12, "usage_type": "attribute" }, { ...
72784227067
# https://www.codewars.com/kata/57c7231c484cf9e6ac000090 from itertools import zip_longest def sum_arrays(arrays, shift): result = arrays[0] shiftcnt = 0 for arr in arrays[1:]: shiftcnt += 1 pad = [0,]*(shift*shiftcnt) result = [sum(values) for values in zip_longest(result, pad + a...
blzzua/codewars
7-kyu/adding_values_of_arrays_in_a_shifted_way.py
adding_values_of_arrays_in_a_shifted_way.py
py
356
python
en
code
0
github-code
6
[ { "api_name": "itertools.zip_longest", "line_number": 11, "usage_type": "call" } ]
39626848748
from setuptools import setup, find_packages from memoization.memoization import __version__ as memoization_version with open('README.md', 'r', encoding='utf8') as f: long_description = f.read() setup( name='memoization', version=memoization_version, description='A powerful caching library for Python, ...
Bobshpog/AeroVision
src/util/memoization/setup.py
setup.py
py
1,605
python
en
code
2
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "memoization.memoization.__version__", "line_number": 9, "usage_type": "name" }, { "api_name": "setuptools.find_packages", "line_number": 20, "usage_type": "call" } ]
19143378383
#!/usr/bin/env python # # test_colourbarbitmap.py - # # Author: Paul McCarthy <pauldmccarthy@gmail.com> # import os.path as op import itertools as it import numpy as np import matplotlib as mpl import matplotlib.colors as colors import matplotlib.image as mplimg import pytest import fsleyes_widgets.util...
pauldmccarthy/fsleyes-widgets
fsleyes_widgets/tests/test_colourbarbitmap.py
test_colourbarbitmap.py
py
12,966
python
en
code
1
github-code
6
[ { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
14895007583
from argparse import ArgumentParser from jinja2 import FileSystemLoader, Environment from bs4 import BeautifulSoup as bs import requests parser = ArgumentParser(description='Create hydra sports page') parser.add_argument('--file', dest='filename', required=True, ...
daveromana2/hydra
scripts/generate_sports.py
generate_sports.py
py
1,068
python
en
code
null
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" }, { "api_name": "jinja2.Environm...
72965737789
import itertools import json import logging import numpy as np import os from collections import OrderedDict import PIL.Image as Image import torch from pytorchpoints.config import kfg, configurable from pytorchpoints.utils.comm import all_gather, is_main_process, synchronize from pytorchpoints.utils.file_io import Pa...
ZhaofanQiu/SPE-Net
pytorchpoints/evaluation/cls_evaluation.py
cls_evaluation.py
py
4,334
python
en
code
10
github-code
6
[ { "api_name": "evaluator.DatasetEvaluator", "line_number": 22, "usage_type": "name" }, { "api_name": "pytorchpoints.config.configurable", "line_number": 23, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "ap...
19886603860
import attr import trio from pendulum import DateTime from structlog import get_logger from async_generator import asynccontextmanager from guardata import service_nursery from guardata.monitoring import TaskMonitoringInstrument __all__ = [ "timestamps_in_the_ballpark", "start_task", "trio_run", "open...
bitlogik/guardata
guardata/utils.py
utils.py
py
6,074
python
en
code
9
github-code
6
[ { "api_name": "structlog.get_logger", "line_number": 18, "usage_type": "call" }, { "api_name": "pendulum.DateTime", "line_number": 22, "usage_type": "name" }, { "api_name": "attr.ib", "line_number": 38, "usage_type": "call" }, { "api_name": "attr.ib", "line_nu...
15399503740
from typing import List, Tuple import pygame # type: ignore from queue import PriorityQueue import runner from runner import Spot INPUT = """Sabqponm abcryxxl accszExk acctuvwj abdefghi""" with open("./input.txt", "r") as file: al_maze, al_start, al_end = runner.part_one(file.read()) WIDTH = al_maze[0].__len__()...
SyedDevop/path_finder
main.py
main.py
py
4,715
python
en
code
0
github-code
6
[ { "api_name": "runner.part_one", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pygame.di...
23233714434
import time import os import pathlib from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.select import Select from selenium.webdriver.common.keys import Keys from selenium.webdriver.support....
Semutireng22/BlueMove
bluemove.py
bluemove.py
py
6,329
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 20, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.element_to_be_clickable", "line_number": 20, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.exp...