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
9386790051
from turtle import color import discord import random import os import asyncio import json import requests import time from discord.ext import commands, tasks from discord.ext.commands import has_permissions from itertools import cycle from dotenv import load_dotenv load_dotenv() TOKEN = os.getenv("TOKEN") client =...
Siwan-SR/hogwarts
main.py
main.py
py
11,982
python
en
code
0
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 19, "usage_type": "call" }, { "api_name": "discord.ext.com...
27708885859
#!/usr/bin/env python3 import os import sys import subprocess as sp from glob import glob from shutil import rmtree from setuptools import setup, find_packages, Command class ST_cmd(Command): description = "foo" user_options = [] def initialize_options(self): pass def finalize_options(self):...
9001/softchat
setup.py
setup.py
py
3,257
python
en
code
27
github-code
1
[ { "api_name": "setuptools.Command", "line_number": 10, "usage_type": "name" }, { "api_name": "shutil.rmtree", "line_number": 25, "usage_type": "call" }, { "api_name": "subprocess.check_call", "line_number": 43, "usage_type": "call" }, { "api_name": "os.environ.cop...
12889215777
from service.base import BaseService import requests import json import config class UserService(BaseService): def __init__(self, db, rs): super().__init__(db, rs) UserService.inst = self def login(self, req, data={}): ''' username, password ''' url = self.add_c...
allenwhalecs03/nctu_hackathon
backend/service/user.py
user.py
py
2,058
python
en
code
0
github-code
1
[ { "api_name": "service.base.BaseService", "line_number": 6, "usage_type": "name" }, { "api_name": "config.BASE_URL", "line_number": 15, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dumps...
38177825177
import sys import h5py import logging import warnings from pathlib import Path import torch import numpy as np from scipy.ndimage import zoom from unet3d import Basic3DUNet warnings.filterwarnings(action='ignore', category=UserWarning) log = logging.getLogger(__name__) PAD = 64 def segment_mitochondria(input_path,...
sanketx/mitochondria_segmentation
src/segmentation_utils.py
segmentation_utils.py
py
3,799
python
en
code
3
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "h5py.Dataset", "line_number": 30, "usage_type": "attribute" }, { "api_name": "h5py.File...
17360256705
"""add nr refund requested state Revision ID: 8b99aacb139b Revises: 07563e18d763 Create Date: 2020-11-30 10:43:13.218082 """ from alembic import op from sqlalchemy import Table, MetaData # revision identifiers, used by Alembic. revision = '8b99aacb139b' down_revision = '07563e18d763' branch_labels = None depends_on...
bcgov/namex
api/migrations/versions/8b99aacb139b_add_nr_refund_requested_state.py
8b99aacb139b_add_nr_refund_requested_state.py
py
897
python
en
code
6
github-code
1
[ { "api_name": "sqlalchemy.MetaData", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op.get_bind", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Table",...
36370333553
#!/usr/bin/env python import os import time import argparse from datetime import datetime from pvaserver import config from pvaserver import adsimserver from pvaserver import log from pvaserver import __version__ def init(args): if not os.path.exists(str(args.config)): config.write(args.config) else:...
decarlof/pvaServer
src/pvaserver/__main__.py
__main__.py
py
3,454
python
en
code
0
github-code
1
[ { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pvaserver.config.write", "line_number": 15, "usage_type": "call" }, { "api_name": "pvaserver.config",...
6494066267
from collections import deque n = int(input()) card=[] for i in range(n): card.append(int(input())) card.sort() q = deque(card) num = q.popleft() for i in range(n-1): num += q.popleft() q.insert(0, num) print(sum(q))
JoonseoKang/coding_test
Sorting/q4.py
q4.py
py
233
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 9, "usage_type": "call" } ]
20062808348
from functools import reduce from typing import List, Iterator, Tuple, Callable from aoc_2021.day_03.input import puzzle_input test_input = [ 0b00100, 0b11110, 0b10110, 0b10111, 0b10101, 0b01111, 0b00111, 0b11100, 0b10000, 0b11001, 0b00010, 0b01010, ] def bits(n: int)...
kicsikrumpli/adventofcode-2021
aoc_2021/day_03/puzzle_2.py
puzzle_2.py
py
3,182
python
en
code
0
github-code
1
[ { "api_name": "typing.Iterator", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.List", "line_numbe...
15971452841
from aiida.orm.calculation.job.vasp.vasp import VaspCalculation from aiida.orm import DataFactory, Code from aiida.common.folders import Folder import pymatgen as pmg import sys #~ vc = VaspCalculation() incar = {'SYSTEM': 'TestSystem', 'ediff': 1E-5, 'GGA_COMPAT': False, } poscar = pmg.io....
greschd/aiida-vasp
test/test_sub.py
test_sub.py
py
1,029
python
en
code
null
github-code
1
[ { "api_name": "pymatgen.io.vasp.Poscar.from_file", "line_number": 13, "usage_type": "call" }, { "api_name": "pymatgen.io", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "aiid...
12062140487
#save multiple-scatter data as in notebook: nrFano_Constraint/ms_simulation_yield.ipynb import numpy as np import pandas as pd import sima2py as sapy import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import h5py warnings.resetwarnings() #get the equivalent charge energy for a recoil of e...
villano-lab/nrFano_paper2019
python/ms_save.py
ms_save.py
py
2,277
python
en
code
2
github-code
1
[ { "api_name": "warnings.simplefilter", "line_number": 6, "usage_type": "call" }, { "api_name": "warnings.resetwarnings", "line_number": 8, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.zeros", ...
37571781625
#!/usr/bin/python import indicoio import json from os import listdir indicoio.config.api_key = 'a43cdf55368bc533dc45c5686188466c' features = [] # Get all image files in the images meme folder all_memes = [f for f in listdir('memes') if (str(f) != '.DS_Store')] size = all_memes.__len__() # Open the memedb to see wh...
SDupZ/memex
utils/featuresDump.py
featuresDump.py
py
1,285
python
en
code
2
github-code
1
[ { "api_name": "indicoio.config", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "indicoio.image_features", ...
6653271407
import os from torchvision import transforms from PIL import Image path1 = "data/imagenet/train" path2 = "data/imagenet/val" path_useless = "data/useless" pic_paths = [] i = os.listdir(path1) for j in i: k = os.listdir(os.path.join(path1, j)) for l in k: pic_paths.append(os.path.join(path1, j, l)) i = os.lis...
u-i-r/my-swin-test
my-swin-gpu/check_data.py
check_data.py
py
712
python
en
code
0
github-code
1
[ { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, ...
31828817238
# -*- coding: utf-8 -*- """ Created on Wed Jul 14 16:49:47 2021 @author: MI2 """ import pandas as pd import numpy as np from matplotlib import pyplot as plt import tia.bbg.datamgr as dm from datetime import date as dt import statsmodels.api as sm from YoY import * dataPeriod = 'WEEKLY' startDate = dt(2...
tommyoneil/Market-Models
OLS Regression Models/FedvValueLine.py
FedvValueLine.py
py
1,783
python
en
code
0
github-code
1
[ { "api_name": "datetime.date", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 17, "usage_type": "call" }, { "api_name": "tia.bbg.datamgr.BbgDataManager", "line_number": 21, "usage_type": "call" }, { "api_name": "tia.bbg.da...
32150094695
import os.path import json from azure.mgmt.resource import ResourceManagementClient from azure.mgmt.resource.resources.models import DeploymentMode from azure.identity import DefaultAzureCredential subscription_id = os.getenv("AZURE_SUBSCRIPTION_ID") resource_group = os.getenv("AZURE_RESOURCE_GROUP") identity = os.ge...
microsoft/ccfdns
tests/service/deploy.py
deploy.py
py
1,414
python
en
code
7
github-code
1
[ { "api_name": "os.path.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, ...
15409786223
import sys import requests import json import math import numpy as np import numpy.linalg as nla import matplotlib.pyplot as plt def SplitWord(word): return [char for char in word] def function1(x): return math.cos(x) * x def function2(x): return 1/x def function3(x): return x**2 -2*x - 1 d...
trosnerMSU/NumericalAnalysisFunctions
NumericalAnalysis/venv/practice.py
practice.py
py
7,571
python
en
code
0
github-code
1
[ { "api_name": "math.cos", "line_number": 13, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 25, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.append", "line_number": 30, ...
20117487881
import torch import torch.nn as nn import torch.nn.functional as F from det_ae import DAE from Doric import ProgColumnGenerator from Doric import ProgConv2DBlock, ProgLambdaBlock, ProgDenseBlock, ProgColumn def loadPrognet(prognet, colList, filepath): for t in colList: prognet.addColumn(ms...
arcosin/Task_Detector
minatar/common.py
common.py
py
2,996
python
en
code
0
github-code
1
[ { "api_name": "torch.load", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_...
72848128033
"""Nox sessions.""" import tempfile from typing import Any import nox from nox.sessions import Session nox.options.sessions = "isort", "autopep8", "black", "mypy", "safety", "tests" package = "project_name" locations = "src", "tests", "noxfile.py", "docs/conf.py" def install_with_constraints(session: Session, *args...
fabriziobonavita/python-rest-template
noxfile.py
noxfile.py
py
2,825
python
en
code
0
github-code
1
[ { "api_name": "nox.options", "line_number": 8, "usage_type": "attribute" }, { "api_name": "nox.sessions.Session", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 13, "usage_type": "name" }, { "api_name": "tempfile.NamedTempora...
40829019139
import os import random import torch import torchvision.transforms as transforms from torchvision.datasets import CIFAR10 from torchvision.datasets import CIFAR100 from torchvision.datasets import ImageFolder def cifar10_data(batchsize, workers): normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], ...
xfey/RMI-NAS
utils/loader.py
loader.py
py
3,342
python
en
code
1
github-code
1
[ { "api_name": "torchvision.transforms.Normalize", "line_number": 11, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 14, "usage_type": "call" }, { ...
3860115203
#! /usr/bin/env/python import csv import time import pandas from collections import defaultdict orderBaseDict = {} orderIdDict = defaultdict(list) prodIdDict = {} deptIdDict = {} allDetailsList = [] filename = 'order_products__prior.csv' filename2 = 'departments.csv' csv_delimiter = ',' print(time.strftime("%Y-%m-%d ...
Pragad/LearnPython
ReadCSVFile.py
ReadCSVFile.py
py
1,153
python
en
code
0
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 16, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 20, "usage_type": "call" }, { "api_name": "time.strftime", "...
27510686659
""" Author: alberto.suarez@uam.es Coauthors: joseantonio.alvarezo@estudiante.uam.es franciscojavier.saez@estudiante.uam.es """ from typing import Callable, Tuple import numpy as np from scipy.spatial import distance from sklearn.preprocessing import normalize from sklearn.utils.extmath import svd_fli...
fjsaezm/mcd-mf
HW_02/kernel_machine_learning.py
kernel_machine_learning.py
py
6,694
python
en
code
0
github-code
1
[ { "api_name": "numpy.ndarray", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.ndarra...
25719224670
import torch import torch.nn as nn from rl_squared.networks.modules.distributions.bernoulli.fixed_bernoulli import ( FixedBernoulli, ) from rl_squared.utils.torch_utils import init_module class Bernoulli(nn.Module): def __init__(self, num_inputs: int, num_outputs: int): """ Initialize the Ber...
bay3s/rl-squared
rl_squared/networks/modules/distributions/bernoulli/bernoulli.py
bernoulli.py
py
989
python
en
code
3
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "rl_squared.utils.torch_utils.init_module", "line_number": 21, "usage_type": "call" }, { "api_name":...
22015366361
import psutil print(f'Number of CPUs: {psutil.cpu_count()}') p = psutil.Process() arr_cpus = [i for i in range(60,66)] p.cpu_affinity(arr_cpus) print(f'CPU pool after assignment ({len(arr_cpus)}): {p.cpu_affinity()}') import warnings warnings.filterwarnings("ignore") comd = [ 'Add a room in the top left with si...
hmhuy2000/maze_diffusion
inference.py
inference.py
py
4,021
python
en
code
0
github-code
1
[ { "api_name": "psutil.cpu_count", "line_number": 2, "usage_type": "call" }, { "api_name": "psutil.Process", "line_number": 3, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.is_a...
18641918068
from flask import Flask, session, jsonify, request import pandas as pd import numpy as np import pickle #import create_prediction_model import scoring# from scoring import score_model from diagnostics import model_predictions, dataframe_summary, missing_values, execution_time, outdated_packages_list #import pr...
msinha251/Udacity_MLDevops_C4_Project
project-files/app.py
app.py
py
2,927
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 20, "usage_type": "call" }, { "api_name": "json.load", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": ...
11572312927
from collections import deque # 깊이 우선 def dfs(v): print(v, end = ' ') visited[v] = True for e in adj[v]: if not(visited[e]): dfs(e) # 너비 우선 def bfs(v): q = deque([v]) while q: v = q.popleft() if not (visited[v]): visited[v] = True print(v...
hyojeong00/BOJ
boj1260.py
boj1260.py
py
1,981
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" } ]
19066943439
from datetime import datetime from django.contrib.auth.models import User, Group from rest_framework import serializers from ClimateBox.settings import HUB_SECRET_KEY_LENGTH from hub.models import Readout, Device, Alert class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Us...
theMavl/ClimateBox
hub/serializers.py
serializers.py
py
3,544
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.serializers.HyperlinkedModelSerializer", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User", "line_number": 12, ...
4356272156
from torch.nn import Module from torch import nn from utils.builder import get_builder class LeNet5(Module): def __init__(self, a = 6, b = 16, c = 120, d = 84): super(LeNet5, self).__init__() builder = get_builder() self.conv1 = builder.conv5x5(1, a) # self.conv1 = nn.Conv2d(1, 6, ...
x-zho14/SparseIRM
models/lenet5.py
lenet5.py
py
1,375
python
en
code
6
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "name" }, { "api_name": "utils.builder.get_builder", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn.ReLU", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", ...
24187487563
"""Loads a json file containing settings that the ISAMBARD use. A .isambard_settings file must be made in this directory, template_settings.py can be copied and paths for your system can be added. Json files look like python dictionaries, and in fact all json files are valid python dictionary code (although this isn't...
woolfson-group/isambard
isambard/settings.py
settings.py
py
1,992
python
en
code
8
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.expanduser", ...
41437758163
import logging import string import json import pytest from streamsets.testframework.markers import salesforce, sdc_min_version from streamsets.testframework.utils import get_random_string from ..utils.utils_salesforce import (BULK_PIPELINE_TIMEOUT_SECONDS, clean_up, get_ids, OBJECT_NAMES, ...
streamsets/datacollector-tests
stage/standard/test_salesforce_bulk2_destination.py
test_salesforce_bulk2_destination.py
py
15,315
python
en
code
17
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "streamsets.testframework.markers.salesforce.client", "line_number": 18, "usage_type": "attribute" }, { "api_name": "streamsets.testframework.markers.salesforce", "line_number": 18, ...
14830570043
""" **DISCLAIMER:** Please note that this code is for educational purposes only. It is not intended to be run directly in production. This is provided on a best effort basis. Please make sure the code you run does what you expect it to do. """ import argparse from pprint import pprint import requests ...
VirusTotal/vt-use-cases
admins_guide/getting_group_users_and_service_accounts.py
getting_group_users_and_service_accounts.py
py
2,439
python
en
code
9
github-code
1
[ { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 44, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 56, "usage_type": "call" }, { "api_name": "pprint.pprint", ...
33270977246
# coding: utf-8 import matplotlib.pyplot as plt from triangles.utils import get_mobius_triangle from triangles.chains import get_chain triangle_type = (2, 3, 7) W = 'ab' ini_tri = get_mobius_triangle(*triangle_type) v, e, f = get_chain(ini_tri, W) #%* Se genera la cadena y se guardan los vértices,*) ...
airammrc/triangles
ejemplo2.py
ejemplo2.py
py
748
python
es
code
0
github-code
1
[ { "api_name": "triangles.utils.get_mobius_triangle", "line_number": 11, "usage_type": "call" }, { "api_name": "triangles.chains.get_chain", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 18, "usage_type": "call" }, ...
31636971721
import os import json import time from requests.exceptions import HTTPError from elifetools.utils import doi_uri_to_doi from S3utility.s3_notification_info import parse_activity_data from provider import ( digest_provider, download_helper, email_provider, requests_provider, utils, ) from activity.ob...
elifesciences/elife-bot
activity/activity_PostDigestJATS.py
activity_PostDigestJATS.py
py
9,275
python
en
code
19
github-code
1
[ { "api_name": "activity.objects.Activity", "line_number": 17, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
15054232788
import argparse import subprocess import logging import shutil from pathlib import Path # Configure logging logging.basicConfig(level=logging.DEBUG, format='[%(levelname)s] %(message)s') def find_encoded_files(directory, encodings): encoded_files = [] for file_path in Path(directory).rglob('**/*'): if...
chestnut-sec/work
2UTF8.py
2UTF8.py
py
2,518
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.debug", ...
37519019964
"""A simple number and datetime addition JSON API. Run the app: $ python examples/flask_example.py Try the following with httpie (a cURL-like utility, http://httpie.org): $ pip install httpie $ http GET :5001/ $ http GET :5001/ name==Ada $ http POST :5001/add x=40 y=2 $ http POST :5001/datead...
yufeiminds/webargs
examples/flask_example.py
flask_example.py
py
2,061
python
en
code
null
github-code
1
[ { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "webargs.Arg", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 32, "usage_type": "call" }, { "api_name": "webargs.flaskparser.use_args", ...
41898453027
from astropy.io import fits import argparse from glob import glob import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np # Plots a given order for each spectrum from a given epoch; # on click places a line, after two lines prints pixel range and wavelength # range. def build_px_masks(): #np...
chrisleet/selenite
selenite/test_code/build_px_masks.py
build_px_masks.py
py
7,166
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 42, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.fi...
8803479781
from gmpy2 import is_prime def backwards_prime(start, stop): ans = [] print(start,stop) for i in range(start,stop+1): re = int(str(i)[::-1]) if is_prime(i) == True and is_prime(re) == True and i != re: ans.append(i) return ans
Otiston/Codewars
6 kyu/Backwards Read Primes.py
Backwards Read Primes.py
py
275
python
en
code
0
github-code
1
[ { "api_name": "gmpy2.is_prime", "line_number": 8, "usage_type": "call" } ]
23600747363
from django.urls import path from . import views urlpatterns = [ path("", views.index, name="blogHome"), path("about/", views.about, name="blogAbout"), path("search/", views.search, name="blogSearch"), path("impression/", views.impression, name="blogImpression"), path("edit/", views.edit, name="blo...
nikhivishwaa/JKart-Ecommerce-Website
jkart/blog/urls.py
urls.py
py
388
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
34342563057
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operati...
ludrao/django-tellme
tellme/migrations/0001_initial.py
0001_initial.py
py
1,034
python
en
code
148
github-code
1
[ { "api_name": "django.db.migrations.Migration", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 12, "usage_type": "call...
34523096925
import logging import torch import os from dataset import * logger = logging.getLogger(__file__) def toSlicesGroupDataset(train, label, slice): print('SLICES: ', slice) if slice == 1: return [[train[i].unsqueeze(0), label[i]] for i in range(label.shape[0])] paddingSize = int(slice / 2) paddi...
HuXiaoling/imageSeg-2.5D_topo
utils.py
utils.py
py
4,575
python
en
code
32
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.stack", "line_number...
17600549029
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('shopapp', '0047_auto_20170814_0940'), ] operations = [ migrations.AlterField( model_name='product', ...
HoangJerry/onedollar
shopapp/migrations/0048_auto_20170814_0955.py
0048_auto_20170814_0955.py
py
471
python
en
code
1
github-code
1
[ { "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" }, {...
74664024672
#Gensim -> based on textrank algorithm, textrank id graph based ranking algorithm for text processing, # also know as topic modelling, document indexing and similarity retrieal for large text # pre trained model comes with it from bs4 import BeautifulSoup import requests from gensim.summarization.summarizer import sum...
vanshavenger/Automation
Text Summarizer.py
Text Summarizer.py
py
1,283
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "gensim.summarization.summarizer.summarize", "line_number": 28, "usage_type": "call" }, { "api_name...
71103780195
import os import argparse import json from subprocess import call import urllib.request from shutil import copyfile class wordpressSync(object): def __init__(self, args): self.MAMP_PATH = '/Applications/MAMP/bin/php/' self.MAMP_ENABLED = args.mampEnabled # Store DIRs and change to the inst...
Potion/poDataTools
wordpress/poWordpressTool.py
poWordpressTool.py
py
13,637
python
en
code
0
github-code
1
[ { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.realpath", "...
32200656016
#!/usr/bin/python import argparse import os import random import sys import Project from coilsnake.util.common.yml import yml_load sys.path.append('./') def calcNewStat(statName, growthRates, newLevel, oldStatValue): r = 0 if (statName == "Vitality" or statName == "IQ") and (newLevel <= 10): r = 5...
pk-hack/CoilSnake
coilsnake/tools/damage_calc.py
damage_calc.py
py
4,386
python
en
code
153
github-code
1
[ { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 20, "usage_type": "call" }, { "api_name": "random.randint", "li...
4848789733
""" Media manipulation routines Example: import tator api = tator.get_api(token=token) media = api.get_media(media_id,presigned=3600) util = tator.util.MediaUtil() # This load takes a tator object util.load_from_media_object(media, quality=None) # path now contains a disk path to an mp4 in the temporary staging are...
cvisionai/tator-py
tator/util/media_util.py
media_util.py
py
17,899
python
en
code
4
github-code
1
[ { "api_name": "io.BytesIO", "line_number": 66, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 67, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 71, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 1...
29883046162
# Import required libraries import pandas as pd import dash from dash import html, dcc from dash.dependencies import Input, Output import plotly.express as px # Read the airline data into pandas dataframe spacex_df = pd.read_csv("spacex_launch_dash.csv") max_payload = spacex_df['Payload Mass (kg)'].max() min_payload =...
lubix/Dashboard-Application-with-Plotly-Dash
spacex_dash_app.py
spacex_dash_app.py
py
4,891
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "dash.Dash", "line_number": 19, "usage_type": "call" }, { "api_name": "dash.html.Div", "line_number": 22, "usage_type": "call" }, { "api_name": "dash.html", "line_number":...
8067224178
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require_contenttypes_0002'), migrations.swappable_depe...
zhubingbi/MyCmdb
Users/migrations/0002_auto_20171229_1929.py
0002_auto_20171229_1929.py
py
1,871
python
en
code
1
github-code
1
[ { "api_name": "django.db.migrations.Migration", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 13, "usage_type": "call...
9789007015
import time import json from functools import wraps from flask import request, current_app from mongo import engine from mongo.utils import doc_required from .response import * __all__ = ( 'Request', 'get_ip', ) type_map = { 'int': int, 'list': list, 'str': str, 'dict': dict, 'bool': bool,...
Normal-OJ/Back-End
model/utils/request.py
request.py
py
3,238
python
en
code
2
github-code
1
[ { "api_name": "flask.request", "line_number": 34, "usage_type": "argument" }, { "api_name": "functools.wraps", "line_number": 32, "usage_type": "call" }, { "api_name": "mongo.utils.doc_required", "line_number": 79, "usage_type": "call" }, { "api_name": "mongo.engi...
2797565283
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.conf.urls import url from . import views urlpatterns = [ # URL pattern for the url_encode view url( regex=r'^encode$', view=views.url_encode, name='encode' ), # URL pattern for the url...
aaronmyatt/mv_shorl
short/urls.py
urls.py
py
439
python
en
code
0
github-code
1
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 16, "usage_type": "call" } ]
33368145432
# import cv2 import numpy as np import os from PIL import Image from hf.core import obj_utils from hf.core import box_3d_encoder class LabelSegPreprocessor(object): def __init__(self, dataset, label_seg_dir, expand_gt_size): """Preprocesses label segs and saves to files for RPN-seg training Ar...
zhaotudou/HeteroFusionRCNN
hf/core/label_seg_preprocessor.py
label_seg_preprocessor.py
py
5,568
python
en
code
1
github-code
1
[ { "api_name": "os.makedirs", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 51, "usage_type": "call" }, { "api_name": "hf.core.obj_utils.read_labels", "line_number": 70, "usage_type": "call" }, { "api_name": "hf.core.obj_ut...
1413417536
import pandas as pd import numpy as np from scipy.optimize import minimize import time import matplotlib.pyplot as plt def sphere_evaluate(x): value = sum((x-shift[0:len(x)])**2)+bias converge.append(value) return value def minimize_sphere(dim, shifts, biases): start = time.time() global shift, b...
Justus-M/dsti-metaheuristics-justus-mulli
sphere/sphere.py
sphere.py
py
725
python
en
code
0
github-code
1
[ { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.optimize.minimize", "line_number": 20, "usage_type": "call" }, { "api_name": "time.time", "line_n...
12888255447
import pygame from bullet import Bullet WINDOW_WIDTH = 512 WINDOW_HEIGHT = 768 class Hero(object): def __init__(self, win): self.img = pygame.image.load("res/hero.png") self.window = win # 获取图片的矩形对象 # hero_rect = hero.get_rect() # 获取图片的矩形对象(一个图片就会有一个矩形对象,通过这个.get_rect() 来获取矩形对象,...
allenwong0609/game
hero.py
hero.py
py
2,465
python
zh
code
0
github-code
1
[ { "api_name": "pygame.image.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.key.get_pressed", "line_number": 28, "usage_type": "call" }, { "api_name": "pygame.key...
37683187973
import logging import traceback __pubsub = {} def subscribe(topic, callback): global __pubsub logging.debug("subscribe to %s, callback = %s" % ( topic, str(callback) )) if topic not in __pubsub: __pubsub[topic] = [] __pubsub[topic].append(callback) def unsubscribe(topic, callback):...
umair-gujjar/industrial-ffmpeg
iffmpegmod/signals.py
signals.py
py
841
python
en
code
0
github-code
1
[ { "api_name": "logging.debug", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 33, "usage_type": "call" }, { "api_name": "traceback.format_exc", "...
6170698775
from pathlib import Path ROOT = Path(__file__).absolute().parent.parent import sys sys.path.append(str(ROOT)) from easydict import EasyDict from tqdm import tqdm from visualizer import draw, Visualizer, Camera from utils.tools import * nusc_map = ['car', 'truck', 'construction_vehicle', 'bus', 'trailer', ...
SpartanH7/PcdDetectionVisualization
demo/demo.py
demo.py
py
4,074
python
en
code
0
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tqdm.tqdm", "line_number"...
18746494408
from texttable import Texttable import random class BoardException(Exception): def __init__(self, message): self._message = message def __str__(self): return str(self._message) class Snake: def __init__(self): self._direction = 'up' self._head = [0, 0] ...
pauladam2001/Sem1_FundamentalsOfProgramming
SessionExam/Board/snakeAndBoard.py
snakeAndBoard.py
py
5,733
python
en
code
0
github-code
1
[ { "api_name": "random.choice", "line_number": 135, "usage_type": "call" }, { "api_name": "texttable.Texttable", "line_number": 144, "usage_type": "call" } ]
42700341945
############################### # Authors ############################### # André Mourato nmec 84745 # Gonçalo Marques nmec 80327 ############################### # Benchmarking import tracemalloc import time # Necessary imports import sys import math import Stemmer import operator import csv # File i...
andremourato/information-retrieval
assignment/indexer.py
indexer.py
py
12,132
python
en
code
1
github-code
1
[ { "api_name": "csv.DictReader", "line_number": 58, "usage_type": "call" }, { "api_name": "Stemmer.Stemmer", "line_number": 64, "usage_type": "call" }, { "api_name": "math.log10", "line_number": 127, "usage_type": "call" }, { "api_name": "math.log10", "line_num...
73457798114
import shlex import argparse import logging import sys import os import getpass import json import time import shutil from colorama import Fore, Back, Style import dropship from dropship.lib.netdef import NetworkDefinition from dropship.lib.helpers import ModuleManager, StateFile from dropship.lib.builder import Drops...
bocajspear1/dropship
run_dropship.py
run_dropship.py
py
7,642
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "dropship.lib.netdef.NetworkDefinition", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 26, "usage_type": "call" }, { "api_name": "sys....
33490379028
from nose.tools import eq_, ok_ from deeprank.models.variant import PdbVariantSelection from deeprank.domain.amino_acid import alanine, valine, glutamine, glycine, methionine def test_instance(): pdb_ac = "1AK4" chain_id = "A" residue_number = 10 wt_amino_acid = alanine var_amino_acid = glutamin...
DeepRank/DeepRank-Mut
test/models/test_variant.py
test_variant.py
py
981
python
en
code
1
github-code
1
[ { "api_name": "deeprank.domain.amino_acid.alanine", "line_number": 12, "usage_type": "name" }, { "api_name": "deeprank.domain.amino_acid.glutamine", "line_number": 13, "usage_type": "name" }, { "api_name": "deeprank.models.variant.PdbVariantSelection", "line_number": 15, ...
35141514658
import os import argparse import torch import pickle import torch.utils.data as utils import torch.optim as optim from torch.distributions import Normal import time import numpy as np from graph import Graph from model import ReconstructionNet from pool import FeaturePooling from metrics import loss_function from data...
a-heintz/small-body-reconstruction-NN
train.py
train.py
py
6,563
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 50, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 70, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 70, "usage_type": "attribute" }, { "api_name": "torch...
29257658739
import csv import matplotlib.pyplot as plt import tkinter from tkinter import * from PIL import ImageTk, Image import sv_ttk '''This is the function for when the "ENTER" button is clicked on the GUI. -When the button is clicked, the state name that the user has entered is compared against a file that contains state n...
shorttea/ENGRGroup
folder-name/MAIN_CODE_graph state usage.py
MAIN_CODE_graph state usage.py
py
15,132
python
en
code
0
github-code
1
[ { "api_name": "csv.reader", "line_number": 23, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 36, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 51, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_n...
14115772563
from datetime import datetime import winsound def inc_time(time): if time[-1:] == '9': tenth_min = int(time[-2:-1]) if tenth_min == 5: tenth_min = 0 else: tenth_min = tenth_min + 1 time = time[:-2] + str(tenth_min) + '0' else: mins = int(time[-1:]...
abdulazizibrahim/Human-Detection-Using-Wireless-Signals
times.py
times.py
py
877
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "winsound.Beep", "line_number": 33, "usage_type": "call" } ]
74026460194
#!/usr/bin/env python import serial import keyboard ser = serial.Serial('/dev/ttyUSB0', 115200) izq=False dch=False nad=False prevIzq=False prevDch=False while 1: lectura = ser.readline() print(lectura) pos = lectura[:3] if pos == 'izq': print("Izquierda") izq=True dch=False ...
David-Lor/Pedales-Arduino
pedales_izq_dch.py
pedales_izq_dch.py
py
775
python
en
code
0
github-code
1
[ { "api_name": "serial.Serial", "line_number": 5, "usage_type": "call" }, { "api_name": "keyboard.press", "line_number": 30, "usage_type": "call" }, { "api_name": "keyboard.press", "line_number": 32, "usage_type": "call" }, { "api_name": "keyboard.release", "li...
32789903126
#!/usr/bin/env python3 from functools import reduce from PIL import Image from typing import List, Tuple import sys from math import floor from itertools import chain import numpy as np def read_barcode_info(path: str) -> List[bool]: img = Image.open(path) img = img.resize((256, img.height)).convert('L') retur...
PKU-GeekGame/geekgame-1st
src/newsong/bar2histogram.py
bar2histogram.py
py
1,596
python
en
code
52
github-code
1
[ { "api_name": "PIL.Image.open", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_numbe...
1444791185
import cv2 import numpy as np class ForegroundEstimator: def __init__(self, width, height, speaker_exp_factor, min_mask_frames, mask_exp_radius): self.width = width self.height = height self.speaker_exp_factor = speaker_exp_factor self.min_mask_frames = min_mask_frames self...
adaniefei/AccessMath_Pose
AccessMath/speaker/actions/foreground_estimator.py
foreground_estimator.py
py
5,117
python
en
code
1
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 52, "usage_type": "attribute" }, { "api_name": "numpy.nonzero", "line_number": 79, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_...
32497392433
# Definition for a binary tree node. from typing import Optional class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def recoverTree(self, root: Optional[TreeNode]) -> None: if not root: ...
augini/algorithms_ds
Leetcode/99.py
99.py
py
801
python
en
code
2
github-code
1
[ { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" } ]
8535418675
from aux import array2string, loop_minmax from vis import ccmap import numpy as np import matplotlib.pyplot as plt import itertools import logging import json from netCDF4 import Dataset log = logging.getLogger(__name__) class DataObject: def __init__(self, filename, variable): self.fn = filename ...
feltor-dev/visualise
pdata.py
pdata.py
py
7,947
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_number": 21, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 22, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "li...
72410871074
import requests import httpx chrome_headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' \ ' (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} print(...
ElliotGarbus/MastodonExperiments
experiments/test_sleeping.py
test_sleeping.py
py
870
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "httpx.get", "line_number": 24, "usage_type": "call" } ]
7555976140
from matplotlib import pyplot as plt import numpy as np from tensorflow import keras def go(): X_train = np.linspace(0, 20, 100) y_train = 3 * np.sin(X_train) + np.random.normal(0, 0.3, 100) X_test = np.linspace(20, 30, 50) y_test = 3 * np.sin(X_test) + np.random.normal(0, 0.3, 50) model = keras....
sesc-infosec/sesc-infosec.github.io
src/Lecture 15/NeuralNetworks/my_regression.py
my_regression.py
py
965
python
en
code
0
github-code
1
[ { "api_name": "numpy.linspace", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_nu...
20350786195
from detection import * from get_url import * from image import * from azure.cognitiveservices.vision.face import FaceClient from msrest.authentication import CognitiveServicesCredentials import os def auth(): l = [] k = [] k.append("your-key") k.append("your-key") k.append("your-key") ...
Canardier/Hackaton-Microsoft
python-server/recoco.py
recoco.py
py
1,358
python
en
code
0
github-code
1
[ { "api_name": "azure.cognitiveservices.vision.face.FaceClient", "line_number": 19, "usage_type": "call" }, { "api_name": "msrest.authentication.CognitiveServicesCredentials", "line_number": 19, "usage_type": "call" }, { "api_name": "os.rename", "line_number": 39, "usage_t...
10191812998
fn = "input.txt" fn = "test.txt" from math import prod from itertools import product def solve(data, n, label): for group in product(*(data,)*n): if sum(group) == 2020: print(f'{label}: {prod(group)}') return data = list(map(int, open(fn).readlines())) solve(data, 2, 'Part 1')...
ahenshaw/aoc2020
aoc01/day1.py
day1.py
py
345
python
en
code
0
github-code
1
[ { "api_name": "itertools.product", "line_number": 7, "usage_type": "call" }, { "api_name": "math.prod", "line_number": 9, "usage_type": "call" } ]
36436502173
# 参考 https://stats.stackexchange.com/questions/71335/decision-boundary-plot-for-a-perceptron import numpy as np from sklearn.linear_model import Perceptron import matplotlib.pyplot as plt def g(x): if x > 0: return 1 else: return 0 def update_weights(w, X, y, a = 1): py = 0...
fanqo/MMLwsl_2nd_zh
ch10/test.py
test.py
py
1,558
python
en
code
0
github-code
1
[ { "api_name": "numpy.dot", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 31...
35572635490
import os import csv from innostock import settings from stockkdata.models import ListOfCompanies from django.core.management.base import BaseCommand,CommandError DIR_PATH=os.path.dirname(__file__) class Command(BaseCommand): help='Add company data' def handle(self, *args, **options): with open(str(D...
devanshslnk/StockHub
innostock/stockkdata/management/commands/list_of_company.py
list_of_company.py
py
875
python
en
code
1
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "csv...
11353626686
import mock import unittest import uuid import sys import subprocess import pdb from stats_daemon.storage_nodemgr import EventManager from pysandesh.sandesh_base import * class EventManagerTest(unittest.TestCase): def setUp(self): self._api = EventManager("storage-compute") def mocked_pool_subprocess...
Juniper/contrail-dev-controller
src/storage/stats-daemon/stats_daemon/tests/test_storage_nodemgr.py
test_storage_nodemgr.py
py
6,557
python
en
code
3
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "stats_daemon.storage_nodemgr.EventManager", "line_number": 13, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 28, "usage_type": "attribute" ...
35076682794
""" deviceinfo.py A simple Device Information service Device information is stored in files named <devicename>.py in the devices sub-folder Each device file contains a dict of values These device files are [ideally] generated from DFP information by [running generate_device_info.py | hand] """ # Python 3 compatibility...
SpenceKonde/megaTinyCore
megaavr/tools/libs/pymcuprog/deviceinfo/deviceinfo.py
deviceinfo.py
py
13,633
python
en
code
471
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 34, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 39, "usage_type": "call" }, { "api_name": "imp...
28097598839
from schema import And, Optional, Or, Schema _DATA_TYPES = Or( "binary", "text", "number", "date", "image", "audio", "video", "list", "single_selection", "multiple_selection", "form_sequence", "email", "link", "pdf", "embed", "named_entity_recognition", ...
Human-Lambdas/human-lambdas
src/human_lambdas/data_handler/data_schema.py
data_schema.py
py
1,527
python
en
code
32
github-code
1
[ { "api_name": "schema.Or", "line_number": 3, "usage_type": "call" }, { "api_name": "schema.Schema", "line_number": 24, "usage_type": "call" }, { "api_name": "schema.Optional", "line_number": 28, "usage_type": "call" }, { "api_name": "schema.Optional", "line_nu...
22122963677
import unittest from typing import List import heapq import collections class Solution: def minCostToSupplyWater(self, n: int, wells: List[int], pipes: List[List[int]]) -> int: ''' 首先利用最小生成树,找到一条最短的路径连接所有的点,(或者直接在当前处建立well), 且选择其中建wells cost最小的作为起始点。 ''' graph = collections.defaultdi...
AllieChen02/LeetcodeExercise
Graph/P1168OptimizeWaterDistributionInAVillage/OptimizeWaterDistributionInAVillage.py
OptimizeWaterDistributionInAVillage.py
py
1,493
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 19, "usage_type": "call" }, { "api_name": "heapq.heappop", ...
39568625195
from dataset import CatVsDogImageFoler from dataloader import return_dataloaders from trainer import Train from model import ResNet, BasicBlock, BottleNeck import torch.nn as nn import torch from torchsummary import summary from collections import namedtuple dataset = CatVsDogImageFoler() train_dataset, val_dataset ,...
paragonyun/Papers_I_must_read
ResNet/train.py
train.py
py
1,942
python
en
code
2
github-code
1
[ { "api_name": "dataset.CatVsDogImageFoler", "line_number": 11, "usage_type": "call" }, { "api_name": "dataset.dataset", "line_number": 12, "usage_type": "call" }, { "api_name": "dataloader.return_dataloaders", "line_number": 14, "usage_type": "call" }, { "api_name...
19416842583
import logging from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters import Text from aiogram.types import Message, ReplyKeyboardRemove, InlineKeyboardMarkup, InlineKeyboardButton, \ CallbackQuery, ContentType from keyboards.default import main_menu_admin, admin_default_cancel_confirm_service, ...
Sanzensekai-mx/cosmetology_bot_example
handlers/admins/admin_add_service.py
admin_add_service.py
py
15,242
python
ru
code
0
github-code
1
[ { "api_name": "utils.db_api.models.DBCommands", "line_number": 15, "usage_type": "call" }, { "api_name": "aiogram.types.InlineKeyboardMarkup", "line_number": 19, "usage_type": "call" }, { "api_name": "data.config.keys", "line_number": 20, "usage_type": "call" }, { ...
73589777313
import os import msgspec msgspec_encoders = {".json": msgspec.json.Encoder(), ".msgpack": msgspec.msgpack.Encoder(), ".toml": msgspec.toml, ".yaml": msgspec.yaml} msgspec_decoders = {".json": msgspec.json.Decoder(), ".msgpack": msgspec.msgpack.Decoder(), ".toml": msgspec.toml, ".yaml": msgspec.yaml} import gradio as g...
Xerxemi/auto-MBW-rt
scripts/payload/create_payload.py
create_payload.py
py
11,216
python
en
code
17
github-code
1
[ { "api_name": "msgspec.json.Encoder", "line_number": 3, "usage_type": "call" }, { "api_name": "msgspec.json", "line_number": 3, "usage_type": "attribute" }, { "api_name": "msgspec.msgpack.Encoder", "line_number": 3, "usage_type": "call" }, { "api_name": "msgspec.m...
8088660702
import csv from datetime import date import pandas as pd import requests # API Key from EIA api_key = 'df8bc3420afaf1f07d730567179ad3e3' # PADD Names to Label Columns used by api data set PADD_NAMES = ['Date', 'Price'] # Series IDs PADD_KEY = {'Daily':'NG.RNGWHHD.D ', 'Monthly':'NG.RNGWHHD.M', 'Yearly': '...
eacunagon/Natural-Gas-Prices
main.py
main.py
py
1,127
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 33, "usage_type": "call" } ]
74636596833
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Author: Wenxuan Wu, Zhongang Qi, Li Fuxin. @Contact: wuwen@oregonstate.edu @File: eval_cls_conv.py Modified by @Author: Jiawei Chen, Linlin Li @Contact: jc762@duke.edu @File: k_eval_cls_conv.py """ import argparse import os import sys import numpy as np import pand...
ECE685-FinalProject/3D-object-recognition
k_eval_cls_conv.py
k_eval_cls_conv.py
py
7,925
python
en
code
1
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 35, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 46, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 50, "usage_type": "call" }, { "api_name": "pathlib.Path", ...
42702881305
import time import logging LOG = logging.getLogger(__name__) def start(): while True: LOG.info('hello, I love you.') LOG.debug('debug , I hate you.') LOG.warn('warn, I do not like you') LOG.error('error, I fuck you') time.sleep(1)
AndreMouche/python-logdemo
logdemo/inner/heartbeat.py
heartbeat.py
py
277
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" } ]
37870059486
import os from pydub import AudioSegment from bewise_second.settings import BASE_DIR def convert_to_mp3(audio_file): "Конвектирует wav -> mp3" audio_file = str(audio_file) audio_name = '.'.join(audio_file.split('.')[:-1]) src = os.path.join(BASE_DIR, rf"media/{audio_name}.wav") # src to dst dst ...
anton431/bewise_2
bewise_second/index/utils.py
utils.py
py
565
python
en
code
0
github-code
1
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "bewise_second.settings.BASE_DIR", "line_number": 12, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path...
16862918839
from cliff import lister from oio.cli.admin.common import ContainerCommandMixin class ContainerVacuum(ContainerCommandMixin, lister.Lister): """ Vacuum (defragment) a database. Execute the operation on the master service, then resynchronize the database on the slaves. """ columns = ("Contai...
open-io/oio-sds
oio/cli/admin/item_vacuum.py
item_vacuum.py
py
1,548
python
en
code
621
github-code
1
[ { "api_name": "oio.cli.admin.common.ContainerCommandMixin", "line_number": 6, "usage_type": "name" }, { "api_name": "cliff.lister.Lister", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cliff.lister", "line_number": 6, "usage_type": "name" }, { "api...
69800290914
from django.contrib import admin from django.urls import path, include, re_path from . import views urlpatterns = [ path('', views.index), path('select_moive/', views.select_moive, name="select_moive"), path('select_page/', views.select_page, name="select_page"), path('select_contain/', views.select_co...
shaguahehehe/movie
moive_website/movie_detail/urls.py
urls.py
py
471
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
33612373314
import os import pytest import itertools from openeis.applications.utest_applications.fixture_support import (project, active_user, create_dataset, ...
VOLTTRON/openeis
openeis/applications/utest_applications/utest_whole_building_energy_savings/conftest.py
conftest.py
py
2,530
python
en
code
10
github-code
1
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "openeis.applications.utest_...
27764367109
""" Helper functions for parsing and preparing dataset from the dateSet dataset """ from num2words import num2words def dateSet_tuple_to_kvs(entry): day, month, year = entry assert day > 0 and day <= 31 assert month > 0 and month <= 12 assert year >= 2000 and year <= 2020 if day < 10: day ...
JKinx/controlled-gen
data_utils/dateSet_helpers.py
dateSet_helpers.py
py
2,518
python
en
code
1
github-code
1
[ { "api_name": "num2words.num2words", "line_number": 45, "usage_type": "call" }, { "api_name": "num2words.num2words", "line_number": 46, "usage_type": "call" } ]
22738212406
#!/usr/bin/env python #coding=utf-8 """ Created on Wed Apr 14 22:58:08 2021 @author: guoxiong """ import threading import math import numpy as np from matplotlib import pyplot as plt import rospy import tf from human_robot_transport.msg import Distance arrayLength = 100 dist = np.zeros(arrayLength) def dist_get_an...
guoxxiong/Human-Robot-Co-transporting-Simulation
src/human_robot_transport/scripts/noRunning/distance_plot.py
distance_plot.py
py
2,292
python
en
code
1
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "tf.TransformListener", "line_number": 21, "usage_type": "call" }, { "api_name": "rospy.Publisher", "line_number": 22, "usage_type": "call" }, { "api_name": "human_robot_transpor...
23996847342
from django.http import HttpResponse from django.shortcuts import render MENU = {"главная стр.":"/", "каталог":"/catalog", "о приложении":"/about"} def main_page(request): title = "Главная страницп приложения" data={"menu": MENU, "title": title} return render(request, "./index.html", context=data) #def c...
ivan431/PANEL_CATALOG_DJ
manage_panel_Template/manage_panel_Template/views.py
views.py
py
693
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" } ]
32973406851
from stock_paragraph import * from fill_data_class import * from functools import reduce from alive_progress import alive_bar from utils import * import re import os import docx from docx.shared import Pt DEBUG = False SAVE_PATH = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop', "Документы из программ...
ArkThem/EzDoc
main.py
main.py
py
4,256
python
en
code
0
github-code
1
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "re.compile", "line_numb...
29634274791
import sys import threading from colorama import Fore, Style,init from utils import * def animate(message): for c in itertools.cycle(['|', '/', '-', '\\']): if done: break print("\r"+Style.BRIGHT+Fore.GREEN+message+c+Fore.RESET, end="") time.sleep(0.1) def build(direc, port1, i...
DanyMilan23/BotAndroid
build.py
build.py
py
3,022
python
en
code
0
github-code
1
[ { "api_name": "colorama.Style.BRIGHT", "line_number": 10, "usage_type": "attribute" }, { "api_name": "colorama.Style", "line_number": 10, "usage_type": "name" }, { "api_name": "colorama.Fore.GREEN", "line_number": 10, "usage_type": "attribute" }, { "api_name": "co...
25617604628
import os import pandas as pd import numpy as np from sklearn.metrics import auc, roc_curve import xgboost as xgb from sklearn.preprocessing import MinMaxScaler base_path = os.path.dirname(os.path.abspath(__file__)) + "/../../data/o2o/" dataset1 = pd.read_csv(base_path + 'data/dataset1.csv') dataset1.label.replace(-1,...
littlemesie/tianchi
src/o2o/xgb02_model.py
xgb02_model.py
py
3,354
python
en
code
2
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line...
34597254850
import numpy as np import matplotlib.pyplot as plt import scipy.spatial as spa from scipy.stats import multivariate_normal def main(): # TODO I have tested my algorithm on two different computers, # TODO Algorithm's average run time: M1 Chip MBP -> 3 min. Intel Chip MBP -> 9 min. # TODO Please do not term...
kaanturkmen/ENGR421-Machine-Learning
Homeworks/HW8-EM-Maximization-Clustering/engr421_hw08.py
engr421_hw08.py
py
12,566
python
en
code
1
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 44, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 44, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 45, "usage_type": "call" }, { "api_name": "...
29280991881
from setuptools import setup, find_packages # requirement file with open('requirements.txt') as f: required = f.read().splitlines() # readme file with open('README.md') as f: readme = f.read() setup( name='textstada', version='0.0.1', description='No frills text data cleaning methods. Stada mean...
jhags/text-stada
setup.py
setup.py
py
979
python
en
code
0
github-code
1
[ { "api_name": "setuptools.setup", "line_number": 12, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 26, "usage_type": "call" } ]
20509227195
import copy import numpy as np from scipy.optimize import minimize def objective_function_full(parameters: np.array, model, solution): count = 0 for task in model.last_scenario.tasks: if task != solution: if model.comparison_function(parameters, task, solution) == solution: ...
QuimLaz/HackEPS
src/classes/selector.py
selector.py
py
2,141
python
en
code
1
github-code
1
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.square", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.optimize.minimize", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.array", ...
33519452722
from functools import partial from robotide.lib.robot.errors import VariableError from robotide.lib.robot.utils import (is_dict_like, is_list_like, normalize, RecommendationFinder) def variable_not_found(name, candidates, msg=None, deco_braces=True): """Raise DataError for missing variab...
robotframework/RIDE
src/robotide/lib/robot/variables/notfound.py
notfound.py
py
1,274
python
en
code
910
github-code
1
[ { "api_name": "functools.partial", "line_number": 16, "usage_type": "call" }, { "api_name": "robotide.lib.robot.utils.normalize", "line_number": 16, "usage_type": "argument" }, { "api_name": "robotide.lib.robot.utils.RecommendationFinder", "line_number": 18, "usage_type":...
27060149406
import os import cv2 import timm import torch import numpy import warnings import pandas as pd from tqdm import tqdm import torch.nn as nn import seaborn as sns from scipy.stats import zscore import matplotlib.pyplot as plt import torch.nn.functional as F from siren_pytorch import SirenNet from sklearn.compose import C...
QLaHPD/V-Desafio-de-Ciencias-de-Dados-PUCGO
train_siren.py
train_siren.py
py
4,013
python
en
code
0
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 22, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 37, "usage_type": "call" }, { "api_name": "skle...
22427807825
import logging as log from common.config import DEFAULT_TABLE from indexer.index import milvus_client, create_table, insert_vectors, create_index, has_table from indexer.tools import connect_mysql, create_table_mysql, search_by_image_id, load_data_to_mysql import datetime import time from indexer.logs import write_log ...
PKQ1688/image_retrieval
pic_search/src/service/insert.py
insert.py
py
3,535
python
en
code
4
github-code
1
[ { "api_name": "indexer.tools.search_by_image_id", "line_number": 17, "usage_type": "call" }, { "api_name": "indexer.index.has_table", "line_number": 37, "usage_type": "call" }, { "api_name": "indexer.index.create_table", "line_number": 41, "usage_type": "call" }, { ...
22542135612
from torch.utils.data import Dataset import numpy as np # import main as env import math import pandas as pd from sklearn.model_selection import train_test_split import torch from imblearn.over_sampling import SMOTE from imblearn.combine import SMOTETomek class SmartHomeDataset(Dataset): def __init__(self, filen...
chameleonTK/continual-learning-for-HAR
smart_home_dataset.py
smart_home_dataset.py
py
5,191
python
en
code
18
github-code
1
[ { "api_name": "torch.utils.data.Dataset", "line_number": 12, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random.permutation", "line_number": 21, "usage_type": "call" }, { "api_name": "num...
21035719383
import collections import datetime import getpass import grp import io import itertools import logging import operator import os import os.path import pathlib import shutil import stat import sys import typing from functools import partial from typing import Optional, Union, Iterable, Iterator, TextIO, Tuple import ji...
agdsn/hades
src/hades/config/generate.py
generate.py
py
23,486
python
en
code
7
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 31, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 34, "usage_type": "attribute" }, { "api_name": "jinja2.exceptions.FilterArgumentError", "line_number": 84, "usage_type": "call" }, { "api_...
19998514733
import sqlite3 import re import jwt import base64 from flask import request, make_response from utils.util import f, secret_key from flask_restful import Resource, reqparse from flask_jwt_extended import jwt_required, get_jwt_identity from models.user import UserModel from models.card import CardModel class Card(R...
8426988382/secure_api
resources/card.py
card.py
py
7,420
python
en
code
0
github-code
1
[ { "api_name": "flask_restful.Resource", "line_number": 16, "usage_type": "name" }, { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_restful.reqparse", "line_number": 17, "usage_type": "name" }, { ...
34524998755
# USAGE # python gradient_descent.py # import the necessary packages import matplotlib.pyplot as plt from sklearn.datasets.samples_generator import make_blobs import numpy as np import argparse def sigmoid_activation(x): return 1.0 / (1 + np.exp(-x)) def next_training_batch(X, y, batchSize): for i in np.arange(...
huxiaoman7/learningdl
Chapter3/sgd/sgd.py
sgd.py
py
1,991
python
en
code
256
github-code
1
[ { "api_name": "numpy.exp", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.datasets.sampl...