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
14952780826
from temporalio.client import Client from temporalio.worker import Worker from temporal_test.activity import say_hello_activity from temporal_test.config import Config from temporal_test.workflows import TestWorkflow import asyncio import os async def main(): temporal_host = os.getenv("TEMPORAL_ADDRESS", "127.0.0...
qadiludmer/temporal-test
temporal_test/worker.py
worker.py
py
824
python
en
code
0
github-code
6
[ { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "temporalio.client.Client.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "temporalio.client.Client", "line_number": 14, "usage_type": "name" }, { "api_name": "t...
10230270575
import numpy as np from pyparsing import Any import evals import evals.elsuite.steganography.steganography as steganography import evals.metrics from evals.api import CompletionFn, DummyCompletionFn from evals.eval import Eval from evals.record import RecorderBase class Steganography(Eval): def __init__( ...
openai/evals
evals/elsuite/steganography/eval.py
eval.py
py
3,437
python
en
code
12,495
github-code
6
[ { "api_name": "evals.eval.Eval", "line_number": 12, "usage_type": "name" }, { "api_name": "evals.api.CompletionFn", "line_number": 15, "usage_type": "name" }, { "api_name": "evals.api.DummyCompletionFn", "line_number": 24, "usage_type": "argument" }, { "api_name":...
1948037648
from django.contrib import admin from django.db.models import QuerySet from django.db.models.expressions import RawSQL from django.forms import ModelForm from django.urls import reverse from django.utils.safestring import mark_safe from tree.models import Category from django.utils.html import format_html from django ...
Vulwsztyn/django_treebeard_admin
tree/admin.py
admin.py
py
1,783
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 15, "usage_type": "name" }, { "api_name": "django.db.models.QuerySet", "line_number": 17, "usage_type": "name" }, { ...
15855579751
from appium import webdriver from appium.webdriver.common.mobileby import MobileBy from selenium.webdriver.common.by import By class TestWeworkTest: def setup(self): desired_cap = {} desired_cap["platformName"] = "Android" # desired_cap["platformVersion"] = "6.0" desired_cap["devic...
sunmings1310/HogwartsHomework
hogwarts-homework/AppWeworkHomework/test_clokc_in.py
test_clokc_in.py
py
3,015
python
en
code
0
github-code
6
[ { "api_name": "appium.webdriver.Remote", "line_number": 22, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 22, "usage_type": "name" }, { "api_name": "appium.webdriver.common.mobileby.MobileBy.XPATH", "line_number": 47, "usage_type": "attribute" ...
28985765692
import community as community_louvain import networkx as nx #read file graph_file = 'abide_au_2_4132_sparse.txt' #label_file='4132_regions.txt' with open(graph_file) as f: graph = f.readlines() graph = [x.strip() for x in graph] G = nx.parse_edgelist(graph, delimiter="\t", nodetype=int) partition = community_lo...
chandrashekar-cds/Graph-Coarsening
louvain_subgraphs_label.py
louvain_subgraphs_label.py
py
2,184
python
en
code
0
github-code
6
[ { "api_name": "networkx.parse_edgelist", "line_number": 12, "usage_type": "call" }, { "api_name": "community.best_partition", "line_number": 13, "usage_type": "call" } ]
10640003312
import requests import json import urllib2 BASE_URL = "https://api.github.com" def confirm_github(): """Confirm Github is up and running""" url = BASE_URL r = requests.get(url) if r.status_code == 200: # print "status code:", r.status_code, "(github is working)" return True else: # print "github is down"...
smithers1221/replicatedcc_python
githubapi.py
githubapi.py
py
1,833
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "urllib2.Request", "line_number": 51, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line...
43574733165
import os import unittest import re from unittest import mock import tempfile with mock.patch('cffi.FFI.dlopen', return_value=mock.MagicMock()): from geopmdpy.system_files import ActiveSessions, AccessLists, WriteLock # Patch dlopen to allow the tests to run when there is no build with mock.patch('cffi.FFI.dlopen'...
geopm/geopm
service/geopmdpy_test/TestPlatformService.py
TestPlatformService.py
py
21,394
python
en
code
79
github-code
6
[ { "api_name": "unittest.mock.patch", "line_number": 6, "usage_type": "call" }, { "api_name": "unittest.mock", "line_number": 6, "usage_type": "name" }, { "api_name": "unittest.mock.MagicMock", "line_number": 6, "usage_type": "call" }, { "api_name": "unittest.mock....
26038294916
import inspect import json import sys from pathlib import Path import pytest from _pytest import fixtures from _pytest.compat import get_real_func def get_func_path(func): real_func = get_real_func(func) return inspect.getfile(real_func) def get_fixturedef(fixture_request, name): fixturedef = fixture_r...
pantsbuild/pants
pants-plugins/internal_plugins/test_lockfile_fixtures/collect_fixtures.py
collect_fixtures.py
py
2,655
python
en
code
2,896
github-code
6
[ { "api_name": "_pytest.compat.get_real_func", "line_number": 12, "usage_type": "call" }, { "api_name": "inspect.getfile", "line_number": 13, "usage_type": "call" }, { "api_name": "_pytest.fixtures.FixtureLookupError", "line_number": 22, "usage_type": "attribute" }, { ...
6323414106
from contextlib import suppress import random import asyncio from typing import * import traceback import hikari from hikari import Embed import lightbulb from lightbulb import events, errors from lightbulb.context import Context from core import Inu from utils.language import Human from .help import OutsideHelp fro...
zp33dy/inu
inu/ext/commands/errors.py
errors.py
py
10,996
python
en
code
1
github-code
6
[ { "api_name": "core.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "lightbulb.Plugin", "line_number": 20, "usage_type": "call" }, { "api_name": "core.Inu", "line_number": 21, "usage_type": "name" }, { "api_name": "hikari.ExceptionEvent", ...
40315905815
############################################## # Q1 --- find sum of all inputs ############################################## # Read input - (f.read() for char-by-char read) & (loop file object for LINE-by-LINE reading) with open('./1201.in', 'r') as f: freqList = [line.strip() for line in f] # Compute sum from ...
hdd2k/adventOfCode
2018/01/1201.py
1201.py
py
924
python
en
code
2
github-code
6
[ { "api_name": "functools.reduce", "line_number": 12, "usage_type": "call" }, { "api_name": "itertools.cycle", "line_number": 23, "usage_type": "call" } ]
8413409544
import numpy as np from itertools import product from vgc_project.maze import Maze def test_basic_maze_properties(): pw=.94 ps=.6 m = Maze( tile_array=( ".j.", "x#3" ), absorbing_features=("j",), wall_features=("#","3"), default_features=("."...
markkho/value-guided-construal
vgc_project/vgc_project/tests/test_maze.py
test_maze.py
py
2,403
python
en
code
20
github-code
6
[ { "api_name": "vgc_project.maze.Maze", "line_number": 9, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.isclose", ...
43272673113
import os import cv2 import numpy as np import torch from PIL import Image import torchvision class SegDataset(object): def __init__(self, root, transforms): self.root = root self.transforms = transforms # load all image files, sorting them to # ensure that they are aligned ...
v7labs/deeplabv3-edges
dataset.py
dataset.py
py
2,535
python
en
code
1
github-code
6
[ { "api_name": "os.listdir", "line_number": 18, "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.listdir", "line_number": ...
38777260786
import pandas as pd import os import numpy as np from math import floor from sqlalchemy import create_engine, MetaData, Table import tushare as ts from utils import get_all_tdx_symbols import click import struct """ 读取通达信数据 """ class TdxFileNotFoundException(Exception): pass class TdxReader: def __init__...
maxwell-lv/MyQuant
tdxreader.py
tdxreader.py
py
5,452
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
38358981811
import logging from enum import Enum import openai from fastapi import Query from openai.error import AuthenticationError, InvalidRequestError, RateLimitError from tenacity import ( retry, stop_after_attempt, wait_random_exponential, retry_if_exception_type, ) # for exponential backoff from app.confi...
jybaek/Hello-ChatGPT
app/services/openai_completions.py
openai_completions.py
py
2,522
python
en
code
7
github-code
6
[ { "api_name": "enum.Enum", "line_number": 24, "usage_type": "name" }, { "api_name": "openai.Completion.acreate", "line_number": 34, "usage_type": "call" }, { "api_name": "openai.Completion", "line_number": 34, "usage_type": "attribute" }, { "api_name": "tenacity.r...
10865691548
from django.contrib import admin from django.db import models from django.db.models import Q from django.utils.translation import gettext_lazy as _ from ...settings import ADMIN_MEDIA_JS from .actions import save_all_theses_to_xls from .models import Thesis # Copied from https://gist.github.com/rafen/eff7adae38903ee...
tlrh314/UvA_API_Alumni
apiweb/apps/research/admin.py
admin.py
py
8,102
python
en
code
2
github-code
6
[ { "api_name": "django.contrib.admin.ACTION_CHECKBOX_NAME", "line_number": 22, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 22, "usage_type": "name" }, { "api_name": "django.contrib.admin.ACTION_CHECKBOX_NAME", "line_number": 24, "usage...
34849239284
import sqlite3 def execute_with_output(conn, query_txt, fetch_quant="one"): """ Takes the connection file variable and executes the query text within that connection :param fetch_quant: :param conn: :param query_txt: :return: """ try: c = conn.cursor() c.execute(query_t...
James-Rocker/data_engineering_portfolio
working_with_sqllite/query/__init__.py
__init__.py
py
705
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.Error", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sqlite3.Error", "line_number": 32, "usage_type": "attribute" } ]
40275219447
# %% import pandas as pd import plotly.io as pio import plotly.express as px import plotly # %% adani_df = pd.read_csv('Data\Scatterplot\ADANIENT_day_data_processed.csv', parse_dates=['date'], index_col=['date']) appolo_df = pd.read_csv('Data\Scatterplot\APOLLOHOSP_day_data_processed.csv', parse_dates=['date'], index_...
mathewjames/covid-impact-on-indian-stock-market
scatterplot.py
scatterplot.py
py
7,537
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "...
70722602427
import requests from bs4 import BeautifulSoup from .componentParser import ComponentParser from .utils import isRelativePostDate, getRelativePostDate class BlogPost: errorCount = 0 def __init__(self, url, isDevMode=False): # 개발 편의 self.isDevMode = isDevMode # init self.url = url self.postInframeUrl = '' ...
Jeongseup/naver-blog-backer
src/naverblogbacker/post.py
post.py
py
4,676
python
en
code
4
github-code
6
[ { "api_name": "requests.get", "line_number": 63, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 64, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 76, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
29013781998
import sys,usb,struct USB_TIMEOUT_DEFAULT = 1000 SMS_EP_IN = 0x81 SMS_EP_OUT = 0x02 HIF_TASK = 11 class SMS1180USB: def __init__(self, dev, timeout=USB_TIMEOUT_DEFAULT): self.dev = dev self.timeout = timeout def usb_read(self): try: return bytes(self.dev.read(SMS_...
fxsheep/helloworld-anyware
src/siano/sms1180/sms1180usb.py
sms1180usb.py
py
1,474
python
en
code
4
github-code
6
[ { "api_name": "usb.core", "line_number": 18, "usage_type": "attribute" }, { "api_name": "usb.core", "line_number": 24, "usage_type": "attribute" }, { "api_name": "struct.pack", "line_number": 27, "usage_type": "call" }, { "api_name": "struct.unpack", "line_num...
31819134582
""" The field should look like this: col0 col1 col2 col3 col4 col5 col6 col7 col8 ||======|======|======||======|======|======||======|======|======|| || A | A | A || B | B | B || C | C | C || row0||cell0 |cell1 |cell2 ||cell3 |cell4 |cell5 ||cell6 |cell7 |ce...
stanislavstarkov/sudoku
sudoku.py
sudoku.py
py
6,469
python
en
code
0
github-code
6
[ { "api_name": "openpyxl.load_workbook", "line_number": 105, "usage_type": "call" } ]
72453543549
#!/usr/bin/python3 from tkinter import Image import rospy import sys import cv2 from cv_bridge import CvBridge, CvBridgeError class viewer: def __init__(self): self.bridge = CvBridge() # self.image_rgb_sub = rospy.Subscriber("/camera/color/image_raw",Image,self.callback) self.image...
Yandong-Luo/hybrid
src/Vision/detect_ball/nodes/image_pub.py
image_pub.py
py
997
python
en
code
1
github-code
6
[ { "api_name": "cv_bridge.CvBridge", "line_number": 10, "usage_type": "call" }, { "api_name": "rospy.Subscriber", "line_number": 12, "usage_type": "call" }, { "api_name": "tkinter.Image", "line_number": 12, "usage_type": "argument" }, { "api_name": "rospy.Subscribe...
31564356652
import svgwrite.extensions import faiss import numpy as np import matplotlib.pyplot as plt import svgwrite import networkx as nx import src.particle_utils as particle_utils if __name__ == "__main__": page_size = (11 * 96, 17 * 96) max_iterations = 1000 max_particles = 1000 index_training_node_count =...
neoques/dla-python
src/virnolli.py
virnolli.py
py
3,998
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 26, "usage_type": "call" }, { "api_name": "faiss.IndexFlatL2", ...
12657059462
# level: medium # 思路:dfs 将节点设为子树和,统计出现最多的字数和 # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None from collections import defaultdict class Solution(object): nodes = defaultdict(int) def findF...
PouringRain/leetcode
508.py
508.py
py
1,214
python
en
code
1
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" } ]
18528705421
# Section12-1 # 파이썬 데이터베이스 연동(SQLite) # 테이블 생성 및 삽입 import datetime import sqlite3 # 삽입 날짜 생성 now = datetime.datetime.now() print('now', now) nowDatetime = now.strftime('%Y-%m-%d %H:%M:%S') print('now Datetime', nowDatetime) # sqlite3 버전 print('sqlite3.version : ', sqlite3.version) print('sqlite3.sqlite_version', s...
dailyco/python-study
src/section12_1.py
section12_1.py
py
2,122
python
ko
code
2
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sqlite3.version", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sqlit...
9135098878
# -*- coding: utf-8 -*- import lzma import os import shutil from datetime import datetime from datetime import timedelta import hglib from bugbug import bugzilla from bugbug import labels from bugbug import repository from bugbug_data.secrets import secrets from cli_common.log import get_logger from cli_common.taskc...
chutten/release-services
src/bugbug/data/bugbug_data/retriever.py
retriever.py
py
3,307
python
en
code
null
github-code
6
[ { "api_name": "cli_common.log.get_logger", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
33340636168
from wsgiref.simple_server import make_server from pyramid.view import view_config from pyramid.config import Configurator @view_config(route_name='theroute', renderer='json',request_method='POST') def myview(request): import pdb; pdb.set_trace() return {'POST':''} if __name__ == '__main__': config = Conf...
Yatish04/MicrosoftBackend
testscripts/pyramidserver.py
pyramidserver.py
py
524
python
en
code
0
github-code
6
[ { "api_name": "pdb.set_trace", "line_number": 7, "usage_type": "call" }, { "api_name": "pyramid.view.view_config", "line_number": 5, "usage_type": "call" }, { "api_name": "pyramid.config.Configurator", "line_number": 11, "usage_type": "call" }, { "api_name": "wsgi...
19981883727
import time import requests from bs4 import BeautifulSoup from fake_useragent import UserAgent import datetime import csv import json def get_data(): current_time = datetime.datetime.now().strftime('%m-%d-%Y') with open(f'data/{current_time}_labirint.csv', 'w', newline='', encoding='utf-8-sig') as file: ...
Baradys/scrappers
scrappers/labirint/labirint.py
labirint.py
py
4,771
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "csv.writer", "line_number": 14, "usage_type": "call" }, { "api_name": "fake_useragen...
24458342362
from sklearn.feature_selection import SelectKBest from sklearn.feature_selection import chi2 X = rs_train[['price_per_ticket', 'seat_row', 'paid_full_price', 'paid_online', 'Regular_Ticket', 'age', 'est_income', 'Male', 'married', 'fam_w_kids', 'kids_in_house', 'from_Boston', 'from_MA','game_hour', ...
befitz/ISOM837_RS
feature_selection.py
feature_selection.py
py
996
python
en
code
0
github-code
6
[ { "api_name": "sklearn.feature_selection.SelectKBest", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.feature_selection.chi2", "line_number": 16, "usage_type": "name" } ]
75187431228
from django.conf import settings import jwt from rest_framework import authentication, exceptions from django.contrib.auth.models import User class JWTAuthentication(authentication.BasicAuthentication): def authenticate(self, request): auth_data = authentication.get_authorization_header(request) ...
Limookiplimo/Contacts-API
authentication/backends.py
backends.py
py
835
python
en
code
1
github-code
6
[ { "api_name": "rest_framework.authentication.BasicAuthentication", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.authentication", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.authentication.get_authorization_header", "...
30433642050
import requests from jSona import jSona import pprint pp = pprint.pprint class proImagery : def __init__(self, CONF_PATH) : self.jso = jSona() self.headers = {'json':{'Content-Type':'application/json; charset=utf-8'}} self.config = self.jso.loadJson(CONF_PATH)['IMAGERY'] self.lower...
oimq/proCleaner
proCleaner/proImagery.py
proImagery.py
py
2,349
python
en
code
0
github-code
6
[ { "api_name": "pprint.pprint", "line_number": 4, "usage_type": "attribute" }, { "api_name": "jSona.jSona", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 14, "usage_type": "call" } ]
26201696351
from dolfin import * import math import numpy as np import logging import matplotlib.pyplot as plt from unconstrainedMinimization import InexactNewtonCG logging.getLogger('FFC').setLevel(logging.WARNING) logging.getLogger('UFL').setLevel(logging.WARNING) set_log_active(False) # Set the level of noise: noise_std_dev ...
uvilla/inverse17
Assignment3/tntv.py
tntv.py
py
1,395
python
en
code
3
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.WARNING...
20070392797
import importlib import sys from unittest import mock class MockConfig: def __init__(self): self.bot = mock.MagicMock() self.state = mock.Mock() def set_up_class(cls, *module_names): mock_config = MockConfig() sys.modules['config'] = mock_config try: for module_name in module_names: module = importlib.im...
raylu/sbot
tests/mock_config.py
mock_config.py
py
491
python
en
code
8
github-code
6
[ { "api_name": "unittest.mock.MagicMock", "line_number": 7, "usage_type": "call" }, { "api_name": "unittest.mock", "line_number": 7, "usage_type": "name" }, { "api_name": "unittest.mock.Mock", "line_number": 8, "usage_type": "call" }, { "api_name": "unittest.mock",...
35743712704
import sys import read_write as rw import numpy as np import scipy.sparse from MatrixFactorization import MatrixFactorization if (__name__ == '__main__'): finput_dataset = sys.argv[1] finput_K = (int)(sys.argv[2]) iu_matrix_train_path = "../../Data/" + finput_dataset + "/iu_sparse_matrix_train.npz...
clamli/Dissertation
Baselines/Content-based Active Learning/content_based_active_learning.py
content_based_active_learning.py
py
2,632
python
en
code
28
github-code
6
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "scipy.sparse.sparse.load_npz", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.sparse.s...
2535030622
from pathlib import Path from shutil import move from threading import Thread import logging folders = [] extensions = [] def grabs_folder(path: Path): for el in path.iterdir(): if el.is_dir(): folders.append(el) grabs_folder(el) def sort_file(path: Path): ...
PetroChulkov/web_homework3
file_sorter.py
file_sorter.py
py
1,354
python
en
code
1
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 20, "usage_type": "name" }, { "api_name": "shutil.move", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.error", "line_numbe...
39964228620
import pymysql from tkinter import * from tkinter import messagebox import sys import datetime u=sys.argv[1] p=sys.argv[2] class dropdown: def __init__(self,appen,lis): self.m = StringVar() self.m.set("choose") self.opt=OptionMenu(appen,self.m,*lis) self.opt.grid(row=len(lis),colum...
2HgO/CLASS-SCHEDULER
Scheduler.py
Scheduler.py
py
13,116
python
en
code
1
github-code
6
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pymysql.connect", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "li...
41711840918
import numpy as np from sklearn.model_selection import KFold, TimeSeriesSplit from helpers.settings import * from model.preprocessing_helper import * from model.config import HISTORY_SIZE from datetime import datetime LSTM_STEP = 1 LSTM_FUTURE_TARGET = 1 LSTM_HISTORY = HISTORY_SIZE TRAIN_DATASET_FRAC = 0.8 def gene...
burnpiro/wod-usage-predictor
model/data_preprocessor.py
data_preprocessor.py
py
5,157
python
en
code
0
github-code
6
[ { "api_name": "model.config.HISTORY_SIZE", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 40, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 52, "usage_type": "call" }, { "api_name": ...
15332380058
""" Handle photobooth configuration. """ import os import sys import logging import yaml class Configuration: """ Create configuration object. """ def __init__(self, file): self.logger = logging.getLogger(__name__) self.file = file self._get_config() def _get_config(self...
diablo02000/pyphotobooth
pyphotobooth/libs/configuration.py
configuration.py
py
1,363
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
42647237351
from django.contrib.auth import get_user_model from django.forms import widgets from root import forms_override as forms from root.models import UserGroup, EmailTemplate, EmailGroup, Experiment INITIAL_EMAIL_TEMPLATE = """<html> <body> <h1>{{content}}</h1> </body> </html> """ class RegistrationForm(for...
ograycode/engage
root/forms.py
forms.py
py
4,691
python
en
code
0
github-code
6
[ { "api_name": "root.forms_override.Form", "line_number": 12, "usage_type": "attribute" }, { "api_name": "root.forms_override", "line_number": 12, "usage_type": "name" }, { "api_name": "root.forms_override.CharField", "line_number": 13, "usage_type": "call" }, { "a...
73268144828
import tweepy import tweeting import argparse from time import sleep parser = argparse.ArgumentParser(description="Tweet news stories periodically according to global priorities.") parser.add_argument('-dbg_mode', default=False, type=bool, nargs=1, help="Run in debug mode (default = False)") parser.add_argument('-tw_c...
jaryaman/propNews
main.py
main.py
py
3,030
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 58, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 60, "usage_type": "call" }, { "api_name": "tweeting.tweet_...
20538778289
# https://leetcode.com/problems/word-search-ii/ """ Time complexity:- O(N * M * W), where N and M are the dimensions of the board and W is the total number of characters in the words. Space Complexity:- O(W) """ """ Intuition: The findWords method uses a Trie data structure to efficiently search for words on the boar...
Amit258012/100daysofcode
Day96/word_search_2.py
word_search_2.py
py
2,234
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 23, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 29, "usage_type": "call" } ]
72355994109
#!/usr/bin/python3 """Module that lists all State objects from the database hbtn_0e_6_usa""" from sys import argv from model_state import Base, State from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker if __name__ == '__main__': engine = create_engine('mysql+mysqldb://{}:{}@localhost:330...
MrZooM001/alx-higher_level_programming
0x0F-python-object_relational_mapping/10-model_state_my_get.py
10-model_state_my_get.py
py
672
python
en
code
0
github-code
6
[ { "api_name": "sqlalchemy.create_engine", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "name" }, { "api_name": "model_state.Base.metadata.create_all", "line_number": 14, "usage_type": "call" }, { "api_name":...
70129578749
#-----------------------------------------------------------------------------------------# import torch import matplotlib.pyplot as plt import deepwave from deepwave import scalar import numpy as np import warnings #-----------------------------------------------------------------------------------------# warnings.fil...
PongthepGeo/geophysics_23
codes/seismic/keep/test_forward.py
test_forward.py
py
2,872
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cud...
74977703867
import re import logging import sys import os import yaml from rdflib import ConjunctiveGraph, Literal, URIRef, BNode, Namespace from dipper.graph.Graph import Graph as DipperGraph from dipper.utils.CurieUtil import CurieUtil from dipper import curie_map as curie_map_class from dipper.models.BiolinkVocabulary import ...
monarch-initiative/dipper
dipper/graph/RDFGraph.py
RDFGraph.py
py
7,720
python
en
code
53
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "dipper.graph.Graph.Graph", "line_number": 17, "usage_type": "name" }, { "api_name": "rdflib.ConjunctiveGraph", "line_number": 17, "usage_type": "name" }, { "api_name": "di...
9854004184
from __future__ import (absolute_import, division, print_function, unicode_literals) import math import datetime # For datetime objects import os.path # To manage paths import sys # To find out the script name (in argv[0]) # Import the backtrader platform import backtrader as bt import back...
alfredopzr/backtesting-python
backtrader/strategies/GoldenCross.py
GoldenCross.py
py
3,173
python
en
code
0
github-code
6
[ { "api_name": "backtrader.Strategy", "line_number": 15, "usage_type": "attribute" }, { "api_name": "backtrader.indicators.SMA", "line_number": 20, "usage_type": "call" }, { "api_name": "backtrader.indicators", "line_number": 20, "usage_type": "attribute" }, { "api...
40542696905
from flask import Flask, request, jsonify from flask_mail import Mail, Message import json import sqlalchemy from sqlalchemy import or_,desc from tables import db,GDPs, Impact, ImpactPredicted app = Flask(__name__) app.config['MAIL_SERVER'] = 'smtp.googlemail.com' app.config['MAIL_PORT'] = 587 app.config['MAIL_USE_TL...
aftex261/DigitalOcean
B Sudharsan - CovInsights App/Backend Files/app.py
app.py
py
3,625
python
en
code
5
github-code
6
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_mail.Mail", "line_number": 16, "usage_type": "call" }, { "api_name": "tables.db.init_app", "line_number": 19, "usage_type": "call" }, { "api_name": "tables.db", "line_n...
30578248385
import cv2 from picamera import PiCamera from picamera.array import PiRGBArray import time, socket, logging, configparser, argparse, sys from utils import Utils parser = argparse.ArgumentParser() parser.add_argument('--d', nargs=1, default=None) args = parser.parse_args() APP_DIR = args.d[0] if args.d != None else "....
petkanov/drone-raspberry-py-app
video_streamer.py
video_streamer.py
py
2,824
python
en
code
2
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging...
5707632801
''' Posts routes /posts (args: position, amount) /post (args: id) ''' from flask_api import status from flask import request from flask import Blueprint from service.upload_image import UploadImage from databases.models.post import Post, PostStatus from databases.models.photo import Photo from deco...
Dolzhenkov-Andrii/api
routes/posts.py
posts.py
py
3,478
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 33, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 33, "usage_type": "attribute" }, { "api_name": "flask....
31477418429
#!/usr/bin/env python import argparse import re import json from os.path import isfile def a(lines): return len(lines) def t(requests): stats = {} for dict_ in requests: method = dict_['method'] if method not in stats.keys(): stats[method] = 0 stats[method] += 1 ...
gatart/2021-1-MAILRU-SDET-Python-G-Talamanov
Homework_5/analyze.py
analyze.py
py
4,579
python
en
code
0
github-code
6
[ { "api_name": "re.split", "line_number": 118, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 135, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 143, "usage_type": "call" }, { "api_name": "json.dumps", "...
1439842893
import numpy as np import numpy.random import matplotlib.pyplot as plt import scipy.optimize def jj_cpr_ballistic(gamma, tau): return np.sin(gamma) / np.sqrt(1 - tau * np.sin(gamma/2)**2) def jj_free_energy_ballistic(gamma, tau): return 4 / tau * (1 - np.sqrt(1 - tau * np.sin(gamma/2)**2)) # d/dγ I(γ) def jj...
amba/JJA-solver
JJAsolver/network.py
network.py
py
9,572
python
en
code
0
github-code
6
[ { "api_name": "numpy.sin", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 10, ...
31357541271
import argparse, sys import tornado.ioloop import tornado.gen import time from nats.io.client import Client as NATS def show_usage(): print("nats-sub SUBJECT [-s SERVER] [-q QUEUE]") def show_usage_and_die(): show_usage() sys.exit(1) @tornado.gen.coroutine def main(): # Parse the command line arg...
nats-io/nats.py2
examples/nats-sub/__main__.py
__main__.py
py
1,186
python
en
code
62
github-code
6
[ { "api_name": "sys.exit", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "nats.io.client.Client", "line_number": 32, "usage_type": "call" }, { "api_name": "tornado.ioloop...
71360101948
#!/usr/bin/python3 import os import sys import time import jsonpickle class TODODescription(object): def __init__(self, todoName, startTime = -1) -> None: self.todoName = todoName self.startTime = startTime self.stopTime = -1 def display(self, id=''): print('%s %s' % (str(id),...
Dechode/TODO-App
app.py
app.py
py
5,984
python
en
code
0
github-code
6
[ { "api_name": "jsonpickle.encode", "line_number": 62, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 90, "usage_type": "call" }, { "api_name": "time.time", "line_number": 90, "usage_type": "call" }, { "api_name": "os.path.exists", "line_numb...
27603501009
import io from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.pdfpage import PDFPage from pdfminer.converter import TextConverter from pdfminer.layout import LAParams from langdetect import detect def pdf2string(path): """ From a given pdf path, it creates a string of the pdf...
n1ur0/Document_Clustering
pdfparser.py
pdfparser.py
py
1,484
python
en
code
0
github-code
6
[ { "api_name": "io.StringIO", "line_number": 20, "usage_type": "call" }, { "api_name": "pdfminer.pdfinterp.PDFResourceManager", "line_number": 21, "usage_type": "call" }, { "api_name": "pdfminer.converter.TextConverter", "line_number": 22, "usage_type": "call" }, { ...
34047796819
import argparse from resnet import resnet import os import sys from test import test import tensorflow as tf from read_data import fasionAI_data def parse_args(): parser=argparse.ArgumentParser(description="test resnet for FasionAI") parser.add_argument("--image_data",dest="image_data",\ ...
hx121071/FashionAI_resnet
base/test_net.py
test_net.py
py
1,380
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.exit", "l...
8217311297
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np import sys import math plt.style.use("acaps") """ Compare households owning agricultural land in 2018 and 2019 in the host community. """ # Read in the data df_2018 = pd.read_csv("../../data/processed/MSNA_Host_2018.csv") df_2...
zackarno/coxs_msna_sector_analysis
host_community/analysis/housing_barplots/agri_land.py
agri_land.py
py
1,732
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name"...
36386456035
import altair as alt from vega_datasets import data source = data.cars() chart = alt.Chart(source).mark_circle(size=60, clip=False).transform_calculate( x = alt.datum.Horsepower-100, y = alt.datum.Miles_per_Gallon - 25 ).encode( x=alt.X('x:Q', axis=alt.Axis(offset=-150)), y=alt.Y('y:Q', axis=alt.Axis(...
noahzhy/charts_synthetic_data
test.py
test.py
py
464
python
en
code
0
github-code
6
[ { "api_name": "vega_datasets.data.cars", "line_number": 4, "usage_type": "call" }, { "api_name": "vega_datasets.data", "line_number": 4, "usage_type": "name" }, { "api_name": "altair.Chart", "line_number": 6, "usage_type": "call" }, { "api_name": "altair.datum", ...
36884065642
#!/usr/bin/python3 """ Module for Base class """ import json class Base: """ Base class """ __nb_objects = 0 def __init__(self, id=None): """ ctor for Base Class """ self.id = id if id is None: Base.__nb_objects += 1 self.id = Base.__nb_objects @static...
Samigirum/alx-higher_level_programming
0x0C-python-almost_a_circle/models/base.py
base.py
py
3,403
python
en
code
0
github-code
6
[ { "api_name": "json.dumps", "line_number": 24, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 44, "usage_type": "call" }, { "api_name": "models.rectangle.Rectangle", "line_number": 54, "usage_type": "call" }, { "api_name": "models.square.Square...
10094748311
# coding=utf-8 import MeCab import sys if len(sys.argv) == 1: print("mkdir.py <file> [univ]\n") sys.exit(1) if len(sys.argv) == 3 and sys.argv[2] == 'univ': dictype = '固有名詞' nauntype = '組織' else: dictype = '名詞' nauntype = '一般' tagger = MeCab.Tagger('-Oyomi') out = sys.argv[1].replace(".txt", "....
l-plantarum/chiebukuro
mkdic.py
mkdic.py
py
716
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "MeCab.Tagger", "line_number": 1...
4376865590
import sys import signal import argparse from dictmaster.util import load_plugin last_broadcast_msg = " " def broadcast(msg, overwrite=False): global last_broadcast_msg if overwrite: sys.stdout.write("\r{}".format(" "*len(last_broadcast_msg.strip()))) msg = "\r"+msg else: if last_...
tuxor1337/dictmaster
dictmaster/cli/main.py
main.py
py
2,301
python
en
code
32
github-code
6
[ { "api_name": "sys.stdout.write", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.stdout.write", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.stdout", "l...
40071000142
import collections class Solution(object): def canConstruct(self, ransomNote, magazine): """ :type ransomNote: str :type magazine: str :rtype: bool """ res = collections.Counter(ransomNote) - collections.Counter(magazine) return not res #(res == collections.C...
lucy9215/leetcode-python
383_ransomNote.py
383_ransomNote.py
py
554
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" } ]
8173760199
# Get Networks in Org # Meraki API Reference: # https://developer.cisco.com/meraki/api-latest/#!list-the-networks-that-the-user-has-privileges-on-in-an-organization import tokens import requests import json base_url = "https://api.meraki.com/api/v1" resource_path = f"/organizations/{tokens.ORG_ID}/networks" url = bas...
jtsu/meraki_python
merakiScripts/2_getNetworks.py
2_getNetworks.py
py
633
python
en
code
1
github-code
6
[ { "api_name": "tokens.ORG_ID", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tokens.API_KEY", "line_number": 18, "usage_type": "attribute" }, { "api_name": "requests.request", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dumps", ...
36797461084
"""Utility for ROC-AUC Visualization""" import matplotlib.pyplot as plt from src.utils import infoutils def plot_signle_roc_auc(cfg, auc, fpr, tpr): """ Plots signel ROC Curve Args: cfg (cfgNode): Model configurations auc (float): Area under the ROC curve fpr (list): False positiv...
KhaledElTahan/Real-World-Anomaly-Detection
src/visualization/roc_auc.py
roc_auc.py
py
1,016
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 18, "usage_type": "call" }, { "api_name": "mat...
73363651708
#только приватный доступ import requests import munch #получить список доменов #i.ivanov headers = { 'PddToken': 'F4KTVIPLCFULRWCDFGJIKNGUPEWQUEMSKDG7DDFJZDPILB3JXLOQ'} #x@yandex headers = { 'PddToken': 'E7UIU2AHR33EOXDJ5W6R2Q2WRNW4TGCI5MZ2U6DOX5YKBEJW334A' } url = 'https://pddimp.yandex.ru/api2/admin/domain/domains?'...
expo-lux/scripts
python/x_createuser.py
x_createuser.py
py
1,573
python
ru
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "munch.munchify", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.post", "line_n...
72169387389
""" One table verb initializations """ import itertools from .operators import DataOperator from .expressions import Expression __all__ = ['define', 'create', 'sample_n', 'sample_frac', 'select', 'rename', 'distinct', 'unique', 'arrange', 'group_by', 'ungroup', 'group_indices', 'summarize', ...
has2k1/plydata
plydata/one_table_verbs.py
one_table_verbs.py
py
34,171
python
en
code
271
github-code
6
[ { "api_name": "operators.DataOperator", "line_number": 18, "usage_type": "name" }, { "api_name": "itertools.chain", "line_number": 73, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 74, "usage_type": "call" }, { "api_name": "expressions.Ex...
17625793432
from __future__ import print_function, division import os from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Activation from keras.layers import BatchNormalization from keras.layers.advanced_activations import LeakyReLU, ReLU from keras.models import Sequential, Model from keras.optimizers import Adam ...
royalsalute/fraud-creditcard-detection
alphagan.py
alphagan.py
py
12,147
python
en
code
1
github-code
6
[ { "api_name": "os.path.exists", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 21, "usage_type": "call" }, { "api_name": "keras.losses.BinaryCrossentro...
70107497149
from bs4 import BeautifulSoup import requests from pprint import pprint def main(): url = 'https://remote.co' remote_co_html = requests.get(url) soup = BeautifulSoup(remote_co_html.content,"html.parser") #the_main_class = soup.find("body",class_="home blog remote-co").main.find("div",class_="contai...
cthacker-udel/Python-WebScraper
remoteCoScraper.py
remoteCoScraper.py
py
1,208
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 24, "usage_type": "call" } ]
13209639303
import PIL import pyautogui def popper(): while True: try: box = pyautogui.locateOnScreen("C:/Users/Bryan/Documents/GitHub/Cuhacking/decline.png", confidence = 0.55) loc = pyautogui.center(box) print(loc) pyautogui.click(loc.x, loc.y) break ...
RogerLamTd/Cuhacking
AutomatedQueuePopper/League.py
League.py
py
374
python
en
code
0
github-code
6
[ { "api_name": "pyautogui.locateOnScreen", "line_number": 8, "usage_type": "call" }, { "api_name": "pyautogui.center", "line_number": 9, "usage_type": "call" }, { "api_name": "pyautogui.click", "line_number": 11, "usage_type": "call" } ]
8034052289
#Prototype 4 # importing the necessary libraries import cv2 import numpy as np import numpy as np import os import cv2 # defining the crack detector function # here weak_th and strong_th are thresholds for # double thresholding step def PCD(img, weak_th = None, strong_th = None): # c...
thanhtung48c/AUV-Crack-Detection-Model
script.py
script.py
py
5,431
python
en
code
0
github-code
6
[ { "api_name": "cv2.cvtColor", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.GaussianBlur", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.Sobel", ...
7606759311
import datetime import time from .. import emails from ..database import get_sql_connection from ..models import Account, Session as SqlSession __description__ = 'Send out summary emails.' def send_out_emails(): session = SqlSession() today = datetime.date.today() accounts = session.query(Account) \ ...
thomasleese/gantt-charts
ganttcharts/cli/send_summary_emails.py
send_summary_emails.py
py
1,214
python
en
code
0
github-code
6
[ { "api_name": "models.Session", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 15, "usage_type": "attribute" }, { "api_name": "models.Account"...
75241216826
from typing import Any, Type from aiohttp import BasicAuth from ..internal.gateway import Gateway from ..internal.http import HTTPClient from .cache import CacheStore, Store _BASE_MODELS: dict[Any, Any] = {} class State: """The central bot cache.""" def __init__( self, token: str, ...
VincentRPS/pycv3
pycord/state/core.py
core.py
py
1,011
python
en
code
0
github-code
6
[ { "api_name": "typing.Any", "line_number": 9, "usage_type": "name" }, { "api_name": "aiohttp.BasicAuth", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 27, "usage_type": "name" }, { "api_name": "cache.Store", "line_numbe...
2966396264
''' @File : ImageReward.py @Time : 2023/02/28 19:53:00 @Auther : Jiazheng Xu @Contact : xjz22@mails.tsinghua.edu.cn @Description: ImageReward Reward model for reward model. ''' import os import torch import torch.nn as nn import torch.nn.functional as F from PIL import Image from config.op...
THUDM/ImageReward
train/src/ImageReward.py
ImageReward.py
py
8,579
python
en
code
761
github-code
6
[ { "api_name": "torchvision.transforms.InterpolationMode.BICUBIC", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torchvision.transforms.InterpolationMode", "line_number": 21, "usage_type": "name" }, { "api_name": "PIL.Image.BICUBIC", "line_number": 23, "us...
14959398109
from mock import Mock from yoti_python_sandbox.doc_scan.check import SandboxZoomLivenessCheckBuilder from yoti_python_sandbox.doc_scan.check.report.breakdown import SandboxBreakdown from yoti_python_sandbox.doc_scan.check.report.recommendation import ( SandboxRecommendation, ) def test_zoom_liveness_check_should...
getyoti/yoti-python-sdk-sandbox
yoti_python_sandbox/tests/doc_scan/check/test_sandbox_liveness_check.py
test_sandbox_liveness_check.py
py
1,243
python
en
code
0
github-code
6
[ { "api_name": "mock.Mock", "line_number": 11, "usage_type": "call" }, { "api_name": "yoti_python_sandbox.doc_scan.check.report.recommendation.SandboxRecommendation", "line_number": 11, "usage_type": "name" }, { "api_name": "mock.Mock", "line_number": 12, "usage_type": "ca...
21884345926
import cv2 def distance(p1, p2): # D8 distance return max(abs(p1[0] - p2[0]), abs(p1[1] - p2[1])) def gamma(img): totalpixels = img.shape[0] * img.shape[1] color_dict = {} for i in range(len(img)): for j in range(len(img[i])): tc = tuple(img[i][j]) if (tc in color_dict): color_dict[tc].append((i, j))...
NitigyaPant/MCA_assignment
test.py
test.py
py
1,025
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 36, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 37, "usage_type": "call" } ]
74083767549
from django.core import checks from django.core.checks import Warning from django.test import SimpleTestCase, override_settings class SystemChecksTestCase(SimpleTestCase): def test_checks(self): errors = checks.run_checks() assert errors == [] with override_settings( INSTALLED...
boxine/django-huey-monitor
huey_monitor_project/tests/test_checks.py
test_checks.py
py
790
python
en
code
69
github-code
6
[ { "api_name": "django.test.SimpleTestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "django.core.checks.run_checks", "line_number": 8, "usage_type": "call" }, { "api_name": "django.core.checks", "line_number": 8, "usage_type": "name" }, { "api_name...
27812632483
import sys from osgeo import ogr fn=r'D:\BackUp\projectsBackup\Qgis\pygis\res\ne_50m_populated_places.shp' ds=ogr.Open(fn,0) if ds is None: sys.exit('could not open {0}.'.format(fn)) lyr=ds.GetLayer(0) #此图层要素总量 num_features=lyr.GetFeatureCount() print(num_features) #根据要素编号Fid获取对应图层 third_feature=lyr.GetFeature(nu...
xuewenqian/pythonGis
ogr/获取特定的要素.py
获取特定的要素.py
py
406
python
en
code
0
github-code
6
[ { "api_name": "osgeo.ogr.Open", "line_number": 5, "usage_type": "call" }, { "api_name": "osgeo.ogr", "line_number": 5, "usage_type": "name" }, { "api_name": "sys.exit", "line_number": 7, "usage_type": "call" } ]
6123307630
import os import sys import shutil import logging import argparse import warnings import re from pathlib import Path from ..backend_funcs.convert import parse_validator import subprocess as sub import pandas as pd logging.basicConfig(level=logging.INFO) logger = logging.getLogger('fw-heudiconv-validator') def escape...
PennLINC/fw-heudiconv
fw_heudiconv/cli/validate.py
validate.py
py
4,603
python
en
code
5
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "re.compile", ...
4971500738
import socket import threading import datetime def acao_cliente(client_socket, client_address): current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") print(f"Conexão recebida de {client_address[0]}:{client_address[1]} em {current_time}") with open("honeypot_log.txt", "a") as log_f...
T0tsuK4/honeypot
honeypot.py
honeypot.py
py
1,673
python
en
code
2
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "socket.socket", "line_number": 41, "usage_type": "call" }, { "api_name": "socket.AF_IN...
30575033790
from DataEngine.DataAdapters.MongoAdapter.MongoAdapter import MongoAdapter from Domain.EquityCorporateData import EquityCorporateData from Domain.BuildEnumMethods import BuildEnumMethods from datetime import date ma : MongoAdapter = MongoAdapter() testEquity = EquityCorporateData().build( method = BuildEnumM...
jminahan/backtest_framework
DataEngine/Tests/DataAdapters/MongoAdapter/MongoAdapterTest.py
MongoAdapterTest.py
py
1,494
python
en
code
0
github-code
6
[ { "api_name": "DataEngine.DataAdapters.MongoAdapter.MongoAdapter.MongoAdapter", "line_number": 7, "usage_type": "name" }, { "api_name": "Domain.EquityCorporateData.EquityCorporateData", "line_number": 9, "usage_type": "call" }, { "api_name": "Domain.BuildEnumMethods.BuildEnumMeth...
19700703411
import discord from discord.ext import commands import urllib.parse, urllib.request import requests import googlesearch import re import json bot = commands.Bot(description = "Im just a Kid", command_prefix ="@") @bot.event async def on_ready(): print("IM READYYY") @bot.command(pass_context=True) async def searc...
TestingYG/ProjectDumButt
DumButtv2.py
DumButtv2.py
py
7,169
python
en
code
1
github-code
6
[ { "api_name": "discord.ext.commands.Bot", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 31, "usage_type": "call" }, { "api_name": "requests.Sessi...
22850158142
#!/usr/bin/env python # coding: utf-8 from bs4 import BeautifulSoup as bs import pandas as pd from splinter import Browser import requests from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager executable_path = {'executable_path': ChromeDriverManager().install()} browser = Browser(...
iegatlanta/web-scraping-challenge
Mission_to_Mars/scrape_mars.py
scrape_mars.py
py
2,817
python
en
code
0
github-code
6
[ { "api_name": "webdriver_manager.chrome.ChromeDriverManager", "line_number": 13, "usage_type": "call" }, { "api_name": "splinter.Browser", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 26, "usage_type": "call" }, { "a...
16046421800
from tkinter import * from tkinter.messagebox import* import sqlite3 root4=Tk() h,w=root4.winfo_screenheight(),root4.winfo_screenwidth() root4.geometry('%dx%d+0+0'%(w,h)) bus4=PhotoImage(file='.\\Bus_for_project.png') Label(root4,image=bus4).grid(row=0,column=0,columnspan=12,padx=w/2.5) Label(root4,text='...
akarshi19/Online-Bus-Booking-System
bus_route.py
bus_route.py
py
2,568
python
en
code
1
github-code
6
[ { "api_name": "sqlite3.Connection", "line_number": 20, "usage_type": "call" } ]
38088951612
# -*- coding: utf-8 -*- """ Production Mapper Michael Troyer michael.troyer@usda.gov """ import datetime import os import traceback from collections import defaultdict import arcpy arcpy.env.addOutputsToMap = False arcpy.env.overwriteOutput = True ##---Functions-----------------------------------------------...
MichaelTroyer/ArcGIS_NRCS_Production_Mapper
Production_Mapper.pyt
Production_Mapper.pyt
pyt
8,168
python
en
code
1
github-code
6
[ { "api_name": "arcpy.env", "line_number": 20, "usage_type": "attribute" }, { "api_name": "arcpy.env", "line_number": 21, "usage_type": "attribute" }, { "api_name": "arcpy.AddFieldDelimiters", "line_number": 32, "usage_type": "call" }, { "api_name": "arcpy.Describe...
32279135386
#!/usr/bin/env python """Simple script to fetch data from the bslparlour home stream""" import datetime import os import subprocess as sp import yaml import tweepy import myconf def dictify(results): return_dict = dict() for result in results: return_dict[result.id] = result return return_dict ...
natfarleydev/mr-retweet
get_tweet_data.py
get_tweet_data.py
py
1,627
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, ...
8770897157
import asyncio import logging import sys import time import pyautogui import pydirectinput import qasync from PySide6 import QtWidgets, QtCore from front import Ui_MainWindow def use_quick_access_inventory(): print("Use quick access of inventory") pydirectinput.keyDown('1') time.sleep(0.1) pydirectin...
arekszatan/botClicker
InsomniaBot.py
InsomniaBot.py
py
6,684
python
en
code
0
github-code
6
[ { "api_name": "pydirectinput.keyDown", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "pydirectinput.keyUp", "line_number": 17, "usage_type": "call" }, { "api_name": "pydirectinput.ke...
46051636676
# -*- coding: utf-8 -*- from django.shortcuts import render, redirect, get_object_or_404 from django.urls import reverse from django.contrib import messages from django.utils.translation import gettext as _ from djconfig import config from spirit.core.utils.views import is_post, post_data from spirit.core.utils.pagi...
nitely/Spirit
spirit/comment/flag/admin/views.py
views.py
py
1,916
python
en
code
1,153
github-code
6
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 19, "usage_type": "call" }, { "api_name": "models.CommentFlag", "line_number": 19, "usage_type": "argument" }, { "api_name": "forms.CommentFlagForm", "line_number": 20, "usage_type": "call" }, { "a...
2768444611
import pandas as pd import math from sklearn import linear_model import numpy as np def predict_using_sklearn(): test_scores = pd.read_csv(r'C:\Users\Polina\Desktop\Python\Pandas\test_scores.csv') reg = linear_model.LinearRegression() reg.fit(test_scores[['math']], test_scores.cs) return reg.c...
CarlBrendt/Data-Analysis
Gradient_descent_with_no_train_test.py
Gradient_descent_with_no_train_test.py
py
1,356
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.linear_model", "line_number": 8, "usage_type": "name" }, { "api_name"...
72757346749
from syscore.objects import arg_not_supplied from syscore.genutils import flatten_list from dataclasses import dataclass import pandas as pd EMPTY_INSTRUMENT = "" class futuresInstrument(object): def __init__(self, instrument_code: str): self._instrument_code = instrument_code @property def inst...
ahalsall/pysystrade
sysobjects/instruments.py
instruments.py
py
9,474
python
en
code
4
github-code
6
[ { "api_name": "dataclasses.dataclass", "line_number": 40, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 65, "usage_type": "name" }, { "api_name": "syscore.genutils.flatten_list", "line_number": 113, "usage_type": "call" }, { "api_na...
26038332576
from __future__ import annotations import pytest @pytest.mark.parametrize( "variables, expected_data", [ ( {"name": r"pants_explorer\."}, { "rules": [ {"name": "pants_explorer.server.graphql.rules.get_graphql_uvicorn_setup"}, ...
pantsbuild/pants
pants-plugins/pants_explorer/server/graphql/query/rules_test.py
rules_test.py
py
1,078
python
en
code
2,896
github-code
6
[ { "api_name": "pytest.mark.parametrize", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" } ]
39254517776
from django.db import models from django.db.models import Case, Count, IntegerField, When class CountryManager(models.Manager): def aggregate_integration_statuses(self): from proco.connection_statistics.models import CountryWeeklyStatus return self.get_queryset().aggregate( countries_j...
unicef/Project-Connect-BE
proco/locations/managers.py
managers.py
py
1,353
python
en
code
2
github-code
6
[ { "api_name": "django.db.models.Manager", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.Count", "line_number": 9, "usage_type": "call" }, { "api_name": "dj...
3580079410
import json from statistics import mean import numpy as np import os from bokeh.plotting import output_file, figure, save from bokeh.layouts import gridplot from src.utils.tools import listdir, hash_append def combined(ids, name, legend=None, y_range=(0, 900)): summaries = {} episodes = [] for key_ in set...
MatthijsBiondina/WorldModels
planet/plots.py
plots.py
py
4,228
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "src.utils.tools.hash_append", ...
41475591670
import httpx import asyncio import logging import discord from discord.ext import tasks from redbot.core import Config, commands IDENTIFIER = 4175987634255572345 # Random to this cog ishtakar_world_id = "3f1cd819f97e" default_server = "Ishtakar" realm_data_url = "https://nwdb.info/server-status/data.json" default...
psykzz/cogs
nw_server_status/server_status.py
server_status.py
py
8,630
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 22, "usage_type": "attribute" }, { "api_name": "redbot.core.commands.Cog", "line_number": 25, "usage_type": "attribute" }, { "api_name": "re...
15366112732
import numpy as np import os try: import welib.fastlib.fastlib as fastlib except: import fastlib def CPLambdaExample(): """ Example to determine the CP-CT Lambda Pitch matrices of a turbine. This scrip uses the function CPCT_LambdaPitch which basically does the same as ParametricExample above. ...
rhaghi/welib
welib/fastlib/_examples/Example_CPLambdaPitch.py
Example_CPLambdaPitch.py
py
1,520
python
en
code
null
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 19, "usage_type": "call" }, { "api_name": "fastlib.CPCT_LambdaPitch", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
72531866429
from typing import Final import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSONB from ._common import column_created_datetime, column_modified_datetime from .base import metadata # Intentionally includes the term "SECRET" to avoid leaking this value on a public domain VENDOR_SECRET_PREFIX: Final[str...
ITISFoundation/osparc-simcore
packages/postgres-database/src/simcore_postgres_database/models/services_environments.py
services_environments.py
py
2,469
python
en
code
35
github-code
6
[ { "api_name": "typing.Final", "line_number": 10, "usage_type": "name" }, { "api_name": "sqlalchemy.Table", "line_number": 13, "usage_type": "call" }, { "api_name": "base.metadata", "line_number": 22, "usage_type": "argument" }, { "api_name": "sqlalchemy.Column", ...
1921452426
import pyomo.environ as pe from lci import LifeCycleInventory from superstructure import Superstructure from utils.properties import molar_weight from utils.utils import sum_rule from utils.save_results import ResultManager from utils.solve_model import Solver import time as time import pickle def range_len(start, st...
jkleinekorte/millgas2what
src/repeated_solving_el_impact.py
repeated_solving_el_impact.py
py
15,332
python
en
code
1
github-code
6
[ { "api_name": "lci.LifeCycleInventory", "line_number": 24, "usage_type": "call" }, { "api_name": "lci.model", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pyomo.environ.ConcreteModel", "line_number": 26, "usage_type": "call" }, { "api_name": "pyo...
70106082748
''' 1. import opencv 2. load image 3. load model 4. adjuct image gray 5. Check and mark face 3. create window 4. show image 5. pause window 6. close window ''' import numpy as np import cv2 # print(cv2.__version__) # Load image img = cv2.imread("./images/ufc.jpeg") # Load model face_cascade = cv2.C...
benjaminhuanghuang/opencv-study
cv-find-face.py
cv-find-face.py
py
900
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", ...
36849582573
import os os.chdir("/home/ghiggi/Projects/deepsphere-weather") import sys sys.path.append("../") import shutil import argparse import dask import glob import time import torch import zarr import numpy as np import xarray as xr ## DeepSphere-Weather from modules.utils_config import read_config_file from modules.utils...
deepsphere/deepsphere-weather
dev/w_debug_predictions.py
w_debug_predictions.py
py
15,927
python
en
code
56
github-code
6
[ { "api_name": "os.chdir", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number":...
2727040132
import pathlib data_folder = pathlib.Path('data') # print(data_folder.exists(), data_folder.is_dir()) def make_text(i): text = "" text += str(i) + "\n" text += str(i * 24) + "\n" text += (i * 12) * "#" return text for i in range(20): label = str(i).zfill(4) + "." + ("ihatezoom" * i) f = ...
elliewix/IS305-2022-Fall
week 5/monday.py
monday.py
py
399
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 3, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" } ]
7265936310
import pandas as pd import numpy as np from matplotlib import pyplot as plt from pylab import * mpl.rcParams['font.sans-serif'] = ['SimHei'] res = {} for i in range(1, 16): # 统计15天的新增人数 fileNameStr = './202012' + str(i).zfill(2) + '.csv' # 产生文件名进行读取 df = pd.read_csv(fileNameStr, encoding='utf-8') df['in...
Seizzzz/DailyCodes
Course 202009/Python/final/c.py
c.py
py
1,009
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 13, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.title", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
73944785148
import pathlib import numpy as np import h5py import cv2 import argparse def load_episodes(directory, capacity=None): # The returned directory from filenames to episodes is guaranteed to be in # temporally sorted order. filenames = sorted(directory.glob('*.npz')) if capacity: num_steps = 0 ...
conglu1997/v-d4rl
conversion_scripts/npz_to_hdf5.py
npz_to_hdf5.py
py
2,833
python
en
code
64
github-code
6
[ { "api_name": "numpy.load", "line_number": 26, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 47, "usage_type": "call" }, { "api_name": "pathlib.Path", "lin...
17371120296
import json from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase, APIClient from django.contrib.auth import get_user_model from rest_framework_simplejwt.tokens import RefreshToken User = get_user_model() AUTHOR = 'author' EXECUTOR = 'executor' AUTHOR_EMAIL = '...
vavsar/freelance_t
tests/users/test_views.py
test_views.py
py
4,583
python
en
code
1
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 20, "usage_type": "call" }, { "api_name": "rest_framework.test.APITestCase", "line_number": 25, "usage_type": "name" }, { ...
42510539573
import os from cffi import FFI from OpenSSL.SSL import Context as SSLContext, _ffi, _lib as lib from utils import OutputGrabber ffi = FFI() NULL = ffi.NULL ffi.cdef( "int SSL_CTX_set_client_cert_engine(void *ctx, void *e);" "int ENGINE_set_default(void *e, unsigned int flags);" ) libcrypto = ffi.dlopen("libcr...
jose-pr/openssl-engines
src/openssl_engines.py
openssl_engines.py
py
4,561
python
en
code
0
github-code
6
[ { "api_name": "cffi.FFI", "line_number": 7, "usage_type": "call" }, { "api_name": "cffi.FFI.CData", "line_number": 30, "usage_type": "attribute" }, { "api_name": "cffi.FFI", "line_number": 30, "usage_type": "name" }, { "api_name": "OpenSSL.SSL._lib.ENGINE_init", ...