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
2618863218
import numpy as np import pandas as pd from sklearn.linear_model import LogisticRegression import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler df_train=pd.read_csv("/Users/ningduan/Python/MachineLearning/LogisticRegression/heart_train.csv") df_test=pd.read_csv("/Users/ningduan/Python/Machin...
nduan1/Machine-Learning
LogisticRegression.py
LogisticRegression.py
py
1,776
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 18, "usage_type": "call" }, { "api_name": "sk...
25675665599
import cv2 as cv import numpy as np from scipy import signal from PIL import Image def lineSegmentAStar(image): #showBinaryImage(image) #sys.exit() shape = np.shape(image) width = shape[1] proj = np.sum(image, 1) invproj = np.max(proj) - proj peaks = signal.find_peaks(invproj, prominence =...
nieknaber/HandWritingRecognition
src/segmentation/lineSegmentAStar.py
lineSegmentAStar.py
py
5,519
python
en
code
0
github-code
18
[ { "api_name": "numpy.shape", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.signal.find_peaks", "line_n...
29283485603
''' 使用headers和params 研究返回结果 ''' # 完整的url是下面url加上参数构成 url='https://www.baidu.com/s?' import requests kw={ 'wd':'王八蛋', } headers={ 'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36' } rsp=requests.get(url,params=kw,headers=headers) print(r...
zhouzhou0/python_zhou
爬虫/v22.py
v22.py
py
470
python
zh
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" } ]
10336290381
import pandas as pd import nltk from nltk.corpus import stopwords from sentence_transformers import SentenceTransformer from sklearn.metrics.pairwise import cosine_similarity import spacy import matplotlib.pyplot as plt import plotly.express as px df_pd = pd.read_excel('Datasets/PD-Projektdatenbank.xlsx') df_pd = df_...
tobyloby12/NLP_Bundesreden
visualisations.py
visualisations.py
py
1,630
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_excel", "line_number": 11, "usage_type": "call" }, { "api_name": "spacy.load", "line_number": 25, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 27, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.word...
3963249904
import numpy as np import math as math from scipy.optimize import curve_fit import matplotlib.pyplot as plt import matplotlib from matplotlib.lines import Line2D #-------> FUNCTIONS <------- def FSLE(timeseries,do= 0.7,num=70,r=1.1): GridGoals = np.zeros([num]) GridGoals[0] = do FSLE = np.zeros([...
reint-fischer/MAIOproject
Analysis.py
Analysis.py
py
8,418
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 29, ...
72655107559
from datetime import datetime from random import choice from sqlalchemy import and_, or_ from shorter.database import Model from shorter.start.environment import DELAY_DEF, SYM_MINI, SYM_POOL from shorter.start.extensions import DB from shorter.start.helper import parse_int from shorter.support import BlocklistValida...
spookey/shorter
shorter/models/short.py
short.py
py
3,730
python
en
code
1
github-code
18
[ { "api_name": "shorter.database.Model", "line_number": 15, "usage_type": "name" }, { "api_name": "shorter.start.extensions.DB.Column", "line_number": 16, "usage_type": "call" }, { "api_name": "shorter.start.extensions.DB", "line_number": 16, "usage_type": "name" }, { ...
74658845801
from rest_framework.test import APIClient from django.test import TransactionTestCase from ..models import UserProfile, Rlc from .fixtures import CreateFixtures from .statics import StaticTestMethods from rest_framework.authtoken.models import Token class UsersTests(TransactionTestCase): def setUp(self): ...
jehob/rlc_app
backend/api/tests/users_test.py
users_test.py
py
12,901
python
en
code
7
github-code
18
[ { "api_name": "django.test.TransactionTestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "statics.StaticTestMethods.force_authentication", "line_number": 11, "usage_type": "call" }, { "api_name": "statics.StaticTestMethods", "line_number": 11, "usage_type"...
28284893046
import datetime import logging import warnings from collections.abc import Iterator, Mapping from functools import partial from pathlib import Path from typing import Iterable, Optional, Union, Callable, Tuple from numbers import Number import bw_processing as bwp import matrix_utils as mu import numpy as np import pa...
brightway-lca/brightway2-calc
bw2calc/lca.py
lca.py
py
34,666
python
en
code
9
github-code
18
[ { "api_name": "bw2data.get_node", "line_number": 26, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "collections.abc.Iterator", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.Op...
9345512360
import hashlib from base64 import b64encode, b64decode import struct from routes import ( response_with_headers, obtain_user, ) class WebSocket: @classmethod def hand_shaken(cls, requests): GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' try: key = requests.headers.get('Sec-...
KomorebiL/web-server
websocket.py
websocket.py
py
2,842
python
en
code
0
github-code
18
[ { "api_name": "base64.b64encode", "line_number": 17, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 17, "usage_type": "call" }, { "api_name": "routes.response_with_headers", "line_number": 25, "usage_type": "call" }, { "api_name": "routes.obt...
11531325660
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.15.2 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- # # Visualize Cytomining Ecosystem Target ...
WayScience/software-landscape-analysis
notebooks/cytomining-ecosystem/visualize-target-projects-fall-2023.py
visualize-target-projects-fall-2023.py
py
25,152
python
en
code
0
github-code
18
[ { "api_name": "plotly.io.templates", "line_number": 54, "usage_type": "attribute" }, { "api_name": "plotly.io", "line_number": 54, "usage_type": "name" }, { "api_name": "pytz.timezone", "line_number": 57, "usage_type": "call" }, { "api_name": "datetime.datetime.no...
10083279832
#!/usr/bin/env python3 import whisper, os import numpy as np import sounddevice as sd from scipy.io.wavfile import write from chatgpt import Conversation # This is my attempt to make psuedo-live transcription of speech using Whisper. # Since my system can't use pyaudio, I'm using sounddevice instead. # Currently just ...
jerlendds/athena
livewhisper.py
livewhisper.py
py
5,303
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 35, "usage_type": "call" }, { "api_name": "whisper.load_model", "line_number": 38, "usage_type": "call" }, { "api_name": "chatgpt.Conversation", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.argmax", ...
9237220862
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('login', '0001_initial'), ] operations = [ migrations.AlterField( model_name='users', name='role', ...
xiaoxiangs/devops
pedevops/login/migrations/0002_auto_20160316_1059.py
0002_auto_20160316_1059.py
py
425
python
en
code
0
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
15817178825
import yaml from appium import webdriver from xueqiu_demo.page.base_page import BasePage from xueqiu_demo.page.main_page import MainPage class APP(BasePage): _app_package = 'com.xueqiu.android' _app_activity = '.common.MainActivity' def start(self): # 如果driver已经初始化,那么就直接用,不需要重新初始化 if sel...
echo9527git/haige_appium
xueqiu_demo/page/app.py
app.py
py
2,457
python
en
code
0
github-code
18
[ { "api_name": "xueqiu_demo.page.base_page.BasePage", "line_number": 8, "usage_type": "name" }, { "api_name": "appium.webdriver.Remote", "line_number": 28, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 28, "usage_type": "name" }, { "api_n...
15504993665
import logging import os import requests import libraries.testkit.settings from libraries.provision.ansible_runner import AnsibleRunner from utilities.cluster_config_utils import is_cbs_ssl_enabled, is_xattrs_enabled, no_conflicts_enabled, get_revs_limit from utilities.cluster_config_utils import get_sg_replicas, get...
couchbaselabs/mobile-testkit
libraries/testkit/sgaccel.py
sgaccel.py
py
5,800
python
en
code
14
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "libraries.testkit.settings.testkit", "line_number": 16, "usage_type": "attribute" }, { "api_name": "libraries.testkit.settings", "line_number": 16, "usage_type": "name" }, { ...
6949607276
from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import include, path # - {%- if cookiecutter.frontend_style == WEBAPP %} from django.views.generic.base import TemplateView from django.views.i18n import JavaScriptCatalog # - {% elif cookiecut...
thorgate/django-project-template
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/urls.py
urls.py
py
2,307
python
en
code
121
github-code
18
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 15, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 15, "usage_type": "name" }, { "api_name": "django.urls.path", "line_number": 19, "usage_type": "call" }, { "api_name"...
15836242853
from collections import defaultdict import re from typing import Tuple from operator import __ge__, __gt__, __eq__, __ne__, __lt__, __le__ COMPARISONS = { "==": __eq__, "!=": __ne__, "<": __lt__, "<=": __le__, ">": __gt__, ">=": __ge__, } def parse_data(puzzle_input: str) -> list[str]: re...
CptCookie/AOC
Python/Year2017/Day8/solution.py
solution.py
py
1,447
python
en
code
2
github-code
18
[ { "api_name": "operator.__eq__", "line_number": 7, "usage_type": "name" }, { "api_name": "operator.__ne__", "line_number": 8, "usage_type": "name" }, { "api_name": "operator.__lt__", "line_number": 9, "usage_type": "name" }, { "api_name": "operator.__le__", "l...
25096901413
from pathlib import Path import yaml #import ruamel.yaml import src.common.processing_vars as var def write_function_file(self, database_name_sans_env:str, schema_name:str, d:dict): base_path = 'snowflake/data/' + database_name_sans_env + '/' + schema_name + '/FUNCTIONS/' + database_name_sans_env + '__' + schema_na...
metaopslabs/snowflake_deployer
src/yaml_writer/functions/write_function_file.py
write_function_file.py
py
3,459
python
en
code
0
github-code
18
[ { "api_name": "src.common.processing_vars.EMPTY_LIST", "line_number": 30, "usage_type": "attribute" }, { "api_name": "src.common.processing_vars", "line_number": 30, "usage_type": "name" }, { "api_name": "src.common.processing_vars.EMPTY_STRING", "line_number": 31, "usage...
21525399275
# The basic Pygame game # From: https://www.pygame.org/docs/tut/tom_games2.html#makegames-2 import pygame from pygame.locals import * # This is optional class Ball(pygame.sprite.Sprite): """A ball that will move across the screen Returns: ball object Functions: update, calcnewpos Attributes: area, ...
Gonz8088/Repo_00
repo00/test01_pygame.py
test01_pygame.py
py
2,444
python
en
code
0
github-code
18
[ { "api_name": "pygame.sprite", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 14, "usage_type": "attribute" }, { "api_name": "py...
20982898808
import subprocess import json def run(cmd, token): print(cmd) cmd=cmd.replace('\n',' ') result = subprocess.run(["upsolver", "execute", "-t", token, "-c", cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, shell=True) if...
ajaychh/cdc_code_generator
cli_base.py
cli_base.py
py
1,068
python
en
code
0
github-code
18
[ { "api_name": "subprocess.run", "line_number": 7, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 8, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 34, "usage_type": "call" }, { "api_name": "json.decoder", "line...
3275433216
from _sha256 import sha256 from typing import List from common.serializers.json_serializer import JsonSerializer from plenum.common.event_bus import InternalBus, ExternalBus from plenum.common.messages.node_messages import ViewChange, ViewChangeAck, NewView from plenum.common.timer import TimerService from plenum.serv...
cakesoft-faisal/indy-plenum
plenum/server/consensus/view_change_service.py
view_change_service.py
py
3,403
python
en
code
null
github-code
18
[ { "api_name": "plenum.server.quorums.Quorums", "line_number": 16, "usage_type": "name" }, { "api_name": "plenum.common.messages.node_messages.ViewChange", "line_number": 23, "usage_type": "name" }, { "api_name": "plenum.common.messages.node_messages.ViewChangeAck", "line_numb...
9843627638
from barbados_stockex_scraper.files import FilesPipeline from scrapy.http import Request from cStringIO import StringIO from scrapy.utils.misc import md5sum import tempfile import subprocess from scrapy import log import re import calendar from dateutil import parser date_expr = re.compile( r'(?:%s) (?:\d{1}|\d{2...
chrisdev/barbados_stockex_scraper
barbados_stockex_scraper/pipelines.py
pipelines.py
py
3,424
python
en
code
1
github-code
18
[ { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "calendar.month_name", "line_number": 15, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "barbados_stockex_scrap...
17551779596
import jwt from jwt import ExpiredSignatureError, InvalidTokenError from datetime import datetime, timedelta # Module from src.modules.provider.config_provider import configProvider MINUTE = 60 class JwtProvider(): def __init__(self): jwtConfig = configProvider.jwtConfing self.SECRET_KEY = j...
MyRefrigerator/server
src/modules/provider/jwt_provider.py
jwt_provider.py
py
1,622
python
en
code
0
github-code
18
[ { "api_name": "src.modules.provider.config_provider.configProvider.jwtConfing", "line_number": 13, "usage_type": "attribute" }, { "api_name": "src.modules.provider.config_provider.configProvider", "line_number": 13, "usage_type": "name" }, { "api_name": "jwt.encode", "line_nu...
37299147534
from collections import Counter class Solution: def countVowelSubstrings(self, word: str) -> int: n = len(word) res = 0 def valid(c): return len(c) == 5 and ctr['a'] > 0 and ctr['e'] > 0 and ctr['i'] > 0 and ctr['o'] > 0 and ctr['u'] > 0 for i in range(n): ct...
theabbie/leetcode
count-vowel-substrings-of-a-string.py
count-vowel-substrings-of-a-string.py
py
480
python
en
code
11
github-code
18
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" } ]
327214563
import multiprocessing from itertools import repeat import random import math import baseconversion as bc def split_half(str): """ Split a string in half and return tuple. str - the string to split """ split_pairs = str[:len(str)//2], str[len(str)//2:] return split_pairs def left_shift(key,s...
ScrawnySquirrel/FeistelCipher
cryptography.py
cryptography.py
py
6,735
python
en
code
0
github-code
18
[ { "api_name": "math.floor", "line_number": 57, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 72, "usage_type": "call" }, { "api_name": "baseconversion.int_to_binary", "line_number": 84, "usage_type": "call" }, { "api_name": "baseconversion...
295147072
from argparse import ArgumentParser from netsnmp.walker import cbqosWalker from prometheus_client import start_http_server from sys import stderr, stdout import time import gevent import logging PROMETHEUS_CLIENT_PORT=9105 SNMP_WALK_INTERVAL=10 logging.basicConfig() logging.root.setLevel(logging.NOTSET) LOGGER = logg...
jonascrecencio/devops
netsnmp/run.py
run.py
py
1,543
python
en
code
0
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.root.setLevel", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.root", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.N...
13179991594
import numpy as np from ressim_env.ressim_enviroment import resSimEnv import gym def gitter(w): stencil = [-5,+5,-1,+1, 0] w = np.min ( [ np.max ( [ w + stencil[np.random.randint(5)] , 0 ] ) , 24 ] ) return w # test case for evaluating cumulative reward for each action env = resSimEnv(5) env = gym.m...
atishdixit16/DQN_benchmarking
test_env.py
test_env.py
py
1,888
python
en
code
0
github-code
18
[ { "api_name": "numpy.min", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line_number...
13687554245
import sys import pygame from bullet import Bullet from alien import Alien from time import sleep def check_play_button(ai_settings, screen, stats, play_button, ship, aliens, bullets, mouse_x, mouse_y): """ 在玩家单击 Play 按钮时开始新游戏 """ if play_button.rect.collidepoint(mouse_x, mouse_y) \ ...
yangmingsen/AlienInvasion
game_functions.py
game_functions.py
py
7,961
python
en
code
0
github-code
18
[ { "api_name": "pygame.mouse.set_visible", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.mouse", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.event.get", "line_number": 33, "usage_type": "call" }, { "api_name": "pygame.ev...
26123916443
from django.conf.urls import url from django.views.generic.base import RedirectView from . import views urlpatterns = [ url(r'^$', views.IndexPageView.as_view(), name='index-page'), url(r'^u/$', views.SinListView.as_view(), name='sin-list'), url(r'^m/$', views.SinsListMale.as_view(), name='male-sin-list'...
flyudvik/CheckOutYourSins
sins/urls.py
urls.py
py
644
python
en
code
0
github-code
18
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.c...
25106816848
import os import datetime import uuid import subprocess import logging from enum import Enum from peewee import SqliteDatabase, Model from peewee import CharField, IntegerField, DateTimeField from werkzeug.utils import secure_filename from uwsgidecorators import spool from .config import Config from .name import gener...
andremrsantos/wstr
src/wstr/db.py
db.py
py
4,267
python
en
code
0
github-code
18
[ { "api_name": "io.get_std_references", "line_number": 16, "usage_type": "call" }, { "api_name": "config.Config.RESOURCE", "line_number": 16, "usage_type": "attribute" }, { "api_name": "config.Config", "line_number": 16, "usage_type": "name" }, { "api_name": "peewe...
32634921565
import tweepy from nltk.sentiment.vader import SentimentIntensityAnalyzer import matplotlib.pyplot as plt consumer_key = 'CONSUMER KEY' consumer_secret = 'CONSUMER SECRET' access_token = 'ACCESS TOKEN' access_token_secret = 'ACCESS TOKEN SECRET' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_acce...
gonxaok/tweet-sentiment-analysis
tweet-sentiment-analysis.py
tweet-sentiment-analysis.py
py
1,067
python
es
code
0
github-code
18
[ { "api_name": "tweepy.OAuthHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 15, "usage_type": "call" }, { "api_name": "nltk.sentiment.vader.SentimentIntensityAnalyzer", "line_number": 24, "usage_type": "call" }, { "ap...
19140004019
import glob import pandas as pd from xml.dom import minidom def read_txt_file_of_truth(filepath): file = open(filepath, 'r') lines = file.readlines() file.close() rows = [] for line in lines: splitted = line.strip().split(":::") row = {'User_ID': splitted[0], 'Label': splitted[1]}...
karolbon/bot-or-human
preprocessing/read_data.py
read_data.py
py
1,991
python
en
code
0
github-code
18
[ { "api_name": "pandas.DataFrame", "line_number": 16, "usage_type": "call" }, { "api_name": "xml.dom.minidom.parse", "line_number": 21, "usage_type": "call" }, { "api_name": "xml.dom.minidom", "line_number": 21, "usage_type": "name" }, { "api_name": "glob.glob", ...
19925228564
""" A paint-style 2D toy dataset builder. The user clicks on the canvas to create groups of normally distributed points in one of the 3 available colors. The canvas can be cleared, or the last point undone. Dataset is scaled to zero mean and unit variance before saving. The dataset created can be saved to a .csv f...
Metriccat/draw_dataset
python/drawDataset.py
drawDataset.py
py
5,913
python
en
code
0
github-code
18
[ { "api_name": "numpy.random.normal", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 58, "usage_type": "call" }, { "api_name": "tkFileDialog.asksaveasfile", "line_number": 71, "usage_type": "call" }, { "api_name": "pa...
18353883723
# docs and experiment results can be found at https://docs.cleanrl.dev/rl-algorithms/dqn/#dqnpy import argparse import copy import os import random import time import sys import gym import math import numpy as np from stable_baselines3.common.buffers import ReplayBuffer import mindspore as ms from mindspore import ops...
superboySB/mindspore-cleanrl
cleanrl/mindspore/dqn.py
dqn.py
py
10,384
python
en
code
2
github-code
18
[ { "api_name": "sys.path.append", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 18, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", ...
72840815400
import asyncio, threading class ChatClient(asyncio.Protocol): def __init__(self): self.name = input("Type your username: ") #Windows doesn't have non-blocking stdin. Hacky workaround: put input into a separate thread. #Is there a better way? t = threading.Thread(target=self.input_ha...
lohmataja/asyncio
client.py
client.py
py
1,108
python
en
code
0
github-code
18
[ { "api_name": "asyncio.Protocol", "line_number": 3, "usage_type": "attribute" }, { "api_name": "threading.Thread", "line_number": 8, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 30, "usage_type": "call" }, { "api_name": "asyncio.g...
70911825320
import json import os import sys import shutil import textwrap import bpy from bpy.props import * from arm.lightmapper.panels import scene import arm.api import arm.assets as assets from arm.exporter import ArmoryExporter import arm.log as log import arm.logicnode.replacement import arm.make as make import arm.make_...
armory3d/armory
blender/arm/props_ui.py
props_ui.py
py
110,249
python
en
code
2,916
github-code
18
[ { "api_name": "arm.lightmapper.panels.is_reload", "line_number": 28, "usage_type": "call" }, { "api_name": "arm.lightmapper.panels", "line_number": 28, "usage_type": "name" }, { "api_name": "arm.lightmapper.panels.api", "line_number": 29, "usage_type": "attribute" }, ...
8691815370
# This module provides visualization tools import parameters import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D import numpy as np import os import pandas as pd def get_img_dir(): img_dir = ".\\IMG" if not os.path.exists(img_dir): os.makedirs(img_dir) ...
quasqade/nn-equation-solver
plot.py
plot.py
py
1,919
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_nu...
43994546945
#!/usr/bin/env python3 import bme280.i2c import psycopg2 import contextlib DB_PARAMS='' DB_SEARCH_PATH='bme280' @contextlib.contextmanager def connect(dbParams=DB_PARAMS, dbSearchPath=DB_SEARCH_PATH): class Connection: def __init__(self, connection): self._connection = connection @co...
nilscc/weather-logger
log-weather.py
log-weather.py
py
1,297
python
en
code
1
github-code
18
[ { "api_name": "contextlib.contextmanager", "line_number": 16, "usage_type": "attribute" }, { "api_name": "psycopg2.connect", "line_number": 22, "usage_type": "call" }, { "api_name": "contextlib.contextmanager", "line_number": 10, "usage_type": "attribute" }, { "ap...
11706705420
from collections import OrderedDict from rest_framework.response import Response from rest_framework.pagination import PageNumberPagination class ExtraLinksAwarePageNumberPagination(PageNumberPagination): def get_paginated_response(self, data, links=[]): return Response(OrderedDict([ ('count...
esaburruss/djangular-blog
backend/src/drf_hateoas/pagination.py
pagination.py
py
521
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.pagination.PageNumberPagination", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.response.Response", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 10, "usage_type":...
71474606760
from PIL import Image i = Image.open("./Images/ImageExemple.bmp") sortie = i.copy() for y in range(i.size[1]): #Colonne for x in range(i.size[0]): #Ligne c = i.getpixel((x,y)) gris = ((c[0]+c[1]+c[2])//3) sortie.putpixel((x,y),(gris,gris,gris)) sortie.save("./Images/Imageout2.bmp")
DorianLudm/Sae-Image
Scripts/B3.py
B3.py
py
311
python
en
code
0
github-code
18
[ { "api_name": "PIL.Image.open", "line_number": 3, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 3, "usage_type": "name" } ]
41818724135
import stack.commands from stack.exception import CommandError import shutil from collections import namedtuple from pytest import main from glob import glob import os class Command(stack.commands.Command, stack.commands.HostArgumentProcessor): """ <param type='boolean' name='exitonfail' optional='0'> Will exit o...
sukhbir148/stacki
common/src/stack/report-system/command/report/system/__init__.py
__init__.py
py
1,770
python
en
code
null
github-code
18
[ { "api_name": "stack.commands.commands", "line_number": 10, "usage_type": "attribute" }, { "api_name": "stack.commands", "line_number": 10, "usage_type": "name" }, { "api_name": "stack.commands.commands", "line_number": 11, "usage_type": "attribute" }, { "api_name...
14590619624
from DataStructures.HashMap import HashMap from DataStructures.queue import PriorityQueue from DataStructures.singly_linked_list import SingleLinkedList from interface_tools import InterfaceTools class HealthUtilityIndex: llist = SingleLinkedList() def __init__(self): self.health_index_sum ...
emmamanucharyan/DataStructures
__main.py
__main.py
py
12,714
python
en
code
0
github-code
18
[ { "api_name": "DataStructures.singly_linked_list.SingleLinkedList", "line_number": 8, "usage_type": "call" }, { "api_name": "json.load", "line_number": 32, "usage_type": "call" }, { "api_name": "json.load", "line_number": 35, "usage_type": "call" }, { "api_name": ...
32379177880
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html from scrapy.exporters import JsonLinesItemExporter class MatrixPipeline(object): def __init__(self): self.seen ...
scloudyy/PageRank
scrapy/pagerankspider/pipelines.py
pipelines.py
py
2,351
python
en
code
3
github-code
18
[ { "api_name": "scrapy.exporters.JsonLinesItemExporter", "line_number": 64, "usage_type": "call" } ]
15957360200
import zipfile from zipfile import ZipFile import os from conftest import RES_PATH, TMP_PATH def test_create_and_read_zip(file_manager): file_path = os.listdir(RES_PATH) file_name = 'new_arch.zip' with zipfile.ZipFile(os.path.join(TMP_PATH, file_name), mode='w', \ compression=zip...
Fanncola/home_work_6_7
tests/test_zip.py
test_zip.py
py
652
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "conftest.RES_PATH", "line_number": 8, "usage_type": "argument" }, { "api_name": "zipfile.ZipFile", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "li...
35009696681
#Author:****Metehan Serçe**** """ Bu komut dosyası, bir görüntüden noktaların toplanmasına izin verir. Girişler, x,y konumunda ve iki fare tıklanmasıdır Dikdörtgen seçildikten sonra kullanıcıdan türü girmesi istenir Tür isim olabalir string adress... Veya tür onay kutusu olabilir.. Kısaca herhangi birşey olabilir """...
mserce2/Ocr-Text-Okuma
BolgeSecici.py
BolgeSecici.py
py
1,501
python
tr
code
0
github-code
18
[ { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 27, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 41, "usage_type": "call" }, { "api_name": "cv2.resize", ...
8627637352
import sys import os import numpy as np import pandas as pd from numpy import interp from sklearn.metrics import multilabel_confusion_matrix from sklearn.metrics import roc_curve, auc, roc_auc_score from sklearn.metrics import precision_recall_curve, average_precision_score from sklearn.metrics import f1_score import s...
melissa-yeo/CT-haemorrhage-classification
scripts/metrics.py
metrics.py
py
18,981
python
en
code
1
github-code
18
[ { "api_name": "scipy.stats.beta.ppf", "line_number": 45, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 45, "usage_type": "attribute" }, { "api_name": "scipy.stats.beta.ppf", "line_number": 46, "usage_type": "call" }, { "api_name": "scipy.stat...
35549488311
# # ploggDatagather # # get data from ploggs via serial port and store in a database. # # Ross Wilkins #DB_STRING = "mysql://test_user:test_user@127.0.0.1/testStore" #DB_STRING = "sqlite:///test.db" DB_STRING = "mysql://chuser@localhost/localCh" import logging connected = False import serial, os import time from sc...
jbrusey/cogent-house
cogent/plogg/ploggDatagather.py
ploggDatagather.py
py
16,696
python
en
code
4
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 37, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 37, "usage_type": "attribute" }, { "api_name": "time.strftime", "line_number": 81, "usage_type": "call" }, { "api_name": "time.gmtime", ...
32356850958
import scrapy from ..items import CnascraperItem items = CnascraperItem() class CNASpider(scrapy.Spider): name = "cna_spider" def start_requests(self): for i in range(21): yield scrapy.Request( url = f"https://www.channelnewsasia.com/archives/8396078/news?pageNu...
BryanKongXJ/CNAScraper
Scraper.py
Scraper.py
py
1,579
python
en
code
0
github-code
18
[ { "api_name": "items.CnascraperItem", "line_number": 4, "usage_type": "call" }, { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 11, "usage_type": "call" } ]
27120749820
#!/usr/bin/env python import sys import boto3 import argparse from botocore.exceptions import ClientError parser = argparse.ArgumentParser(description='Report on Groups') parser.add_argument('--profile', help='AWS profile', default='default') parser.add_argument('--region', help="AWS region", default='eu-central-1') a...
mmoyle/aws-tools
iam-report.py
iam-report.py
py
1,329
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "boto3.Session", "line_number": 12, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 32, "usage_type": "name" }, { "api_name": "...
41394323003
from PIL import Image from PIL import ImageDraw from math import sqrt from colors import parse_color, Color import functools def checkColor(f): """ Test whether among *args is one which type is Color """ def wrapper(*args, **kwargs): color = list(filter(lambda x: isinstance(x, Color), args)) if not color: r...
mucharafal/pythonOld
2project/figures.py
figures.py
py
7,358
python
en
code
0
github-code
18
[ { "api_name": "colors.Color", "line_number": 12, "usage_type": "argument" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 90, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_number": 90, "usage_type": "name" }, { "api_name": "colors.parse_color"...
40584985220
from django.core.management.base import BaseCommand from iati_synchroniser.models import Dataset class Command(BaseCommand): """ This command to delete all dataset with version below then 2.01 """ def handle(self, *args, **options): Dataset.objects.exclude( iati_version__in=['2.0...
EwoutGoet/iati_data
OIPA/iati_synchroniser/management/commands/delete_all_datasets_v1.py
delete_all_datasets_v1.py
py
383
python
en
code
0
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 6, "usage_type": "name" }, { "api_name": "iati_synchroniser.models.Dataset.objects.exclude", "line_number": 12, "usage_type": "call" }, { "api_name": "iati_synchroniser.models.Dataset.objects", "line_numb...
25251205202
#!/usr/bin/env python3 #input is job file in csv format #launch the ROSETTA CM pipeline #Shawn Shen 01222021 from pathlib import Path from database_access import StatusEditor import py_thread import fragments import hybridize_mover import tempfile class launcher(): def __init__(self, MHC_class, work_dir, msa_fil...
yshen25/HLA_RosettaCM_pipeline_slurm
py_tools/job_launcher.py
job_launcher.py
py
4,935
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 23, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 29, "usage_type": "call" }, { "api_name": "py_thread.main", "line_number": 40, "usage_type": "call" }, { "api_name": "fragments.pbs_run", "lin...
35800199005
import requests import xml.etree.ElementTree as ET import pandas as pd import dateutil.parser import sys import datetime import ratelimit import itertools omso_prefix = "{http://inspire.ec.europa.eu/schemas/omso/3.0}" om_prefix = "{http://www.opengis.net/om/2.0}" wml2_prefix = "{http://www.opengis.net/waterml/2.0}" d...
oraisa/DS-blue-algae-project
get_fmi_data.py
get_fmi_data.py
py
4,953
python
en
code
1
github-code
18
[ { "api_name": "datetime.date", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.timedelta", ...
11118429324
import os import numpy as np from PIL import ImageFont, ImageDraw, Image import cv2 def makeimage(fontpath='', txt='test', imgsize=(128, 128, 3), txtsize=128, name='data', folder=''): img = np.ones(imgsize, np.uint8) * 255#白背景 color = (0, 0, 0)#文字色 font = ImageFont.truetype(fontpath, txtsize) ...
suku1/Charimg_generator
Charimg_generator.py
Charimg_generator.py
py
1,127
python
en
code
0
github-code
18
[ { "api_name": "numpy.ones", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PIL.ImageFont.truetype", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.ImageFont", "...
74547601641
# -*- coding: utf-8 -*- from odoo import models, fields, api, _ from odoo.exceptions import UserError, ValidationError from datetime import datetime from dateutil.relativedelta import relativedelta import logging _logger = logging.getLogger(__name__) DF = "%Y-%m-%d" EPS = 0.00001 #IMPLEMENTATION = True class LoanP...
AllianceWebcoop/webcoop_source
wc_upgrade_ver10_0_1_4/b580/payment.py
payment.py
py
1,782
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 16, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 16, "usage_type": "name" }, { "api_name": "odoo.exceptions....
28431688958
import socket import traceback import logging import mysql.connector from utils.utils import AuthFailure class NotMysql(Exception): pass class MySQLScan: def __init__(self, hostname, port, timeout): self.hostname = hostname self.port = port self.timeout = timeout self.conn ...
hegusung/netscan
scripts/lib/mysqlscan/mysql.py
mysql.py
py
3,383
python
en
code
22
github-code
18
[ { "api_name": "socket.socket", "line_number": 32, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 32, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 32, "usage_type": "attribute" }, { "api_name": "mysql.conne...
2851763498
from methods import * def leastSQ(): from scipy.optimize import leastsq _, diff, periods, power = LassoDiff(-0.88888, 0.01) def double_gaussian(x, params): (c1, mu1, c2, mu2) = params sigma = 0.1 return c1 * np.exp(-(x - mu1)**2.0 / (2.0 * sigma**2.0)) \ + c2 * np.ex...
ysshah/period-search
misc.py
misc.py
py
2,146
python
en
code
0
github-code
18
[ { "api_name": "scipy.optimize.leastsq", "line_number": 22, "usage_type": "call" }, { "api_name": "scipy.optimize.basinhopping", "line_number": 55, "usage_type": "call" } ]
11170002171
from django.db import migrations from django.db.models import F class Migration(migrations.Migration): def rename_cyclonedx_parser_vuln_uniq(apps, schema_editor): """ 1) rename test type to reflect changes in the parser 2) switch vuln_id_from_tool and unique_id_from_tool in findings ...
DefectDojo/django-DefectDojo
dojo/db_migrations/0114_cyclonedx_vuln_uniqu.py
0114_cyclonedx_vuln_uniqu.py
py
2,026
python
en
code
3,128
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.F", "line_number": 24, "usage_type": "call" }, { "api_nam...
29227073712
# coding:utf-8 import scrapy from bs4 import BeautifulSoup import os, urllib, zlib, urllib2 from WorkPool import * top = 'http://www.xeall.com' base = top + '/shenshi' class Comics(scrapy.Spider): name = "comics" def __init__(self): self.workPool = WorkPool(10) def start_requests(self): ...
demonk/fetch_comic
Comics/spiders/comics.py
comics.py
py
4,675
python
en
code
0
github-code
18
[ { "api_name": "scrapy.Spider", "line_number": 12, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 27, "usage_type": "call" }, { "api_name": "scrapy.Request", ...
34461232574
from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5 import QtSvg import chess.pgn import numpy as np from move import Move from board import BoardView from graph import GraphView import defs class GameModel: def __init__(self): self.pgnSrc = open('tcec.pgn') ...
sovaz1997/ZevraGUI
src/game.py
game.py
py
2,705
python
en
code
0
github-code
18
[ { "api_name": "chess.pgn.pgn.read_game", "line_number": 18, "usage_type": "call" }, { "api_name": "chess.pgn.pgn", "line_number": 18, "usage_type": "attribute" }, { "api_name": "chess.pgn", "line_number": 18, "usage_type": "name" }, { "api_name": "move.Move", ...
13601054528
# -*- coding:utf-8 -*- # 由于Python是跨平台的,自然也应该提供一个跨平台的多进程支持。multiprocessing模块就是跨平台版本的多进程模块。 from multiprocessing import Process, Pool import os, time, random ''' process.join()/threading.join()方法是用于使得主进程/主线程与子xx同步的, 因为当默认情况下主xx执行完任务后就退出了,而此时子xx会继续执行自己的任务直到结束。 而使用join后则是将主子同步,当主线程任务结束后,进入阻塞状态,等待其他子xx的结束 最后主xx方才结束。 ''...
xzxldl55/PyO
多进程.py
多进程.py
py
1,484
python
zh
code
0
github-code
18
[ { "api_name": "os.getpid", "line_number": 32, "usage_type": "call" }, { "api_name": "time.time", "line_number": 33, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 34, "usage_type": "call" }, { "api_name": "random.random", "line_number": 34,...
43038757663
# -*- coding: utf-8 -*- """ Created on Wed May 20 16:37:30 2020 @author: user """ import glob import os import cv2 import pandas as pd import numpy as np from sklearn.model_selection import train_test_split import tensorflow as tf from keras.layers import Dense, Conv2D, MaxPool2D , Flatten, GlobalAveragePooling2D,D...
hklhfong/Person-Re-Identification-and-Clustering
Question3.py
Question3.py
py
8,773
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 52, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.O...
38854739638
from django.urls import path from . import views from .views import PostListView,PostdetailView,PostcreateView,PostupdateView,PostdeleteView urlpatterns = [ path('',PostListView.as_view(),name="blog-home"), path('posts/<int:pk>',PostdetailView.as_view(),name="posts-detail"), path('posts/new',PostcreateVie...
kryptomadan/firstdjangoproject
blog/home/urls.py
urls.py
py
536
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.PostListView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "views.PostListView", "line_number": 7, "usage_type": "name" }, { "api_name": "django.ur...
75173334121
from django.contrib.auth.models import User from django.db import models from projects.models import Project ISSUE_TAG_CHOICES = (("Bug", "Bug"), ("Improvement", "Improvement"), ("Task", "Task")) ISSUE_PRIORITY_CHOICES = (('Low', "Low"), ("Mid", "Mid"), ("High", "High")) ISSUE_STATUS_CHOICES = (("To-Do", "To-Do"), ("P...
FrancoisQUI/P10-00a-Projet
softdesk/issues/models.py
models.py
py
1,195
python
en
code
0
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 11, "usage_type": "call" }, { "api_name"...
4003164194
import abc import contextlib import functools import itertools import math import random import numpy as np from tensorflow.python.data.experimental.ops import cardinality from tensorflow.python.data.ops import dataset_ops from tensorflow.python.data.ops import iterator_ops from tensorflow.python.data.ops import opti...
tensorflow/tensorflow
tensorflow/python/keras/engine/data_adapter.py
data_adapter.py
py
58,225
python
en
code
178,918
github-code
18
[ { "api_name": "abc.ABCMeta", "line_number": 38, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 82, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 108, "usage_type": "attribute" }, { "api_name": "abc...
12141936734
from setuptools import setup, Command from pathlib import Path from pip.req import parse_requirements from pip.download import PipSession __version__ = '0.0.1' ROOT = Path(__file__).resolve().parent it = parse_requirements(str(ROOT / 'requirements.txt'), session=PipSession()) setup( nam...
vaultah/L
setup.py
setup.py
py
856
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "pip.req.parse_requirements", "line_number": 11, "usage_type": "call" }, { "api_name": "pip.download.PipSession", "line_number": 12, "usage_type": "call" }, { "api_name": "setupt...
41765521481
from rest_framework import status from rest_framework.authentication import TokenAuthentication from rest_framework.decorators import api_view from rest_framework.decorators import authentication_classes from rest_framework.decorators import permission_classes from rest_framework.permissions import IsAuthenticated from...
python-hillel/python_advanced_06_12_2022
07_django_api/shelf/views.py
views.py
py
2,098
python
en
code
2
github-code
18
[ { "api_name": "models.Author.objects.all", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Author.objects", "line_number": 16, "usage_type": "attribute" }, { "api_name": "models.Author", "line_number": 16, "usage_type": "name" }, { "api_name": "se...
37085394826
import logging import asyncio import functools as ft import re import googleapiclient.discovery from pathlib import Path from urllib import parse as urlparse from minotaur import Inotify, Mask from obsidian_tools.config import api_key log = logging.getLogger(__name__) api_service_name = "youtube" api_version = "v3"...
fxjung/obsidian_tools
obsidian_tools/watch.py
watch.py
py
1,867
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "googleapiclient.discovery.discovery.build", "line_number": 18, "usage_type": "call" }, { "api_name": "googleapiclient.discovery.discovery", "line_number": 18, "usage_type": "attri...
22111038999
""" Main file for this code. The main code is in `select`, and the rest is to help with variable name management. """ import warnings from numbers import Number from typing import Optional, Sequence, Tuple, Union import cf_xarray # noqa: F401 import numpy as np import xarray as xr import xoak # noqa: F401 from da...
axiom-data-science/extract_model
extract_model/extract_model.py
extract_model.py
py
43,106
python
en
code
4
github-code
18
[ { "api_name": "xarray.DataArray", "line_number": 38, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 39, "usage_type": "name" }, { "api_name": "xarray.DataArray", "line_number": 39, "usage_type": "name" }, { "api_name": "typing.Optional", ...
5004465508
import re import sys import validators from os.path import isfile import requests import argparse IMPORT_REGEX = r'(?!.*(/\*|\*/))(.*@import url\((.*)\).*)' def expand(contents, s_print): for line in contents: match = re.match(IMPORT_REGEX, str(line)) if match: url = re.sub('[^A-Za-z0...
BrianTipton1/cssxpd
main.py
main.py
py
2,232
python
en
code
0
github-code
18
[ { "api_name": "re.match", "line_number": 13, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "validators.url", "line_number": 32, ...
20866400286
# -*- conding:utf-8 -*- from init_env import BASE_DIR from common.HttpUtils import HttpUtils from common.env_config import ServerCC from common.DateUtils import currentTimeMillis, DateTime import json import os token_json_path = BASE_DIR + '/resources/token.json' """ 获取接口调用凭证token工具 """ URL_AUTH = 'https://rasdev9.z...
DoubleDD/python_test
common/login.py
login.py
py
1,850
python
en
code
1
github-code
18
[ { "api_name": "init_env.BASE_DIR", "line_number": 10, "usage_type": "name" }, { "api_name": "common.HttpUtils.HttpUtils", "line_number": 22, "usage_type": "call" }, { "api_name": "os._exit", "line_number": 26, "usage_type": "call" }, { "api_name": "json.loads", ...
26443077038
import requests from modular.common.SqlChangeFormat import DateEncoder, list_to_str from modular.oaDB.getPsr import PsrMessage, find_psr from modular.mapper import ConnectWSPdb from modular.wspDB.wspPsrDB import WspPsrSql import json # from modular.GetApplication import wsp_url from modular.wspxxlJob.xxlJob import Sour...
714866/wms
modular/PSR/CreateWspPSR.py
CreateWspPSR.py
py
4,578
python
en
code
0
github-code
18
[ { "api_name": "modular.GetApplication.get_value", "line_number": 12, "usage_type": "call" }, { "api_name": "modular.GetApplication.get_value", "line_number": 13, "usage_type": "call" }, { "api_name": "modular.oaDB.getPsr.PsrMessage", "line_number": 18, "usage_type": "call...
18802995435
from django.db import models from django.conf import settings import random import string # Create your models here. SHORTCODE_MAX=getattr(settings,"SHORTCODE_MAX",20) SHORTCODE_MAN=getattr(settings,"SHORTCODE_MAN",8) SHORTCODE_MAX=settings.SHORTCODE_MAX def code_generator(size=SHORTCODE_MAN, chars=string.ascii_lowerca...
MohamedIbrahim27/Dj-URL-Shortening-Service
main/models.py
models.py
py
2,397
python
en
code
0
github-code
18
[ { "api_name": "django.conf.settings", "line_number": 6, "usage_type": "argument" }, { "api_name": "django.conf.settings", "line_number": 7, "usage_type": "argument" }, { "api_name": "django.conf.settings.SHORTCODE_MAX", "line_number": 8, "usage_type": "attribute" }, {...
74999794921
import zmq class ZMQServer(object): def __init__(self,context=None): self.rep="tcp://127.0.0.1:4500" self.req="tcp://127.0.0.1:4501" self.context=context or zmq.Context.instance() self.reqSock=self.context.socket(zmq.REQ) self.repSock=self.context.socket(zmq.REP) self.dealerSock=self.context.socket(zmq....
bladeyul/loadtest
zmqServer.py
zmqServer.py
py
804
python
en
code
0
github-code
18
[ { "api_name": "zmq.Context.instance", "line_number": 9, "usage_type": "call" }, { "api_name": "zmq.Context", "line_number": 9, "usage_type": "attribute" }, { "api_name": "zmq.REQ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "zmq.REP", "line_...
17233832362
import datetime import json import random import math import numpy as np import os try: from pymongo.errors import ConnectionFailure from pymongo import MongoClient from telegram import InlineKeyboardMarkup, InlineKeyboardButton, Bot from telegram.error import TimedOut, TelegramError import boto3 import zipfile e...
clarkwkw/mahjong-ai
TGBotServer/utils.py
utils.py
py
4,246
python
en
code
25
github-code
18
[ { "api_name": "boto3.resource", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 40, "usage_type": "attribute" }, { "api_name": "math.sqrt", ...
2188336866
import hashlib import re import time from requests.adapters import HTTPAdapter from streamlink.plugin import Plugin from streamlink.plugin.api import http, validate, useragents from streamlink.stream import HTTPStream, HLSStream, RTMPStream #new API and key from https://gist.github.com/spacemeowx2/629b1d131bd7e240a7...
ellen87006/streamlink
src/streamlink/plugins/douyutv.py
douyutv.py
py
4,998
python
en
code
null
github-code
18
[ { "api_name": "re.compile", "line_number": 24, "usage_type": "call" }, { "api_name": "re.VERBOSE", "line_number": 35, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 37, "usage_type": "call" }, { "api_name": "re.compile", "line_number":...
71768170280
import random import os from art import logo, vs from game_data import data def print_formatted_stuff(stuff, position): text = "Compare A: " if position == "A" else "Against B: " print(f'{text}{stuff["name"]}, a(n) {stuff["description"]}, from {stuff["country"]}') def game(): score = 0 lives = 1 ...
zsigil/udemy-100-days-of-code-python
Day-14/higher_lower_game.py
higher_lower_game.py
py
1,841
python
en
code
0
github-code
18
[ { "api_name": "random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "game_data.data", "line_number": 17, "usage_type": "argument" }, { "api_name": "random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "game_data.data", ...
4006150094
import enum from tensorflow.python.util import compat from tensorflow.python.util.tf_export import tf_export is_oss = True # Updated by copybara. @tf_export("saved_model.experimental.VariablePolicy") class VariablePolicy(enum.Enum): """Enum defining options for variable handling when saving. NONE No poli...
tensorflow/tensorflow
tensorflow/python/saved_model/save_options.py
save_options.py
py
8,552
python
en
code
178,918
github-code
18
[ { "api_name": "enum.Enum", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tensorflow.python.util.tf_export.tf_export", "line_number": 10, "usage_type": "call" }, { "api_name": "tensorflow.python.util.tf_export.tf_export", "line_number": 76, "usage_type": "...
17284396216
############################################################################# # https://geocoder.readthedocs.io/ # Before running this code, install the geocoder module on command line: # # pip install geocoder # # Task 1: make a function called geocode() that take an address as a positional # parameter and writes th...
eecs110/winter2019
course-files/lectures/lecture_04/demo02_geocoder.py
demo02_geocoder.py
py
1,056
python
en
code
2
github-code
18
[ { "api_name": "geocoder.osm", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "lin...
29226675498
from typing import List class Solution: def longestConsecutive(self, nums: List[int]) -> int: s = set(nums) max_len = 0 for n in s: if n - 1 not in s: i = 1 while n + i in s: i += 1 max_len = max([max_len, i]) ...
3swu/programming-test
leetcode/128.py
128.py
py
432
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
75357357480
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'getin.views.home', name='home'), url(r'^api/', include('api.urls')), url(r'^dashboard/', include('dashboard.urls')), # Authentication ...
donrukanga1/getin-django
getin/urls.py
urls.py
py
676
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 4, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 6, "usage_type": "call" }, { "api...
13866969273
import drawSvg as draw import src.compile as comp import random from pathlib import Path things = [ ("lsystems/leaf.json", 6) , ("lsystems/leaf.json", 7) , ("lsystems/leaf.json", 8) , ("lsystems/bush1.json", 4) , ("lsystems/bush1.json", 5) , ("lsystems/bush2.json", 4) , ("lsystems/bush2.json", 5) ...
harrysha1029/cs248project
make_forest.py
make_forest.py
py
1,034
python
en
code
0
github-code
18
[ { "api_name": "src.compile.compile", "line_number": 18, "usage_type": "call" }, { "api_name": "src.compile", "line_number": 18, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "pathlib.Path", "line...
38246506427
import requests from lxml import etree from lxml.etree import ParseError from requests import RequestException import csv # 单页url def get_one_page_url(url, URLlist): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/...
neptunejing/spider-colleges
colleges.py
colleges.py
py
3,952
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.RequestException", "line_number": 18, "usage_type": "name" }, { "api_name": "lxml.etree.HTML", "line_number": 21, "usage_type": "call" }, { "api_name": "lxml.etree", ...
21031211128
from django.core.management.base import BaseCommand, CommandError from water_app.models import Getdata, Block from django.db.models import Model class Command(BaseCommand): help = 'get Data and save block' def add_arguments(self, parser): pass def handle(self, *args, **options): area_nam...
Yingdahx/water3
water_com/water_app/management/commands/block.py
block.py
py
2,316
python
en
code
0
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 6, "usage_type": "name" }, { "api_name": "water_app.models.Block.objects.all", "line_number": 20, "usage_type": "call" }, { "api_name": "water_app.models.Block.objects", "line_number": 20, "usage_type...
9251364962
from heapq import heappop, heappush from collections import defaultdict class Node: cnt = 0 def __init__(self, val) -> None: self.val = val self.l = [] self.id = Node.cnt Node.cnt += 1 self.visited = False def __str__(self) -> str: return f"<NODE {self.id}, v...
orjahren/advent-of-code
2021/day-15/main.py
main.py
py
2,092
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 63, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 83, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 87, "usage_type": "call" }, { "api_name": "heapq.h...
33713466303
import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torchvision.transforms as transforms import torchvision.utils as vutils import numpy as np i...
eldadoh/Image-Augmentations-for-GAN-Training
Augmentation.py
Augmentation.py
py
4,600
python
en
code
4
github-code
18
[ { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.LUT", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.zeros_like", "line_number"...
19439438772
from __future__ import print_function import fnmatch import io import os from tqdm import tqdm import subprocess def create_manifest(data_path, output_path, min_duration=None, max_duration=None): file_paths = [os.path.join(dirpath, f) for dirpath, dirnames, files in os.walk(data_path) ...
silversparro/wav2letter.pytorch
data/utils.py
utils.py
py
1,509
python
en
code
123
github-code
18
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 12, "usage_type": "call" }, { "api_name": "fnmatch.filter", "line_number":...
8213033030
import time from collections import namedtuple from functools import lru_cache data = ''' The first floor contains a polonium generator, a thulium generator, a thulium-compatible microchip, a promethium generator, a ruthenium generator, a ruthenium-compatible microchip, a cobalt generator, and a cobalt-compatible micr...
waynew/advent2016
11/11_floors.py
11_floors.py
py
8,432
python
en
code
0
github-code
18
[ { "api_name": "collections.namedtuple", "line_number": 146, "usage_type": "call" } ]
36315793822
import numpy as np import torch import dgl from dgl import DGLGraph from rdkit import Chem from rdkit.Chem import rdMolDescriptors as rdDesc #辅助函数 def one_of_k_encoding_unk(x, allowable_set): '将x与allowable_set逐个比较,相同为True, 不同为False, 都不同则认为是最后一个相同' if x not in allowable_set: x = allowable_set[-1] re...
LoremnMeus/ML_Project
Task-1/utils.py
utils.py
py
7,111
python
en
code
0
github-code
18
[ { "api_name": "rdkit.Chem.rdchem", "line_number": 23, "usage_type": "attribute" }, { "api_name": "rdkit.Chem", "line_number": 23, "usage_type": "name" }, { "api_name": "rdkit.Chem.rdchem", "line_number": 24, "usage_type": "attribute" }, { "api_name": "rdkit.Chem",...
171681452
from pyrogram import filters from pyrogram import __version__ as pyro_vr from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message from .. import (Venom1, Venom2, Venom3, Venom4, Venom5, Venom6, Venom7, Venom8, Venom9, Venom10, Venom11, Venom12, Veno...
Oplphgcsf/Vcraid
ArrayCore/vc/alive.py
alive.py
py
3,079
python
en
code
0
github-code
18
[ { "api_name": "pyrogram.types.Message", "line_number": 15, "usage_type": "name" }, { "api_name": "pyrogram.__version__", "line_number": 52, "usage_type": "name" }, { "api_name": "pyrogram.types.InlineKeyboardMarkup", "line_number": 57, "usage_type": "call" }, { "a...
22585517416
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 23 15:39:18 2020 @author: yochai_yemini """ import torch import numpy as np from collections import OrderedDict eps=2.2204*np.exp(-16) def stft(z, K, overlap, spec_mode='abs'): if spec_mode not in ['abs', 'log']: raise ValueError("spe...
yochaiye/scene_agnostic_dereverberation
data/utils.py
utils.py
py
3,795
python
en
code
5
github-code
18
[ { "api_name": "numpy.exp", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.fix", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 21, ...
75118377319
#!/usr/bin/python3 # COMP3311 22T3 Assignment 2 # Print info about one movie; may need to choose import sys import psycopg2 import helpers ### Globals db = None usage = f"Usage: {sys.argv[0]} 'PartialMovieName'" ### Command-line args if len(sys.argv) < 2: print(usage) exit(1) # process the command-line arg...
cinnamenn/comp3311-database
assignment 2/movie.py
movie.py
py
2,795
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" }, { "api_name": "psycopg2.connect", "lin...
25573765709
# 入力が10**5とかになったときに100ms程度早い import sys read = sys.stdin.readline def read_ints(): return list(map(int, read().split())) def read_a_int(): return int(read()) def read_matrix(H): ''' H is number of rows ''' return [list(map(int, read().split())) for _ in range(H)] def read_map(H): '''...
masakiaota/kyoupuro
contests/ABC149/E_naive.py
E_naive.py
py
1,086
python
en
code
1
github-code
18
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "itertools.combinations_with_replacement", "line_number": 54, "usage_type": "call" } ]
14338507276
'''' Author:Shuntos 2020 Apr 14 ''' import tensorflow as tf from tensorflow.python.platform import gfile import numpy as np import os import cv2 import time path_to_pb = "./weights/froze_xxx.pb" classes = ["plant","negative"] dir_path = 'imgs' def inference(image): text= None image_size=128 num...
researchshadow/weedClassification
classify_image.py
classify_image.py
py
2,447
python
en
code
0
github-code
18
[ { "api_name": "cv2.resize", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.INTER_LINEAR", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_...
19393054933
import pygame import sys from config import * from Point import Point clock = pygame.time.Clock() sc = pygame.display.set_mode((WIN_WIDTH, WIN_HEIGHT),) isRunning = True def pointsFabric(count, center, r, width): points = [] step = r / count x0, y0 = center[0], center[1] ANGLE_VELOCITY = LINEAR_SPEED...
Reltig/circles
circle.py
circle.py
py
1,356
python
en
code
0
github-code
18
[ { "api_name": "pygame.time.Clock", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.displa...
40775501779
# check if spark context is defined print(sc.version) # importing some libraries import pandas as pd import pyspark from pyspark.sql import SQLContext sqlContext = SQLContext(sc) # stuff we'll need for text processing # from nltk.corpus import stopwords import re as re from pyspark.ml.feature import CountVectorizer, ...
hcvazquez/natural-language-processing-in-spark-with-pyspark
topic-mining/topic-mining.py
topic-mining.py
py
3,390
python
en
code
1
github-code
18
[ { "api_name": "pyspark.sql.SQLContext", "line_number": 9, "usage_type": "call" }, { "api_name": "pyspark.ml.feature.Tokenizer", "line_number": 31, "usage_type": "call" }, { "api_name": "pyspark.ml.feature.StopWordsRemover.loadDefaultStopWords", "line_number": 39, "usage_t...
20727364948
from typing import List, Dict, Any, Tuple, Union, Optional import math import os import datetime import pickle from enum import Enum from copy import deepcopy from itertools import product from timeit import default_timer as timer import numpy as np import matplotlib.pyplot as plt import cvxpy as cp from IOData.IODat...
HuangYujun-JunkyTalent/DataDrivenSafetyFilter
simulators/track_simulator.py
track_simulator.py
py
61,582
python
en
code
0
github-code
18
[ { "api_name": "typing.Union", "line_number": 42, "usage_type": "name" }, { "api_name": "System.ErrorKinematicAcceLATI.LinearizedErrorKinematicAcceModel", "line_number": 42, "usage_type": "name" }, { "api_name": "System.DynamicErrorModel.DynamicErrorModelFewOutput", "line_numb...
73284098279
# --- # jupyter: # jupytext: # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.11.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- # %% [ma...
anthonyjclark/cs152fa21
lectures/l05-neuron-mnist.py
l05-neuron-mnist.py
py
9,446
python
en
code
1
github-code
18
[ { "api_name": "torch.rand", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.rand", "line_number": 41, "usage_type": "call" }, { "api_name": "torch.rand", "line_number": 44, "usage_type": "call" }, { "api_name": "torch.rand", "line_number": 47, ...
26182975464
import model.citas as citModel import datetime from operator import getitem from collections import OrderedDict def waitExit(): contExit = True while contExit: rtaExit = input('Enter "Y" to exit: ').lower() contExit = False if rtaExit == 'y' else True def veriDataType(data, typeDat): try:...
williamvg93/campus_Examen_Python
controller/citas.py
citas.py
py
7,824
python
en
code
0
github-code
18
[ { "api_name": "model.citas.checkFile", "line_number": 24, "usage_type": "call" }, { "api_name": "model.citas", "line_number": 24, "usage_type": "name" }, { "api_name": "model.citas.getData", "line_number": 25, "usage_type": "call" }, { "api_name": "model.citas", ...
3271096838
''' A recursive LSTM cost model, refer to https://proceedings.mlsys.org/paper/2021/file/3def184ad8f4755ff269862ea77393dd-Paper.pdf ''' import numpy as np import torch import torch.nn as nn from utils.util import warn_once class Model_Recursive_LSTM_v2(nn.Module): ''' Refer to https://github.com/Tiramisu-Com...
joapolarbear/cdmpp
metalearner/model/recur_net.py
recur_net.py
py
7,382
python
en
code
1
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
11305185263
from typing import List class Solution: def maxArea(self, height: List[int]) -> int: leftPointer = 0 rightPointer = len(height) - 1 maxArea = 0 while leftPointer < rightPointer: distance = rightPointer - leftPointer leftHeight = height[leftPointer] rightHeight = height[rightPointer] minHeight = ...
awsunit/GooglePrep
py_a/waterContainer.py
waterContainer.py
py
603
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]