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
8638695980
import sqlite3 import csv def printAll(list): print(list.__class__.__name__) for i in list: print(i) def write_to_db(): """Записать даннные в БД""" # Подключаемся к БД # region connecting connection = sqlite3.connect('DataBase/DataBase.sqlite') cursor = connection.cursor() # ...
Aemulatio/GraduateWork
pythonScripts/dataRefactor.py
dataRefactor.py
py
12,887
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlite3.OperationalError", "line_number": 121, "usage_type": "attribute" }, { "api_name": "sqlite3.OperationalError", "line_number": 132, "usage_type": "attribute" }, { "api...
2428478594
import time import MetaTrader5 as mt5 from datetime import datetime import pandas as pd class Meta: def __init__(self,test,path): self.test=test self.path=path def onBar(self,timeframe,function_done): while True: function_done() time...
rezafakhriyan/Meta_connector_sigma
meta.py
meta.py
py
7,884
python
en
code
0
github-code
21
[ { "api_name": "time.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "MetaTrader5.initialize", "line_number": 23, "usage_type": "call" }, { "api_name": "MetaTrader5.last_error", "line_number": 24, "usage_type": "call" }, { "api_name": "MetaTrader5....
70592883892
""" This file borrows PointNet2 implementation: https://github.com/erikwijmans/Pointnet2_PyTorch """ import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from pointnet2_ops import pointnet2_utils from pointnet2_ops.pointnet2_modules import PointnetFPModule, Po...
daerduoCarey/o2oafford
exps/models/model_o2oafford.py
model_o2oafford.py
py
11,691
python
en
code
30
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "name" }, { "api_name": "pointnet2_ops.pointnet2_utils.three_nn", "line_number": 22, "usage_type": "call" }, { "api_name": "...
31368464217
""" @author '彼时思默' @time 2019/12/7 17:51 @describe: 定位图片 """ import os import pyautogui from loguru import logger from root import root from utils.adb import adb from utils.image_converter import byte2img class ImgLocate: PATH_FREE_REFUEL_810_1440 = os.path.join(root, 'res/810_1440/img/free_refuel.png') P...
bishisimo/game_helper
utils/img_locate.py
img_locate.py
py
1,070
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "root.root", "line_number": 18, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_numb...
12193122105
''' A Python program to adopt a pet and appending the details in a file. The entry can also be viewed by reading the file ''' import datetime # Defining main function def get_pet(pet): # If user input 1 then this condition executes if pet == 1: adopt = int(input("Press 1 for Pet Dog 2 for...
Sachin-crypto/Python-Beginner-Projects
adoption_pet.py
adoption_pet.py
py
1,854
python
en
code
1
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 22, "usage_type": "call" }, { "api_name": "da...
14412541662
from django.contrib.gis.db.models.functions import Distance from django.contrib.gis.geos import Point from django.http import JsonResponse from rest_framework.views import APIView from rest_framework.permissions import AllowAny from rest_framework.status import ( HTTP_400_BAD_REQUEST, HTTP_404_NOT_FOUND, H...
iam-hitesh/jumpq-backend
merchants/views.py
views.py
py
937
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.gis.geos.Point", "line_number": 24, "usage_type": "call" }, { "api_name": "rest_framework.views.APIView", "line_number": 27, "usage_type": "name" }, { "api_name": "rest_framework.permissions.AllowAny", "line_number": 28, "usage_type": "name" ...
31353314313
#Given: DNA string s of length at most 10 kbp, and protein string translated by s #Return: Index of genetic code variant (codon table) used for translation #NB List of genetic code variants along with indexes representing these codes found here: http://www.bioinformatics.org/JaMBW/2/3/TranslationTables.html from B...
agolikova/Rosalind-Bioinformatics-Solutions
Code/PTRA_Protein Translation.py
PTRA_Protein Translation.py
py
858
python
en
code
1
github-code
21
[ { "api_name": "Bio.Seq.Seq", "line_number": 17, "usage_type": "call" } ]
32661509643
import nltk from nltk.stem.lancaster import LancasterStemmer stemmer = LancasterStemmer() import pickle import numpy as np import json #open json: with open("intents.json") as file: data = json.load(file) #nlp operations: try: with open("data.pickle", "rb")as f: words, labels , tra...
SKukreti0107/MAVIS
mavis mk 2/nlp.py
nlp.py
py
1,619
python
en
code
1
github-code
21
[ { "api_name": "nltk.stem.lancaster.LancasterStemmer", "line_number": 3, "usage_type": "call" }, { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 18, "usage_type": "call" }, { "api_name": "nltk.word_t...
23926635794
from typer.testing import CliRunner from mayan_dig import remove_control_characters from mayan_dig.cli import app def test_main(): runner = CliRunner() result = runner.invoke(app, ["--help"]) for line in [ "Usage: cabinets [OPTIONS] [FULL_PATHS]...", "full_paths [FULL_PATHS]... Par...
andreoliwa/mayan-dig
tests/test_mayan_dig.py
test_mayan_dig.py
py
451
python
en
code
0
github-code
21
[ { "api_name": "typer.testing.CliRunner", "line_number": 8, "usage_type": "call" }, { "api_name": "mayan_dig.cli.app", "line_number": 9, "usage_type": "argument" }, { "api_name": "mayan_dig.remove_control_characters", "line_number": 15, "usage_type": "call" } ]
5663991768
from django.contrib.auth.views import LoginView, LogoutView from django.urls import path from .views import * from django.conf.urls.static import static from django.conf import settings app_name = 'furn' urlpatterns = [ path('', home, name="home"), path('signup/', signup, name='signup'), path('profile', p...
AbubakrDev/Django_furn_master
furn/urls.py
urls.py
py
759
python
en
code
8
github-code
21
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path",...
42983612701
import os import json from pprint import pprint import numpy as np PATH1 = "/Users/jaewooklee/pcc-web/web/test_data/rtt_fairness_test/rtt_fairness3/" PATH2 = "/Users/jaewooklee/pcc-web/web/test_data/rtt_fairness_test/rtt_fairness4/" def merge_files_in_path(path, name): wrapper = {} for scheme in os.listdir(pa...
leejwook96/PCC-Web
web/test_data/get_all_jain_index.py
get_all_jain_index.py
py
1,354
python
en
code
0
github-code
21
[ { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number":...
37650961998
import tkinter as tk from tkinter.constants import * from matplotlib import pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import time from plot import plotG from Frames import panels from PIL import Image, ImageTk class ProductPage(tk.Frame): def __init__(self, master=None, name=s...
Muddassar087/Recommender-system
productpage.py
productpage.py
py
7,396
python
en
code
3
github-code
21
[ { "api_name": "tkinter.Frame", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tkinter.TOP", "line_number": 30, "usage_type": "attribute" }, { "api_name": "tkinter.BOTH", "line_number": 30, "usage_type": "attribute" }, { "api_name": "PIL.Image.open"...
40795865296
import re import logging class Request: class Methods: CONNECT = "CONNECT" GET = "GET" POST = "POST" def __init__(self, raw: bytes): self.raw = raw self.raw_split = raw.split(b"\r\n") self.log = self.raw_split[0].decode() self.body = self.raw[len(self.l...
unniisme/Networking
HTTPProxy/ProxyHandler.py
ProxyHandler.py
py
3,062
python
en
code
0
github-code
21
[ { "api_name": "logging.info", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 73, "usage_type": "call" }, { "api_name": "logging.info", "line_numbe...
6143166930
from pathlib import Path from search_engine import SearchEngineInterface import subprocess import os import pandas as pd import numpy as np class Comet(SearchEngineInterface): # option to disable console output from external .exe _FNULL = open(os.devnull, 'w') _param_file = None _mgf_file = None ...
iMoCkz/AnalysisProteomicPublicDataset
comet.py
comet.py
py
6,493
python
en
code
1
github-code
21
[ { "api_name": "search_engine.SearchEngineInterface", "line_number": 9, "usage_type": "name" }, { "api_name": "os.devnull", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "subpr...
6261268602
# -*- coding:utf-8 -*- import os import cv2 import numpy as np for file in os.listdir("testImg"): filename = "testImg/"+file print(filename) img = cv2.imdecode(np.fromfile(filename, dtype=np.uint8), -1) img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) outfilename = "testImg02/"+file cv2.imencode('.jp...
411324590/Plate-Produce
Graylize.py
Graylize.py
py
352
python
en
code
6
github-code
21
[ { "api_name": "os.listdir", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imdecode", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": ...
20582527240
import torch import torch.nn.functional as F from copy import deepcopy from torch import nn from torch.optim import Adam # Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments # https://arxiv.org/abs/1706.02275 class Actor(nn.Module): def __init__(self, state_space, action_space): super(...
shinobu-x/reinforcement-learning
maddpg.py
maddpg.py
py
5,878
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
17115310922
#!/usr/bin/env python3 ############################################################################################### # Nagios check for listening ports # Verifies that the host (local or remote) is listening on the expected ports. # Can check for: # * No unexpected listening ports # * All expected ports ...
akomakom/nagios-plugins-misc
nagios_check_listening_ports.py
nagios_check_listening_ports.py
py
4,629
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 30, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 72, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 72, "usage_type": "name" } ]
72818125174
import cv2 as cv2 import numpy as np from sklearn.linear_model import ( LinearRegression, TheilSenRegressor, RANSACRegressor, HuberRegressor, ) from sklearn.metrics import mean_squared_error from sklearn.preprocessing import PolynomialFeatures from sklearn.pipeline import make_pipeline from scipy.optimi...
kaif0312/Lane-De
clickpoints.py
clickpoints.py
py
11,535
python
en
code
0
github-code
21
[ { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.linear_model.TheilSenRegressor", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.linear_model.RANSACRegressor", "line_number": 17, "u...
10953007814
#!/usr/bin/env python from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import sys import os from astropy.table import Table, Column, vstack import glob import warnings warnings.filterwarnings('ignore') from bootstrap import * from Beers import * from tbl_reader import * de...
vwetzell/DES_VelDisp
VelDisp/VelDisp.py
VelDisp.py
py
14,521
python
en
code
3
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 12, "usage_type": "call" }, { "api_name": "astropy.table.Table", "line_number": 30, "usage_type": "call" }, { "api_name": "astropy.table.Table", "line_number": 31, "usage_type": "call" }, { "api_name": "astro...
20606705135
import re import sys import copy import time import collections import getopt import supybot.conf as conf import supybot.log as log from xml.dom import minidom import supybot.world as world import supybot.utils as utils from supybot.commands import * from supybot.irclib import IrcMsgQueue import supybot.ircmsgs as ircm...
progval/Supybot-plugins
SupyML/plugin.py
plugin.py
py
14,488
python
en
code
107
github-code
21
[ { "api_name": "supybot.i18n.PluginInternationalization", "line_number": 22, "usage_type": "call" }, { "api_name": "supybot.i18n.internationalizeDocstring", "line_number": 27, "usage_type": "name" }, { "api_name": "supybot.callbacks.tokenize", "line_number": 63, "usage_typ...
6544969370
from django.db import models from django.conf import settings class Tag(models.Model): tag = models.CharField(max_length=100) class Article(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) title = models.CharField(max_length=100) content = models.TextField(...
cloudsoswift/Expandev
backend/dev_accounts/blogs/models.py
models.py
py
1,695
python
en
code
0
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 5, "usage_type": "call" }, { "api_name": "...
6655964327
# -*- coding:utf-8 -*- __author__ = 'wushuyi' from flask import Blueprint, render_template, url_for, flash, get_flashed_messages, request, session, redirect, jsonify from flask_security import Security, MongoEngineUserDatastore, login_required, current_user from .public import app, db, oauth from .model import Role, Us...
wushuyi/auth-service
auth/views.py
views.py
py
4,500
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 11, "usage_type": "call" }, { "api_name": "public.app.config", "line_number": 22, "usage_type": "attribute" }, { "api_name": "public.app", "line_number": 22, "usage_type": "name" }, { "api_name": "public.app", "l...
8081556631
import math import torch import torch.nn as nn import torch.nn.functional as F from pytorch_modules.backbones import resnet34, resnet50 from pytorch_modules.nn import ConvNormAct from pytorch_modules.utils import initialize_weights class UNet(nn.Module): def __init__(self, num_classes): super(UNet, self...
WoodsGao/pytorch_keypoint
models/unet.py
unet.py
py
1,920
python
en
code
2
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "pytorch_modules.backbones.resnet34", "line_number": 15, "usage_type": "call" }, { "api_name": "torc...
5716707783
def load_instructions(f_n): with open('advent2017/input_files/'+f_n) as f: instructions = [] for line in f: tokens = line.split() if len(tokens) == 3: instructions.append(tokens) else: instructions.append((tokens[0], tokens[1], None)) return instructions from collections import defaultdict, deq...
jansenk/advent-of-code
advent/2017/day18.py
day18.py
py
2,508
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 21, "usage_type": "call" } ]
28189231232
import json, os, uuid, sys import os, uuid, sys from azure.storage.filedatalake import DataLakeServiceClient from azure.core._match_conditions import MatchConditions from azure.storage.filedatalake._models import ContentSettings edfi_data = [ { "id": "e313650d5b074fe0a4beb8973043ed29", "studentUn...
xmarcosx/azure-sandbox
main.py
main.py
py
1,472
python
en
code
0
github-code
21
[ { "api_name": "azure.storage.filedatalake.DataLakeServiceClient", "line_number": 26, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 28, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 35, "usage_type": "call" }, { "api_name": ...
15048051303
from collections import OrderedDict import json from sigsci_site_manager.backup import backups from sigsci_site_manager.consts import (RULE_LISTS, CUSTOM_SIGNALS, REQUEST_RULES, SITE_RULES, ...
turnerlabs/sigsci_site_manager
sigsci_site_manager/merge.py
merge.py
py
15,013
python
en
code
11
github-code
21
[ { "api_name": "sigsci_site_manager.util.filter_data", "line_number": 72, "usage_type": "call" }, { "api_name": "sigsci_site_manager.util.filter_data", "line_number": 111, "usage_type": "call" }, { "api_name": "sigsci_site_manager.util.filter_data", "line_number": 132, "us...
38240397483
import asyncio, math import finviz from PyQt5.QtCore import Qt, QTimer, pyqtSlot import PyQt5.QtWidgets as qt # import PySide6.QtWidgets as qt import qdarktheme from ib_insync import IB, util from ib_insync.contract import * from datetime import datetime from finvizfinance.group.overview import Overview impo...
regholl/Stocks-Watchlist
watchlist.py
watchlist.py
py
14,311
python
en
code
null
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QTableWidget", "line_number": 15, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 15, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QTableWidget.__init__", "line_number": 21, "usage_type": "call" }, ...
40930585696
#================================= # Modules used byt the class #================================= import discord import time from sunbot.MetaSingleton import MetaSingleton class DiscordHandler(metaclass = MetaSingleton): """Singleton class that allows to centralize and handle request to discord API""" @staticmet...
SkyEyeWeather/SunBot
sunbot/apiHandler/discordHandler.py
discordHandler.py
py
1,206
python
en
code
1
github-code
21
[ { "api_name": "sunbot.MetaSingleton.MetaSingleton", "line_number": 10, "usage_type": "name" }, { "api_name": "discord.Webhook", "line_number": 14, "usage_type": "attribute" }, { "api_name": "discord.Embed", "line_number": 14, "usage_type": "attribute" }, { "api_na...
14116536754
from distutils.cmd import Command from logging import root from tkinter import * import tkinter from PIL import Image,ImageTk import datetime import psycopg2 import uuid from tkinter import messagebox from datetime import datetime import sub_req #import Customer_reg global vw class booking: def book(self):...
kasthuri28/Blithe
src/Booking.py
Booking.py
py
8,670
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.open", "line_number": 30, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 30, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 32, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "li...
1917122960
import fnmatch, os, re, requests from .tasks import sh, get, project, Elidable, Secret, TaskError def next_page(response): if "Link" in response.headers: links = requests.utils.parse_header_links(response.headers["Link"]) for link in links: if link['rel'] == 'next': retu...
datawire/forge
forge/github.py
github.py
py
2,829
python
en
code
414
github-code
21
[ { "api_name": "requests.utils.parse_header_links", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.utils", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tasks.Elidable", "line_number": 16, "usage_type": "call" }, { "api_name": "ta...
33353608903
import matplotlib.pyplot as plt import matplotlib import colorsys def plot(values, f = (lambda k,v: True)): i = 1 for p,v in values.items(): plt.subplot(1, len(values), i) __subplot(v, f) i += 1 plt.xlabel('Time') plt.ylabel('Value function') plt.title('Value function over ...
celiamercier/reinforcement-learning
matchsticks-vf/plot.py
plot.py
py
1,327
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.subplot", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 12, "usage_type": "call" }, { "api_name": "ma...
27205600533
# -*- coding: utf-8 -*- """ Script to initialize the Anuket database.""" import argparse import sys import transaction from alembic.command import stamp from alembic.util import CommandError as AlembicCommandError from sqlalchemy import engine_from_config from sqlalchemy.exc import IntegrityError as SqlAlchemyIntegrit...
lazaret/anuket
anuket/scripts/initializedb.py
initializedb.py
py
3,753
python
en
code
5
github-code
21
[ { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 35, "usage_type": "call" }, { "api_name": "pyramid.paster.get_appsettings", "line_number": 65, "usage_type": "call" }, { "api_name": "...
41073715392
# Third party imports from rest_framework.routers import DefaultRouter # Pepper imports from pepper.facebook.api import PSIDListViewSet, FacebookPageViewSet, MessengerLabelViewSet default_router = DefaultRouter(trailing_slash=False) # Register all the django rest framework viewsets below. default_router.register('ps...
GeekyShacklebolt/pepper
pepper/api_urls.py
api_urls.py
py
580
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 7, "usage_type": "call" }, { "api_name": "pepper.facebook.api.PSIDListViewSet", "line_number": 10, "usage_type": "argument" }, { "api_name": "pepper.facebook.api.FacebookPageViewSet", "line_number": 11, ...
23483614402
import unittest from unittest import mock from unittest.mock import patch, ANY from test_common_utils import LambdaContextLogStream class HelperTest(unittest.TestCase): def setUp(self): self.test_event = { 'StackId': 'testStackId', 'RequestId': 'testRequestId', 'Logica...
aws-solutions/cloud-migration-factory-on-aws
source/backend/lambda_unit_test/test_helper.py
test_helper.py
py
2,398
python
en
code
54
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "test_common_utils.LambdaContextLogStream", "line_number": 16, "usage_type": "call" }, { "api_name": "helper.send_response", "line_number": 23, "usage_type": "call" }, { ...
34875597453
from __future__ import unicode_literals import re from importlib import import_module from inspect import getmembers, isclass, isabstract from ..instance import Instance from ..exception import SDKException VSINSTANCE_TYPE = { 101: "vmware", 102: "hyperv", 301: "amazon_web_services", 401: "azure", ...
Commvault/cvpysdk
cvpysdk/instances/vsinstance.py
vsinstance.py
py
10,558
python
en
code
52
github-code
21
[ { "api_name": "instance.Instance", "line_number": 31, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 40, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 43, "usage_type": "call" }, { "api_name": "importlib.import_mod...
74097204214
import os import json import subprocess import conf import check_series import write_data as wd linux_src = conf.LINUX_SRC exec_new_tag = True list_jobs = '/home/user/src/python/jobs.txt' res_loc = conf.BUILD_DIR + '../results/' list_done = res_loc + 'done.json' def read_tags(fname): f = open(fname) _tags...
FYNQ/PIT
src/python/cron_pit.py
cron_pit.py
py
3,570
python
en
code
0
github-code
21
[ { "api_name": "conf.LINUX_SRC", "line_number": 8, "usage_type": "attribute" }, { "api_name": "conf.BUILD_DIR", "line_number": 13, "usage_type": "attribute" }, { "api_name": "subprocess.Popen", "line_number": 27, "usage_type": "call" }, { "api_name": "subprocess.PI...
42988441161
"""Custom FPl api client""" import sys import json import logging import async_timeout from .const import ( CONF_ACCOUNTS, CONF_TERRITORY, FPL_MAINREGION, LOGIN_RESULT_FAILURE, LOGIN_RESULT_OK, TIMEOUT, API_HOST, ) from .FplMainRegionApiClient import FplMainRegionApiClient from .FplNorth...
dotKrad/hass-fpl
custom_components/fpl/fplapi.py
fplapi.py
py
4,007
python
en
code
26
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "const.API_HOST", "line_number": 26, "usage_type": "name" }, { "api_name": "async_timeout.timeout", "line_number": 50, "usage_type": "call" }, { "api_name": "const.TIMEOUT"...
13447262061
import numpy as np import matplotlib.pyplot as plt from build import dth import networkx as nx #from morphopy.neurontree import NeuronTree as Nt #from morphopy.computation import file_manager as Fm def getDiGraph(G, pnow, oxresult, in_nodes): pos = nx.get_node_attributes(G, 'pos') DiG = nx.DiGraph() for e...
karol-lukanowski/symulacja-krwi
analysis.py
analysis.py
py
8,514
python
en
code
0
github-code
21
[ { "api_name": "networkx.get_node_attributes", "line_number": 10, "usage_type": "call" }, { "api_name": "networkx.DiGraph", "line_number": 11, "usage_type": "call" }, { "api_name": "build.dth", "line_number": 15, "usage_type": "name" }, { "api_name": "networkx.simp...
4439907355
import pyodbc #Python Open Database connector is used to connect to Microsoft SQL database import pandas as pd #Pandas is used for is class dataframe which is hugely useful for indexing large datasets import os #to check if certain files exist import numpy as np #on rare occassion for matrix operations manipulating the...
atomschulz/tesla_test
test_utils.py
test_utils.py
py
3,560
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
33896878613
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar import attr if TYPE_CHECKING: from ..models.brand_refinement import BrandRefinement from ..models.classification_refinement import ClassificationRefinement T = TypeVar("T", bound="Refinements") @attr.s(auto_attribs=True) class Refinements: ...
milyord/sp-api
sp/catalog_items_2022_04_01/models/refinements.py
refinements.py
py
2,820
python
en
code
1
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.List", "lin...
33461203600
import pygame import numpy as np import argparse from neumann_neighborhood import set_neumann_neighb, apply_rule_neumann from game_of_life import set_upgol, apply_rule_gol from chaos import set_upchaos, apply_rule_chaos from env import * def set_functions(args): if args.commands == "gol": return set_upgol,...
matteo-789/Game-of-life-and-neumann-neighborhood
main.py
main.py
py
2,154
python
en
code
1
github-code
21
[ { "api_name": "game_of_life.set_upgol", "line_number": 11, "usage_type": "name" }, { "api_name": "game_of_life.apply_rule_gol", "line_number": 11, "usage_type": "name" }, { "api_name": "neumann_neighborhood.set_neumann_neighb", "line_number": 13, "usage_type": "name" },...
39921133781
# MoorPy Example Script: # Example of manually setting up a mooring system in MoorPy and solving equilibrium. import numpy as np import matplotlib.pyplot as plt import moorpy as mp # ----- set up the mooring system and floating body ----- # Create new MoorPy System and set its depth ms = mp.System(file='sample.txt...
NREL/MoorPy
examples/imported_system.py
imported_system.py
py
1,519
python
en
code
23
github-code
21
[ { "api_name": "moorpy.System", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "l...
43465881286
from django.urls import path from Users import views urlpatterns = [ path('register/6/', views.follow_university_societies, name='update_uni_following'), path('toggle_On/', views.toggle_On, name='toggle_uni_soc_following'), path('toggle_Off/', views.toggle_Off, name='toggle_uni_soc_unfollowing'), path...
vajin1125/LUNA-master
Users/urls.py
urls.py
py
381
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "Users.views.follow_university_societies", "line_number": 6, "usage_type": "attribute" }, { "api_name": "Users.views", "line_number": 6, "usage_type": "name" }, { "api_name":...
41804424130
import random from telethon.errors.rpcbaseerrors import ForbiddenError from telethon.errors.rpcerrorlist import PollOptionInvalidError from telethon.tl.types import InputMediaPoll, Poll from Deepak import legend from ..core.managers import eor from . import Build_Poll, reply_id menu_category = "extra" @legend.leg...
OFFICIALHACKERERA/PLUGINSS
Deepak/plugins/poll.py
poll.py
py
2,972
python
en
code
2
github-code
21
[ { "api_name": "telethon.tl.types.InputMediaPoll", "line_number": 34, "usage_type": "call" }, { "api_name": "telethon.tl.types.Poll", "line_number": 35, "usage_type": "call" }, { "api_name": "random.getrandbits", "line_number": 36, "usage_type": "call" }, { "api_na...
18676616682
from django.shortcuts import render from django.http import HttpResponse from .models import Product, Review from carts.models import Cart from django.db.models import Q from wishlist.models import Wishlist from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage def home(request): productmen = Pr...
Abhinav-n/AP_Project
django_project/ecom/views.py
views.py
py
5,012
python
en
code
0
github-code
21
[ { "api_name": "models.Product.objects.filter", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Product.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.Product", "line_number": 11, "usage_type": "name" }, { "api_name...
73581277173
import argparse import socket import xmlrpc.client as xmlrpclib import http.client as httplib class UnixSocketHTTPConnection(httplib.HTTPConnection): def connect(self): self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.sock.connect(self.host) class UnixSocketTransport(xmlrpclib....
mabuaisha/supervisord-on-action
parse.py
parse.py
py
1,546
python
en
code
0
github-code
21
[ { "api_name": "http.client.HTTPConnection", "line_number": 7, "usage_type": "attribute" }, { "api_name": "http.client", "line_number": 7, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 9, "usage_type": "call" }, { "api_name": "socket.AF_UNIX...
37856671586
from typing import Any, List, Optional, Dict import uuid from xrpl.asyncio.clients import AsyncWebsocketClient from xrpl.models import Subscribe, StreamParameter from ..models import ( WatchOrdersParams, MarketSymbol, Offer, OrderId, Trade, Order, OrderStatus, ) from ..utils import parse_t...
AktaryTech/xrpl-dex-sdk-python
xrpl_dex_sdk/methods/watch_orders.py
watch_orders.py
py
4,371
python
en
code
1
github-code
21
[ { "api_name": "typing.Optional", "line_number": 21, "usage_type": "name" }, { "api_name": "models.MarketSymbol", "line_number": 21, "usage_type": "name" }, { "api_name": "models.WatchOrdersParams", "line_number": 22, "usage_type": "name" }, { "api_name": "xrpl.asy...
15054736120
# -*- coding: utf-8 -*- import scrapy from vacancy_parse.items import VacancyParseItem class HhParseSpider(scrapy.Spider): name = 'hh_parse' allowed_domains = ['hh.ru'] start_urls = ['https://hh.ru/search/vacancy?&text=Python'] def parse(self, response): pagination = response.xpath('//a[cont...
AlexandraFil/Geekbrains_2.0
data_mining/lesson_5/vacancy_parse/spiders/hh_parse.py
hh_parse.py
py
2,152
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "vacancy_parse.items.VacancyParseItem", "line_number": 55, "usage_type": "call" } ]
44910731391
#!/usr/bin/env python3 import argparse import random import os import numpy as np from PIL import Image from plots import * from util import * if __name__ == '__main__': os.environ["CUDA_VISIBLE_DEVICES"] = "-1" parser = argparse.ArgumentParser(description='script for generating plots of the autoenocder res...
taDachs/Overview-of-Variational-Autoencoder-based-Generative-Models
code/generate_plots.py
generate_plots.py
py
3,808
python
en
code
12
github-code
21
[ { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 35, "usage_type": "call" }, { "api_name": "random.shuffle", ...
23505441065
import cv2 as cv import numpy as np cap = cv.VideoCapture(0) while(1): # Take each frame _, frame = cap.read() # Convert BGR to HSV hsv = cv.cvtColor(frame, cv.COLOR_BGR2HSV) # define range of BGR color in HSV lower_blue = np.array([110,50,50]) upper_blue = np.array([130,255,255]) ...
BioXtech/OpenCV-tests
object_tracking.py
object_tracking.py
py
1,280
python
en
code
0
github-code
21
[ { "api_name": "cv2.VideoCapture", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.array", "...
976712497
# -*- coding: utf-8 -*- """ Created on Sun Jun 19 15:33:02 2022 @author: jouanel romain """ import pandas as pd from sklearn.metrics.pairwise import sigmoid_kernel from sklearn.feature_extraction.text import TfidfVectorizer import pymongo def cleanDf(df,userid,db): #------------------ recuperer les i...
JouanelR/yu-meal
scratch_complete.py
scratch_complete.py
py
3,984
python
en
code
1
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 54, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 72, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 92, "usage_type": "call" }, { "api...
2985047663
import os import re import pickle import scipy.misc import numpy as np import matplotlib.cm as cm def get_indicators(pickle_path): indicator_list = [] for i in os.listdir(pickle_path): i = i.split("_") ind_dir = "_".join([i[1], i[2]]) indicator_list.append(ind_dir) return set(indi...
violaciao/Vision-Mask-and-Attend
deep-visual-masking/data_process/data_struct_brain.py
data_struct_brain.py
py
2,533
python
en
code
3
github-code
21
[ { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number"...
37122656750
import sys import time from datetime import datetime from turtle import * class time_zone_clock (): def set_default_time(self): obj_turtle = Turtle() current_time = "" detail_time = str(datetime.now()) current_time = detail_time[11:19] hours,min,sec = int(current_...
Pk8753/clock
Clock/development/base_clock.py
base_clock.py
py
1,041
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" } ]
6176638
from Reference_Files.mouse_and_keyboard_helper_functions import mouse_relative_position_from_center_normalized, on_press import sys sys.path.append('/home/srburnett/Stack-Inspectors') from Drone_Realistic_Physics_Class import Drone_Realistic_Physics_Class import math import time # The code to get the drone connected....
ScottyB55/StackInspectors
src/Reference_Files/Instance_Drone_Realistic_Physics.py
Instance_Drone_Realistic_Physics.py
py
1,535
python
en
code
1
github-code
21
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "Drone_Realistic_Physics_Class.Drone_Realistic_Physics_Class", "line_number": 12, "usage_type": "call" }, ...
12482375031
import torch from typing import List from glotnet.model.feedforward.wavenet import WaveNet from glotnet.losses.distributions import Distribution, GaussianDensity, Identity import glotnet.cpp_extensions as ext import torch.nn.functional as F class GlotNetAR(WaveNet): """ Autoregressive GlotNet """ def __init_...
ljuvela/GlotNet
glotnet/model/autoregressive/glotnet.py
glotnet.py
py
12,343
python
en
code
2
github-code
21
[ { "api_name": "glotnet.model.feedforward.wavenet.WaveNet", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 19, "usage_type": "name" }, { "api_name": "glotnet.losses.distributions.Distribution", "line_number": 24, "usage_type": "name" ...
23682265352
import rclpy from rclpy.node import Node import math from scipy.spatial import distance from visualization_msgs.msg import Marker from visualization_msgs.msg import MarkerArray from nav_msgs.msg import OccupancyGrid from tuw_multi_robot_msgs.msg import Graph from exploration.msg import ExplorationState from rclpy.qos i...
chathushkadhr/LocalizationAlgorithm-SUTD
best_vertices/best_vertices/best_vertices_node.py
best_vertices_node.py
py
13,010
python
en
code
0
github-code
21
[ { "api_name": "rclpy.node.Node", "line_number": 13, "usage_type": "name" }, { "api_name": "visualization_msgs.msg.MarkerArray", "line_number": 53, "usage_type": "argument" }, { "api_name": "rclpy.qos.QoSProfile", "line_number": 53, "usage_type": "call" }, { "api_n...
45678123655
import sys import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["OPENBLAS_NUM_THREADS"] = "4" os.environ["MKL_NUM_THREADS"] = "4" os.environ["OMP_NUM_THREADS"] = "4" import subprocess from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from multiprocessing import Pool import torch from fu...
MattMcPartlon/AttnPacker
protein_learning/scripts/sidechain/standardize_scs.py
standardize_scs.py
py
9,102
python
en
code
50
github-code
21
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ", "line_n...
23947867962
import yaml import argparse import os parser = argparse.ArgumentParser(description='Sort images according to whether they can be used for calibration') parser.add_argument('--input', dest='input', help='Input file', default='sorted_files/meta.yaml') args = parser.parse_args() with open(os.path.join(args.input), 'w') a...
hrc2da/hiro
sort_images.py
sort_images.py
py
757
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "yaml.load", "line_...
36030175122
from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QApplication,QLabel,QHBoxLayout,QVBoxLayout) from PyQt5.QtCore import Qt from PyQt5.QtGui import QFont,QPixmap import sys def colloaction(id): #调用搭配系统 #返回结果['id1','id2',...'idn'] if id == '29': re = ['476354', '1315712','...
BERYLSHEEP/clothes-match-system
application.py
application.py
py
5,376
python
en
code
1
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 15, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 28, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLineEdit", "line_number": 30, "usage_type": "call" }, { "api_name...
35666492590
import datetime import logging import mimetypes import os from contextlib import suppress import requests from filelock import FileLock from .utils import PROCESSING_RESULT class Store: def __init__(self, configuration): self.config = configuration self.logger = logging.getLogger( "b...
henryk/belegmail
belegmail/store.py
store.py
py
4,928
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 48, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 48, "usage_type": "attribute" }, { "api_name": "mimetypes.gu...
40696499205
# -*- coding: utf-8 -*- import scrapy from ..items import * from ..SqliteOperator import * import time import sys import urllib conn = sqlite3.connect('sohuURL') table = 'sohuURL' fields = ('URL','Time') db_create_table(conn, table, fields, ('URL')) conn.text_factory=str kw = sys.argv[2] gQuery = None class YoukuSpid...
18708111002/Tools
sohuKeyWord/sohuKeyWord/spiders/crawlSohu.py
crawlSohu.py
py
1,869
python
en
code
1
github-code
21
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "scrapy.Spider", "line_number": 17, "usage_type": "attribute" }, { "api_name": "time.strftime", "line_number": 24, "usage_type": "call" }, { "api_name": "time.localtime", "...
13269033426
import sys import argparse import pandas as pd from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord def GetArgs(): def ParseArgs(parser): class Parser(argparse.ArgumentParser): def error(self, message): sys.stderr.write('error: %s\n' % message) ...
analytic-garden/B.1.1.7-Mutations
gisaid_reformat_fasta_headers.py
gisaid_reformat_fasta_headers.py
py
3,587
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.exi...
15958073001
import numpy as np import nltk.corpus as corpus from Utils import * from nltk.corpus import treebank # Condense a word (represented as an array of 0s and a single 1) to # a vector of minor size class Embedding: def __init__(self, word_to_index, index_to_word, size = 10, distance = 2): # Resulting vecto...
edgardanielgd/ME-Proyecto
src/Neural/Embedding.py
Embedding.py
py
9,170
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy.float16", "line_number": 58, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.float16", "line_...
39504676057
import requests import json BASE_URL = 'https://theaudiodb.com/api/v1/json/2/' URL_API_ALBUM = 'album.php?i={}' URL_API_ARTIST = 'search.php?s={}' URL_API_TRACK = 'track.php?m={}' # Função criada antes da modificação da API def get_artist_id(artist_name): """ Função que retorna o id do artista ao passar o no...
thalita-de-melo/UFRJ_Analitica_Tarefas
Tarefa_2_Programacao_P3/tarefa_2(GET-album-info).py
tarefa_2(GET-album-info).py
py
3,394
python
pt
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 58, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 80, "usage_type": "call" }, { "api_name": "json.dump", "line_number":...
21132946967
from fastapi import FastAPI, UploadFile from backend.ml_logic.model import load_trained_model, predict from backend.ml_logic.data import preprocess_new_image app = FastAPI() # preload the stadard model from local directory given by LOCAL_MODEL_PATH app.state.model = load_trained_model() # creates wrapper if app.stat...
lailadib/art_guessing
art_guessing/backend/api/fast_api.py
fast_api.py
py
1,288
python
en
code
1
github-code
21
[ { "api_name": "fastapi.FastAPI", "line_number": 5, "usage_type": "call" }, { "api_name": "backend.ml_logic.model.load_trained_model", "line_number": 8, "usage_type": "call" }, { "api_name": "fastapi.UploadFile", "line_number": 20, "usage_type": "name" }, { "api_na...
9811196957
import argparse import matplotlib.pyplot as plt import numpy as np import torch import yaml from omegaconf import OmegaConf from tqdm import tqdm from src.ddpm import DDPM from src.torch_utils import to_cpu if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--config", type=st...
yanivbenny/dual_diffusion
plot_losses.py
plot_losses.py
py
2,615
python
en
code
7
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 24, "usage_type": "call" }, { "api_name": "omegaconf.OmegaConf.register_new_resolver", "line_number": 25, "usage_type": "call" }, { "...
11884151313
# Load libraries import pickle import numpy as np import pandas as pd import Get_data from datetime import datetime import time import Snippets from ML_finance import CatBoost from Binance import Binance account = Binance.Binance_acc() from catboost import CatBoostClassifier import warnings warnings.filterwarnings...
berkutt/ML_Crypto
Main.py
Main.py
py
4,896
python
en
code
1
github-code
21
[ { "api_name": "Binance.Binance.Binance_acc", "line_number": 15, "usage_type": "call" }, { "api_name": "Binance.Binance", "line_number": 15, "usage_type": "name" }, { "api_name": "warnings.filterwarnings", "line_number": 19, "usage_type": "call" }, { "api_name": "p...
33555369746
import os import json class Directory(object): def __init__(self, name, parent = None): self.subDirs = [] self.files = {} self.name = name self.parent = parent self.fullPath = parent != None and f"{parent.fullPath}/{self.name}" or self.name def Subdirectory(self, dirName): if dirName in self.subDirs: ...
Jonax/AOC-2022
Day07.py
Day07.py
py
2,312
python
en
code
0
github-code
21
[ { "api_name": "json.dumps", "line_number": 40, "usage_type": "call" } ]
465572231
from selenium import webdriver import csv import time headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 YaBrowser/21.8.3.614 Yowser/2.5 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,imag...
Alexand00r/WebScraping_selenium
main.py
main.py
py
1,629
python
en
code
0
github-code
21
[ { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "seleniu...
8056491303
from datetime import datetime, timedelta import unittest import mock from mock import Mock, patch from htm.it.app.adapters.datasource.cloudwatch import aws_base class AwsBaseTest(unittest.TestCase): def testGetMetricDataWithDefaultStartEndAndHasSamples(self): class MyResourceAdapter(aws_base.AWSResourceAd...
bopopescu/numenta-apps-archived-htm.it-grokcli-htmitmobile
htm.it/tests/py/unit/app/adapters/datasource/cloudwatch/aws_base_test.py
aws_base_test.py
py
3,874
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "htm.it.app.adapters.datasource.cloudwatch.aws_base.AWSResourceAdapterBase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "htm.it.app.adapters.datasource.cloudwatch.a...
9797359773
from datetime import datetime if __name__ == "__main__": text = "2012-09-20" y = datetime.strptime(text, "%Y-%m-%d") z = datetime.now() diff = z - y print(diff) print(z) nice_z = datetime.strftime(z, "%A %B %d, %Y") print(nice_z)
tinylambda/keep
books/pc/ch3/ch3_15_2.py
ch3_15_2.py
py
265
python
en
code
1
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datet...
30974524560
import math import random import pygame import animation import mapobject import stuff from constants import * def vecadd(a, b): try: return (a[0] + b[0], a[1] + b[1]) except: return (a[0] + b, a[1] + b) def vecdel(a, b): return (a[0] - b[0], a[1] - b[1]) def vecmul(a, b): try: ...
MatMoore/hacks
pyweek-8/gamelib/units.py
units.py
py
15,580
python
en
code
0
github-code
21
[ { "api_name": "math.sqrt", "line_number": 28, "usage_type": "call" }, { "api_name": "mapobject.MapObject", "line_number": 53, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Group", "line_number": 63, "usage_type": "call" }, { "api_name": "pygame.sprite"...
29967310643
from flask import Flask from config import DefaultConfig app = Flask(__name__) # Load default configuration for the application (common across environments) app.config.from_object(DefaultConfig) # Load environment specific configuration # app.config.from_envvar('BACKENDAPI_CONFIGURATION', silent=False) app.config[...
gdsc-mitadt/blog-api
api/__init__.py
__init__.py
py
501
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "config.DefaultConfig", "line_number": 8, "usage_type": "argument" } ]
27118223953
import asyncio from contextlib import suppress import discord from discord.ext import commands class AutoPublishPlugin(commands.Cog): def __init__(self, bot): self.bot = bot self.db = bot.plugin_db.get_partition(self) @commands.Cog.listener() async def on_message(self, message): ...
sskewer/Modmail-Plugins
auto-publish/auto-publish.py
auto-publish.py
py
1,697
python
en
code
1
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 8, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 8, "usage_type": "name" }, { "api_name": "discord.Embed", "line_number": 17, "usage_type": "call" }, { "api_name": "discor...
31124742238
from os import path from setuptools import setup with open(path.join(path.abspath(path.dirname(__file__)), 'README'), encoding='utf-8') as f: long_description = f.read() with open(path.join(path.abspath(path.dirname(__file__)), 'VERSION'), encoding='utf-8') as f: version = f.read() setup(name="ml_logger", ...
young-geng/ml_logger
setup.py
setup.py
py
1,175
python
en
code
null
github-code
21
[ { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number"...
40373500234
import anndata as ad import pandas as pd import os import subprocess from tempfile import TemporaryDirectory def limma_fit( adata: ad.AnnData, design: str, output_path: str, exec_path: str, plot_output_path: str = None, verbose: bool = False, ): """ Fit a limma model to transcriptomi...
openproblems-bio/neurips-2023-scripts
limma_utils.py
limma_utils.py
py
5,135
python
en
code
9
github-code
21
[ { "api_name": "anndata.AnnData", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path", "line_number": 47, "usage_type": "attribute" }, { "api_name": "os.path.exists",...
6822034074
from nonebot import require from nonebot_plugin_apscheduler import scheduler from nonebot import on_command from nonebot.rule import to_me import requests from bs4 import BeautifulSoup from nonebot.params import * from nonebot.adapters.onebot.v11 import MessageSegment require("nonebot_plugin_apscheduler") tieba_news ...
seedoilz/my-qq-nonebot
my-bot/my-bot/plugins/garbage-finding/__init__.py
__init__.py
py
4,237
python
en
code
1
github-code
21
[ { "api_name": "nonebot.require", "line_number": 10, "usage_type": "call" }, { "api_name": "nonebot.on_command", "line_number": 12, "usage_type": "call" }, { "api_name": "nonebot.rule.to_me", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", ...
12857094722
from random import Random from typing import Iterable, Callable, Iterator, List class BucketGenerator: """ Performs bucketing of elements in a dataset by length. """ def __init__(self, element_length_function: Callable[..., int], batch_size: int, buf...
as-ideas/headliner
headliner/preprocessing/bucket_generator.py
bucket_generator.py
py
3,621
python
en
code
231
github-code
21
[ { "api_name": "typing.Callable", "line_number": 11, "usage_type": "name" }, { "api_name": "random.Random", "line_number": 36, "usage_type": "call" }, { "api_name": "typing.Iterable", "line_number": 38, "usage_type": "name" }, { "api_name": "typing.Iterator", "...
25363959370
import os import logging from torchvision import datasets from torchvision import transforms from .base_dataset import FilterDataset, split_dataset, CS20kDataset, CS80kDataset cifar_class = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'] def CreateDataset(opt...
kentjaren/DL
cnn_cs/data/data_loader.py
data_loader.py
py
2,185
python
en
code
0
github-code
21
[ { "api_name": "base_dataset.CS20kDataset", "line_number": 18, "usage_type": "call" }, { "api_name": "base_dataset.CS80kDataset", "line_number": 20, "usage_type": "call" }, { "api_name": "base_dataset.FilterDataset", "line_number": 22, "usage_type": "call" }, { "ap...
32999626596
from django.db.models import Count from django.forms.models import ModelChoiceIteratorValue from rest_framework import pagination from django_filters import ChoiceFilter, NumberFilter from django_filters.rest_framework import DjangoFilterBackend, FilterSet from django_filters.rest_framework.filters import BooleanFilt...
EQAR/eqar_db
api/uni_db/filters.py
filters.py
py
3,548
python
en
code
0
github-code
21
[ { "api_name": "django_filters.rest_framework.DjangoFilterBackend", "line_number": 12, "usage_type": "name" }, { "api_name": "django_filters.rest_framework.FilterSet", "line_number": 21, "usage_type": "argument" }, { "api_name": "django_filters.rest_framework.FilterSet", "line...
18327613307
"""Data creation.""" from dataclasses import dataclass, asdict from functools import partial from typing import Callable, Iterable, List, Optional, Tuple import json import logging import time import traceback from qiskit import Aer, QuantumCircuit from circuits import create_structure_circuit, create_sycamore_circu...
Gistbatch/tree-tensor-network-simulator
data/data.py
data.py
py
8,832
python
en
code
4
github-code
21
[ { "api_name": "dataclasses.dataclass", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 38, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 38, "usage_type": "name" }, { "api_name": "common.Circuit", ...
72529353973
import openai import os import json from dotenv import load_dotenv from datetime import datetime load_dotenv() openai.api_key = os.getenv("OPENAI_API_KEY") # response_list = openai.Model.list() # print(response_list) # messages = [] # 定义文件路径 filename = "history/default.json" history_global = [] # 如果文件存在,读取文件内容并将其反序...
zhaochuninhefei/playWithChatGPT
play-openai/talkWithSession.py
talkWithSession.py
py
8,172
python
en
code
4
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 7, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.exists", "l...
18815216071
import os from datetime import datetime from lib.database import load_db from lib.menus import create_submenu, advanced_submenu from lib.actions import (initialize_db, add_host, add_user, add_key, connect_to_host) def print_centered(text): term_width = os.get_terminal_size().columns t...
diegopeixoto/sshtool
main.py
main.py
py
2,306
python
en
code
0
github-code
21
[ { "api_name": "os.get_terminal_size", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "name" }, { "api_name": "lib.data...
74438440691
#!/usr/bin/env python ''' This script takes chunked sentence-per-line input from an unsupervised parsing program, clusters the output and creates a new dataset to chunk. This allows the chunking system to be extended to "full" parsing out-of-the-box. ''' import sys from os import listdir, sep from os.path import dir...
eponvert/upparse
scripts/cluster_up.py
cluster_up.py
py
8,947
python
en
code
22
github-code
21
[ { "api_name": "sys.stderr", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.stdin", "line_number": 36, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 89, "usage_type": "call" }, { "api_name": "collections.de...
16212407124
import matplotlib.pyplot as plt import numpy as np import os from numpy import linspace def task1(): fig, ax = plt.subplots() A = 1.34941 x = linspace(-10, 10, 100) y = -0.0001*(abs(np.sin(x)*np.sin(A)*np.exp(abs(100-(((x**2+A**2)**0.5)/np.pi))))+1)**0.1 ax.plot (x, y) plt.show() os.mkdir("results") f = o...
Vlad1312/task1
Task1 (1).py
Task1 (1).py
py
629
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sin",...
22680202866
from scrapy.loader import ItemLoader def lowercase_processor(self, values): for v in values: yield v.upper() def add_dollar(self, values): for v in values: yield v + '$' class MyItemLoader(ItemLoader): filename_in = lowercase_processor default_output_processor = add_dollar
wk1034832478/scrapy-demo
first/processors/filmprocessor.py
filmprocessor.py
py
307
python
en
code
0
github-code
21
[ { "api_name": "scrapy.loader.ItemLoader", "line_number": 10, "usage_type": "name" } ]
3707562831
from typing import List from collections import deque # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution1: def getAllElements(self, root1: TreeNode, root2: TreeNode) -...
dmp2016/LeetCode
All Elements in Two Binary Search Trees.py
All Elements in Two Binary Search Trees.py
py
1,410
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 31, "usage_type": "call" }, { "api_name": "typing.List", "line_num...
12901837485
# -*- coding: utf-8 -*- """ Created on Sat Mar 13 21:29:01 2021 @author: changai """ import numpy as np import pandas as pd import xlrd # load excel data def read_excel(filename='./excel_data.xlsx', sheet='Sheet1', min_col=1, max_col=5, min_row=1, max_row=9): row_of_tag = min_row-1 #value 0 means 1st raw in exc...
changzhiai/PlotPackage
build/lib/plotpackage/io.py
io.py
py
1,550
python
en
code
0
github-code
21
[ { "api_name": "xlrd.open_workbook", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", "lin...
4453564310
import time from PIL import Image, ImageDraw, ImageFont, ImageSequence import sys import os import cv2 import numpy as np ASCII_CHARS = ["@","#","S","%","?","*","+",";",":",",","."] def conversion (image,new_width=200): width, height=image.size ratio = height/width new_height = int(new_wid...
MerlinTheProgramist/VideoASCII_artConverter
ASCI_video_converter.py
ASCI_video_converter.py
py
2,584
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.new", "line_number": 26, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 26, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_...
17611782874
#/bin/python import collections from lasagne import layers, nonlinearities, init import theano import theano.tensor as T from theano.tensor.shared_randomstreams import RandomStreams __all__ = [ "build_network" ] def build_network(model_layers, output_shape, supervised=True): # name generator name_gen = NameGene...
p-koo/theanomics
theanomics/build_network.py
build_network.py
py
25,886
python
en
code
1
github-code
21
[ { "api_name": "collections.OrderedDict", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 19, "usage_type": "call" }, { "api_name": "lasagne.layers.InputLayer", "line_number": 33, "usage_type": "call" }, { "api_nam...
38726125496
import config #/// User configuration import log #/// Basic console logging import json #/// read/write JSON from libs import requests #/// HTML CRUD operations from libs import xmltodict #/// XML parsing #////////////////////////////////////////////////////////////////////...
marcodeltutto/UBWebPlotHandler
helpers.py
helpers.py
py
2,209
python
en
code
0
github-code
21
[ { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "config.BLESSED_PLOTS", "line_number": 12, "usage_type": "attribute" }, { "api_name": "config.DOCDB_URL", "line_number": 19, "usage_type": "attribute" }, { "api_name": "libs.reque...
18106207475
import requests from bs4 import BeautifulSoup url = "https://movie.naver.com/movie/bi/mi/basic.nhn" param_dic = {"code": 10016, "query": "나 홀로 집에"} response = requests.get(url, param_dic) try: html = response.text soup = BeautifulSoup(html, "html.parser") review_list = soup.find("div", class_= "score_r...
Heansum/pythonStudy2
chapter2/ex4.py
ex4.py
py
823
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" } ]
70471097333
#%% import numpy as np from sklearn.datasets import load_digits from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_split digits = load_digits() X = digits.data y = digits.target == 9 np.unique(y, return_counts = True) X_train, X_test, y_train, y_test = train_test_split( ...
jeewonkimm2/scikitlearn_review
Business_Analytics/ClassImbalance.py
ClassImbalance.py
py
4,191
python
en
code
0
github-code
21
[ { "api_name": "sklearn.datasets.load_digits", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 15, "usage_type": "call" }, { ...
19858096785
from sklearn.neighbors import KNeighborsClassifier from sklearn.neighbors import KNeighborsRegressor from sklearn.model_selection import train_test_split from kNN.kNNClassifier import kNNClassifier import numpy as np def run_model(data, targets, message, regression=False): if regression: classifiers = [KN...
Mando75/CS450
DataHandling/lib.py
lib.py
py
1,903
python
en
code
1
github-code
21
[ { "api_name": "sklearn.neighbors.KNeighborsRegressor", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 14, "usage_type": "call" }, { "api_name": "kNN.kNNClassifier.kNNClassifier", "line_number": 15, "usage_...
21513256569
# -*- coding: utf-8 -*- import copy import time import jpype from bourse import settings from bourse.tools.es_client import ESClient class CleanData(object): def __init__(self): # 采集ES数据库 self.es_client = ESClient(settings.ES_HOST_NAME, index_name=settings.ES_INDEX_NAME, ...
pythonyhd/bourse
bourse/tools/clean_data.py
clean_data.py
py
8,684
python
zh
code
13
github-code
21
[ { "api_name": "bourse.tools.es_client.ESClient", "line_number": 14, "usage_type": "call" }, { "api_name": "bourse.settings.ES_HOST_NAME", "line_number": 14, "usage_type": "attribute" }, { "api_name": "bourse.settings", "line_number": 14, "usage_type": "name" }, { ...
72166530612
''' Description: From Financial Wisdom Youtube channel "BITCOIN TRADING - Arguably The Best Bitcoin Trading strategy" Indicators: MACD: 26 period EMA, 12 period EMA, 9 period EMA (signal) Use daily MACD indicator using settings above. Rules: BUY: price above 200 ma & macd > signal SELL stop: If ...
mdulansk/Back-Testing-Momentum-Strategy
Strategies/Using backtesting.py/MACD_w_MA.py
MACD_w_MA.py
py
5,802
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 37, "usage_type": "call" }, { "api_name": "backtesting.Strategy", "line_number": 50, "usage_type": "name" }, { "api_name": "pandas_ta.sma", "line_number": 57, "usage_type": "attribute" }, { "api_name": "pandas.Series...
73035798773
import logging import time import os import json import numpy as np from universe import rewarder, spaces, vectorized from universe.utils import random_alphanumeric logger = logging.getLogger(__name__) extra_logger = logging.getLogger('universe.extra.'+__name__) class Recording(vectorized.Wrapper): """ Record al...
LiuFang816/SALSTM_py_data
python/openai_universe/universe-master/universe/wrappers/recording.py
recording.py
py
7,686
python
en
code
9
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "universe.vectorized.Wrapper", "line_number": 13, "usage_type": "attribute" }, { "api_name": "u...
3577735280
import requests import os import logging from datetime import datetime from pages.show_pages import ShowPage from send_push import push SHOW_URL = "https://www.howardstern.com/show/" CRED_DIR = os.path.expanduser("~") api_cred_file = "{0}/.howard_push_api.txt".format(CRED_DIR) SCRIPT_EXC_DIR = os.path.dirname(os.path...
craigsorensen/howard
app.py
app.py
py
2,718
python
en
code
0
github-code
21
[ { "api_name": "os.path.expanduser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_n...
70643728053
import nltk #nltk.download('stopwords') import sys import os import string import math FILE_MATCHES = 1 SENTENCE_MATCHES = 1 def main(): # Check command-line arguments if len(sys.argv) != 2: sys.exit("Usage: python questions.py corpus") # Calculate IDF values across files files = load_files...
Caetanoog18/Question---Project
questions.py
questions.py
py
6,195
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "nltk.sent_tokenize", "line_n...
33654477412
""" Usage: pip install -e . python setup.py install python setup.py bdist_wheel python setup.py sdist bdist_egg twine upload dist/* """ # NOTE: Requires cx_freeze==6.0.b1 for linux builds import sys import versioneer deps = [ "databroker", "PyQt5==5.9.2" "pathlib", "qtpy", ...
lbl-camera/Xi-cam
setup.py
setup.py
py
4,385
python
en
code
1
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 33, "usage_type": "call" }, { "api_name": "versioneer.get_version", "line_number": 38, "usage_type": "call" }, { "api_name": "versioneer.get_cmdclass", "line_number": 39, "usage_type": "call" }, { "api_name": "setup...