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
72620470720
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import csv from io import StringIO import sys import auth_util from apiclient.discovery import build import google.api_core.exceptions from google.cloud import bigquery class GroupSync(object...
GoogleCloudPlatform/professional-services
examples/bigquery-row-access-groups/group_sync.py
group_sync.py
py
7,495
python
en
code
2,602
github-code
97
[ { "api_name": "google.cloud.bigquery.Client", "line_number": 25, "usage_type": "call" }, { "api_name": "google.cloud.bigquery", "line_number": 25, "usage_type": "name" }, { "api_name": "auth_util.get_credentials", "line_number": 47, "usage_type": "call" }, { "api_...
72258209278
import random import requests import json import os import urllib3 curr_dir = os.path.dirname(os.path.realpath(__file__)) max_sounds = 4096 settings = None with open(os.path.join(curr_dir, '..', 'settings.json')) as f: # Load the JSON data into a Python object settings = json.load(f) # print(settings) sound...
alex-lt-kong/public-address-client
tests/keeps-adding-sounds.py
keeps-adding-sounds.py
py
1,169
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
40174894425
if __name__ == '__main__': from nnunetv2.paths import nnUNet_results, nnUNet_raw import torch from batchgenerators.utilities.file_and_folder_operations import join from nnunetv2.inference.predict_from_raw_data import nnUNetPredictor from nnunetv2.imageio.simpleitk_reader_writer import SimpleITKIO ...
MIC-DKFZ/nnUNet
nnunetv2/inference/examples.py
examples.py
py
6,485
python
en
code
4,331
github-code
97
[ { "api_name": "nnunetv2.inference.predict_from_raw_data.nnUNetPredictor", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 16, "usage_type": "call" }, { "api_name": "batchgenerators.utilities.file_and_folder_operations.join", "line_numbe...
13261683807
import numpy as np from skimage.feature import canny from skimage.filters import sobel_v from skimage.morphology import binary_erosion, disk from skimage.transform import hough_line, hough_line_peaks from skimage import measure def find_top_cc(img_bw, top_k: int): """ Get the largest connected component :...
YeJinJeon/MRA_MRP_Collmap_DL
utils/dce_mra/correct_head_angle.py
correct_head_angle.py
py
3,686
python
en
code
0
github-code
97
[ { "api_name": "skimage.measure.label", "line_number": 16, "usage_type": "call" }, { "api_name": "skimage.measure", "line_number": 16, "usage_type": "name" }, { "api_name": "numpy.bincount", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.argsort", ...
33659735909
import sqlite3 connection = sqlite3.connect("company.db") cursor = connection.cursor() list_employees = """ SELECT id, name, position FROM company """ monthly = """ SELECT monthly_salary FROM company """ yearly = """ SELECT monthly_salary, yearly_bonus FROM company """ add_employee = """ INSERT INTO company (name,...
peter359/Programming101-3
week7/manage_company.py
manage_company.py
py
2,481
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
24458972928
from collections import Counter from itertools import accumulate class Solution: """ More thoughts... """ def sumOfFlooredPairs(self, nums): nd = Counter(nums) inds = [0]*(max(nums)+1) # key part for n in nd: for i in range(n, len(inds), n): ...
MonkeyNi/yummy_leetcode
weekly_contests/1862_sum_of_floored_pairs.py
1862_sum_of_floored_pairs.py
py
553
python
en
code
1
github-code
97
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" }, { "api_name": "itertools.accumulate", "line_number": 17, "usage_type": "call" } ]
29575221080
""" My Service Describe what your service does here """ # from email.mime import application from flask_restx import Api, Resource, fields, reqparse, inputs from flask import jsonify, request, url_for, abort from service.models import Wishlists, Items, DataValidationError from .common import status # HTTP Status Cod...
CSCI-GA-2820-FA22-001/wishlists
service/routes.py
routes.py
py
17,658
python
en
code
0
github-code
97
[ { "api_name": "flask.jsonify", "line_number": 26, "usage_type": "call" }, { "api_name": "common.status.HTTP_400_BAD_REQUEST", "line_number": 27, "usage_type": "attribute" }, { "api_name": "common.status", "line_number": 27, "usage_type": "name" }, { "api_name": "c...
29039814282
""" Script_name: openweather_urllib3.py Function: From input city (asked for) returns current temperature, minimum_temperature, maximum_temperature, humidity, current UTC, sunrise UTC, sunset UTC, weather description, and city name. """ import urllib3 imp...
manolan1/PythonNotebooks
Additional/0_Practice_Programs/Solutions/openweather_urllib3.py
openweather_urllib3.py
py
1,871
python
en
code
0
github-code
97
[ { "api_name": "urllib3.PoolManager", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 26, "usage_type": "call" }, { "api_name": "time.asctime", "line_number": 36, "usage_type": "call" }, { "api_name": "time.gmtime", "line_n...
3346596621
import pandas as pd import seaborn as sn import matplotlib.pyplot as plt test1 = pd.read_csv('/Users/Brova/Downloads/occupancy_data/datatest.txt') test1 = test1.set_index('date') test2 = pd.read_csv('/Users/Brova/Downloads/occupancy_data/datatest2.txt') test2 = test2.set_index('date') tests_combined = pd.concat([test...
andrejbrova/CO2-Occupancy-Correlation-Matrix
Correlation_matrixes & Histograms (Code)/UCI/both_tests_correlation_matrix.py
both_tests_correlation_matrix.py
py
549
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "l...
13355115526
import torch from torch.utils.data import Dataset, DataLoader from random import randint import pickle import numpy as np from PIL import Image class EpicKitchensDataset(Dataset): def __init__(self, labels_path, is_flow=False, transforms=None): labels_df = load_pickle_data(labels_path) self.transf...
rhodriguerrier/pytorch-i3d-epickitchens-features
kitchens_dataset.py
kitchens_dataset.py
py
7,056
python
en
code
null
github-code
97
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.utils.data.Dataset", "line_number": 45, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 125, "usage_type": "call" }, { "api_name": "numpy.a...
74228037758
# -*- coding: utf-8 -*- import logging.config import logging import traceback PLUGIN_NAME = 'SmojSubmit' class SmojSubmitFormatter(logging.Formatter): def format(self, record): level = record.levelname[0] name = record.name if name.startswith(PLUGIN_NAME + '.'): ...
YanWQ-monad/SmojSubmit
libs/logging.py
logging.py
py
1,570
python
en
code
9
github-code
97
[ { "api_name": "logging.Formatter", "line_number": 11, "usage_type": "attribute" }, { "api_name": "traceback.format_exception", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.config.dictConfig", "line_number": 50, "usage_type": "call" }, { "api_n...
70501769280
import weakref from pyroute2.common import basestring from pyroute2.netlink.rtnl.ifinfmsg import ifinfmsg class Interface(dict): table = 'interfaces' def __init__(self, db, key): self.db = db self.event_map = {ifinfmsg: "load_ifinfmsg"} self.kspec = ('target', ) + db.indices[self.tab...
crane-denny/python-pyroute2
pyroute2/ndb/interface.py
interface.py
py
3,117
python
en
code
4
github-code
97
[ { "api_name": "pyroute2.netlink.rtnl.ifinfmsg.ifinfmsg", "line_number": 12, "usage_type": "name" }, { "api_name": "pyroute2.netlink.rtnl.ifinfmsg.ifinfmsg.nla2name", "line_number": 16, "usage_type": "call" }, { "api_name": "pyroute2.netlink.rtnl.ifinfmsg.ifinfmsg", "line_numb...
74226177600
import sqlite3 from dataclasses import asdict from nicegui import ui from app.types import BattingAverage, BowlingAverage, Player, Season, SeasonRecord def show_season(db: sqlite3.Connection, year: int) -> None: min_innings = 5 min_wickets = 10 players = Player.all(db) with ui.header(elevated=True)...
mikewoodhouse/stan
app/pages/season.py
season.py
py
3,055
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.Connection", "line_number": 9, "usage_type": "attribute" }, { "api_name": "app.types.Player.all", "line_number": 12, "usage_type": "call" }, { "api_name": "app.types.Player", "line_number": 12, "usage_type": "name" }, { "api_name": "nicegui....
21055770456
import discord from discord import app_commands import morsecode import caesarcode token = 'xxxxxxxxxxxxxxxxxxx' intents = discord.Intents.default() client = discord.Client(intents=intents) tree = app_commands.CommandTree(client) @client.event async def on_ready(): await tree.sync(guild=discord.Object(id=11090162...
rs0125/DisCipher
DisCipher_Bot.py
DisCipher_Bot.py
py
2,110
python
en
code
1
github-code
97
[ { "api_name": "discord.Intents.default", "line_number": 7, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.Client", "line_number": 8, "usage_type": "call" }, { "api_name": "discord.app_...
9183670740
import os import inspect import json import sys import platform if platform.system() == 'Linux': configdir = os.path.expanduser('~') + '/.config/bassa/' elif platform.system() == 'Windows': configdir = os.path.expanduser('~') + '/%app_data%/bassa/' elif platform.system() == 'Darwin': configdir = os.path.e...
scorelab/Bassa
components/core/ConfReader.py
ConfReader.py
py
987
python
en
code
164
github-code
97
[ { "api_name": "platform.system", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "platform.system", "l...
37716081102
#!/usr/bin/env python """ A complex-ish mox test example. .. moduleauthor: Enji Cooper .. date: April 2014 """ import sqlite3 import unittest import mox from nose.tools import ( assert_raises, ) tmp_database = None def setup(): """Initialize an sqlite3 object in memory with a dummy table""" global t...
ngie-eign/scratch
programming/python/archive/mox_test.py
mox_test.py
py
2,513
python
en
code
5
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 26, "usage_type": "call" }, { "api_name": "mox.Mox", "line_number": 95, "usage_type": "call" }, { "api_name": "nose.tools.assert_raises", "line_number": 109, "usage_type": "call" } ]
20452893120
import itertools import re from eth_abi.exceptions import ( ParseError, ABITypeError, ) from eth_abi.grammar import ( parse as parse_type, normalize as normalize_type, ) from func_sig_registry.utils.solidity import ( get_arg_types, validate_standard_type, ) DYNAMIC_TYPES = ['bytes', 'string']...
pipermerriam/ethereum-function-signature-registry
func_sig_registry/utils/events_solidity.py
events_solidity.py
py
4,897
python
en
code
201
github-code
97
[ { "api_name": "itertools.chain", "line_number": 43, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 69, "usage_type": "call" }, { "api_name": "re.VERBOSE", "line_number": 86, "usage_type": "attribute" }, { "api_name": "re.compile", "line_num...
73323366398
import json import csv def json_csv(location_path): with open(location_path) as f: data = json.load(f) posts = data['posts'] users = data['users'] u = {} for i in users.keys(): u.update({i:users[i]['username']}) csvHeader = ['ID','Species Name','Count','Date','Time','...
damaniayash/dragonfly-species-identification
Task3_Scripts/Task3-JSON-CSV.py
Task3-JSON-CSV.py
py
1,922
python
en
code
0
github-code
97
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 15, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 44, "usage_type": "call" } ]
14405988238
from celery import task from django.core.mail import send_mail from .models import Order @task def order_created(order_id): order = Order.objects.get(id = order_id) subject = 'Order number {}'.format(order.id) message = 'Dear, {0}, Thank you for your purchase.' \ 'Your order number is: {1}'....
korneichukIk/ecommerce
order/tasks.py
tasks.py
py
437
python
en
code
0
github-code
97
[ { "api_name": "models.Order.objects.get", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Order.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Order", "line_number": 8, "usage_type": "name" }, { "api_name": "django.c...
33773751515
from django.urls import path, include from stock import views app_name = 'stock' urlpatterns = [ path('', views.ShowStockList.as_view(), name="stock_list"), path('add-stock/', views.StockAddForm.as_view(), name="stock_add"), path('view-stock/<slug:product_id>', views.StockViewForm.as_view(), name="stock_v...
wwwzaptaycom/zaptay
stock/admin_urls.py
admin_urls.py
py
483
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "stock.views.ShowStockList.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "stock.views.ShowStockList", "line_number": 7, "usage_type": "attribute" }, { "ap...
30182765612
import os import logging import jax from mpi4py import MPI from .api import easydist_shard, get_opt_strategy, set_device_mesh from .sharding_interpreter import EDJaxShardingAnn from .bridge import jax2md_bridge __all__ = [ "easydist_shard", "get_opt_strategy", "set_device_mesh", "EDJaxShardingAnn", "jax2md_bridg...
alibaba/easydist
easydist/jax/__init__.py
__init__.py
py
1,158
python
en
code
51
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "jax._src", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "jax.config.update", ...
70741508158
from os.path import join import pickle import copy import numpy as np import torch class BaseRLAlgo: def __init__( self, actor, actor_optim, critic, critic_optim, action_range, n_step=4, gamma=0.99, device="cpu" ): self.actor = ...
Daffan/ros_jackal
rl_algos/base_rl_algo.py
base_rl_algo.py
py
6,112
python
en
code
19
github-code
97
[ { "api_name": "torch.tensor", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 61, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number...
7745801142
import io from os.path import abspath, join, dirname from bddrest.authoring import when, status, response, Update from sqlalchemy_media import StoreManager from jaguar.models import Member, Message, Room from jaguar.tests.helpers import AutoDocumentationBDDTest, cas_mockup_server THIS_DIR = abspath(join(dirname(__f...
mkhfring/pychat
jaguar/tests/test_message_get.py
test_message_get.py
py
2,963
python
en
code
2
github-code
97
[ { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line...
18446101972
from flask import Flask, render_template, flash, request, redirect, url_for from flask_wtf.file import FileField, FileRequired from werkzeug.utils import secure_filename from werkzeug.datastructures import CombinedMultiDict from wtforms import Form, TextField, SelectField, TextAreaField, validators, StringField,\ ...
darkette/Tactools
app_genscript.py
app_genscript.py
py
8,183
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "local_defs.mydefs.UPLOAD_FOLDER", "line_number": 19, "usage_type": "attribute" }, { "api_name": "local_defs.mydefs", "line_number": 19, "usage_type": "name" }, { "api_name": "wt...
30845059797
#!/usr/bin/env python from bucoffea.helpers.dataset import extract_year from bucoffea.processor.executor import run_uproot_job_nanoaod from bucoffea.helpers.cutflow import print_cutflow from coffea.util import save import coffea.processor as processor import argparse def parse_commandline(): parser = argparse.Ar...
bu-cms/bucoffea
bucoffea/scripts/run_quick.py
run_quick.py
py
2,722
python
en
code
8
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "bucoffea.helpers.dataset.extract_year", "line_number": 26, "usage_type": "argument" }, { "api_name": "bucoffea.monojet.monojetProcessor", "line_number": 34, "usage_type": "c...
40638093514
# -*- coding: utf-8 -*- from flask import request, jsonify from . import api from application import db from application.models.menu import Menu from application.models.mixin import SerializableModelMixin from application.lib.rest.auth_helper import required_token, required_admin # create - name, category @api.route(...
mindoool/Rndining-db
application/api/menu.py
menu.py
py
3,959
python
en
code
0
github-code
97
[ { "api_name": "flask.request.get_json", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 14, "usage_type": "name" }, { "api_name": "flask.jsonify", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.jsonify", ...
26360033554
""" Draw fields =========== """ # %% # The objective here is to manipulate a multivariate stochastic process :math:`X: \Omega \times \mathcal{D} \rightarrow \mathbb{R}^d`, # where :math:`\mathcal{D} \in \mathbb{R}^n` is discretized on the mesh :math:`\mathcal{M}` # and exhibit some of the services exposed by the *Proce...
openturns/openturns
python/doc/examples/probabilistic_modeling/stochastic_processes/plot_process_manipulation.py
plot_process_manipulation.py
py
5,161
python
en
code
198
github-code
97
[ { "api_name": "openturns.Log.Show", "line_number": 25, "usage_type": "call" }, { "api_name": "openturns.Log", "line_number": 25, "usage_type": "attribute" }, { "api_name": "openturns.RegularGrid", "line_number": 32, "usage_type": "call" }, { "api_name": "openturns...
2573383101
#!/usr/bin/env python3 from argparse import ArgumentParser import pandas as pd import risk_stratification import extract_features def annotate_with_diagnoses_used(risk_df, diags_df, cutoff, codes): # dates within their test date pruned_diags_df = diags_df[diags_df.date >= cutoff] pruned_diags_df["UID"]...
josepablocam/pdac-diag-model
analyze_high_risk_labels.py
analyze_high_risk_labels.py
py
4,997
python
en
code
0
github-code
97
[ { "api_name": "pandas.merge", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.merge", "line_number": 37, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 52, "usage_type": "call" }, { "api_name": "risk_stratification...
24599915442
from PyQt4 import QtGui import pyqtgraph as pg import numpy from math import isinf import os.path import csv class FiberPlot(QtGui.QFrame): """ """ def __init__(self, parent=None): super().__init__(parent) self.dataFile = "" self.fiberData = None toolbar = self.initTool...
cbrunet/fibermodes
fibermodesgui/fibereditor/fiberplot.py
fiberplot.py
py
7,249
python
en
code
15
github-code
97
[ { "api_name": "PyQt4.QtGui.QFrame", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 9, "usage_type": "name" }, { "api_name": "pyqtgraph.PlotWidget", "line_number": 22, "usage_type": "call" }, { "api_name": "PyQt4.QtGui.QV...
25274454502
from os import replace from gspread.client import Client import jsonpickle from karim import LOCALHOST from gspread.models import Spreadsheet, Worksheet from oauth2client.service_account import ServiceAccountCredentials import gspread import os, re import json from datetime import datetime from karim.secrets import sec...
VIKASIND2/karim
karim/modules/sheet.py
sheet.py
py
10,039
python
en
code
1
github-code
97
[ { "api_name": "karim.secrets.secrets.get_var", "line_number": 16, "usage_type": "call" }, { "api_name": "karim.secrets.secrets", "line_number": 16, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 25, "usage_type": "call" }, { "api_name": "os...
11706454921
from __future__ import print_function from functools import wraps as ft_wraps import sys, llapi, os from llapi import * from header import * class PropertyNotFound(Exception): def __init__(self, obj, intf, prop): self.obj = obj self.intf = intf self.prop = prop class MethodNotFound(Exception): def __init__(s...
anyc/pysdbus
pysdbus/pysdbus.py
pysdbus.py
py
42,860
python
en
code
0
github-code
97
[ { "api_name": "sys.modules", "line_number": 142, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 163, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 240, "usage_type": "attribute" }, { "api_name": "sys.v...
38779984084
"""Functions for the crawl.py module""" import io import os from os import path from copy import deepcopy import numpy as np import pandas as pd import yaml from mechanize import Browser, Link from .crawl_classes import LearnPage from ..config.constants import DATA_PATH from .crawl_help_fcts import * from ..organize...
Lukas2357/ProSRL
pysrl/crawler/crawl_fcts.py
crawl_fcts.py
py
15,913
python
en
code
0
github-code
97
[ { "api_name": "mechanize.Browser", "line_number": 30, "usage_type": "call" }, { "api_name": "mechanize.Browser", "line_number": 19, "usage_type": "name" }, { "api_name": "mechanize.Link", "line_number": 53, "usage_type": "name" }, { "api_name": "mechanize.Link", ...
12665977876
import pygame from pygame.locals import * import time import random class Bullet(object): def __init__(self,screen,x,y): self.x = x+40 self.y =y-20 self.screen = screen self.bullet=pygame.image.load("./feiji/bullet-3.gif").convert() def display(self): self.screen.blit(sel...
aikermerry/py-
飞机大战/fly.py
fly.py
py
4,061
python
en
code
0
github-code
97
[ { "api_name": "pygame.image.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.image", ...
244529015
import numpy as np import matplotlib.pyplot as plt #%% #-------------------------------Analisis de intervalo entre chunks---------------------------- #ojo puede que sea ; no tab interchunk1000 = np.loadtxt('barrido_frec_rampa0.01.txt', delimiter = '\t', unpack = True) #plt.plot(interchunk1000) interchunk48000 = np.lo...
MatiasZanini/Grupo-Burne-Zanini-V2
analisis_daq.py
analisis_daq.py
py
3,934
python
es
code
0
github-code
97
[ { "api_name": "numpy.loadtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", ...
74989792640
from datetime import datetime from project.infrastructure.drivers.redis.adapter import RedisAdapter from project.infrastructure.drivers.rabbitmq.adapter import RabbitMqAdapter from project.infrastructure.drivers.elasticsearch.adapter import ElkAdapter from project.domain.lifecheck.repositories.model_status import Life...
farlleyferreira/ms-fastapi-template
api/project/domain/lifecheck/business_rules/status.py
status.py
py
2,525
python
en
code
33
github-code
97
[ { "api_name": "project.domain.lifecheck.validations.status.ValidateHelth", "line_number": 19, "usage_type": "call" }, { "api_name": "project.domain.lifecheck.repositories.model_status.Details", "line_number": 39, "usage_type": "call" }, { "api_name": "project.domain.lifecheck.rep...
35930222341
from locust import User,task,constant import logging class MyFirstTest(User): wait_time = constant(1) @task def launch(self): print("Launching the URL") logging.info("This is logging info") @task def search(self): print("Searching") logging.error("If there error, t...
acharjeeauntor/Locust_Load_Test_Practice
logging.py
logging.py
py
502
python
en
code
0
github-code
97
[ { "api_name": "locust.User", "line_number": 4, "usage_type": "name" }, { "api_name": "locust.constant", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 10, "usage_type": "call" }, { "api_name": "locust.task", "line_number...
15334966290
import numpy as np import sklearn.neural_network as sklearn_nn from src.models.regression_models import BasicModelBase class MultilayerPerceptron(BasicModelBase): def __init__(self, response_var, covariates, log_covariates, log_correction, log_correction_const, regularization_weight=None, norma...
UCIDataLab/fire_prediction
src/models/mlp.py
mlp.py
py
1,244
python
en
code
7
github-code
97
[ { "api_name": "src.models.regression_models.BasicModelBase", "line_number": 8, "usage_type": "name" }, { "api_name": "sklearn.neural_network.MLPRegressor", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.neural_network", "line_number": 22, "usage_type": ...
33928558324
"""more table Revision ID: 51a87e85213e Revises: 8d0b3efe3f27 Create Date: 2022-07-08 12:16:33.880338 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '51a87e85213e' down_revision = '8d0b3efe3f27' branch_labels = None depends_on = None def upgrade(): # ##...
walkeradkins/whatnext
migrations/versions/20220708_121633_more_table.py
20220708_121633_more_table.py
py
820
python
en
code
0
github-code
97
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
7156069793
from django.urls import path from todolist.views import * app_name = 'todolist' urlpatterns = [ path('', show_todolist, name='show_todolist'), path('json/', show_json_todo, name='show_json_todo'), path('add/', create_task_ajax, name='create_task_ajax'), path('login/', login_user, name='login'), pa...
joselinprmt/repo-tugas-pbp
todolist/urls.py
urls.py
py
473
python
en
code
0
github-code
97
[ { "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", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
9522344395
import datetime import functools import os import subprocess import typing as t def get_version( version: t.Tuple[int, int, int, t.Literal["alpha", "beta", "rc", "final"], int] ): """Return a PEP 440-compliant version number from VERSION.""" # Now build the two parts of the version number: # main = X...
Dog-Egg/django-oasis
src/django_oasis/utils/version.py
version.py
py
1,977
python
en
code
0
github-code
97
[ { "api_name": "typing.Tuple", "line_number": 9, "usage_type": "attribute" }, { "api_name": "typing.Literal", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path", "li...
40051931838
import torch from torch import nn from ..losses import loss_funcs from ..tools import stack_mean class TriModel(nn.Module): def __init__(self, name, share_model, sub_models, loss_func='mee', check_stable=True, threshold_tri=1.0, threshold_self=1.0, alpha_tri=1.0, stable_K=9): super().__init__() sel...
XinNoil/PyTools
basictorch_v2/models/trinet.py
trinet.py
py
3,286
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "tools.stack_mean", "line_number": 29, "usage_type": "call" }, { "api_name": "tools.stack_mean", "...
36107229674
#constants from constants import WEEKDAYS, BASECONTAINER #built-in imports import json import random def intervalGenerator() -> list: """ An interval Generator. Returns an array of arrays with an structure of [[start, finish, pay]] """ flag = True start = 0 intervals = [] while flag...
Tomas-Li/ioet-application
DataGenerator/paymentGenerator.py
paymentGenerator.py
py
1,000
python
en
code
0
github-code
97
[ { "api_name": "random.randint", "line_number": 19, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 20, "usage_type": "call" }, { "api_name": "constants.BASECONTAINER.copy", "line_number": 34, "usage_type": "call" }, { "api_name": "constants....
12245479814
#!/usr/bin/env python3 # -*- coding: future_fstrings -*- """ Utility script """ import sys import datetime import re from db_sync_tool.utility import mode, system, helper, output database_dump_file_name = None class DatabaseSystem: MYSQL = 'MySQL' MARIADB = 'MariaDB' def run_database_command(client, comm...
jackd248/db-sync-tool
db_sync_tool/database/utility.py
utility.py
py
7,783
python
en
code
15
github-code
97
[ { "api_name": "db_sync_tool.utility.system.config", "line_number": 29, "usage_type": "attribute" }, { "api_name": "db_sync_tool.utility.system", "line_number": 29, "usage_type": "name" }, { "api_name": "db_sync_tool.utility.mode.run_command", "line_number": 31, "usage_typ...
41010303488
# -*- coding: utf-8 -*- import os import time import cv2 import numpy as np from scipy.signal import fftconvolve from multiprocessing import Pool, cpu_count import math from math import pi sum_imageset = 6 path = "/home/sheldon/camvideo_6/" def normxcorr2(imagePath1, imagePath2, channel, mode="same"): if channe...
SheldonLeeLXY/TopologicalMap
similarity.py
similarity.py
py
4,859
python
en
code
0
github-code
97
[ { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 23, ...
30029075226
from dash.dependencies import Input, Output def add_clientside_callbacks_crossfiltering(app): # Age graph -> age selector slider # This is a callback from selecting an age range on the age graph, to the age control. app.clientside_callback( """function(count_graph_selected) { /...
mannca/www_hl_dashboard
app/util/crossfiltering_callbacks.py
crossfiltering_callbacks.py
py
2,879
python
en
code
0
github-code
97
[ { "api_name": "dash.dependencies.Output", "line_number": 21, "usage_type": "call" }, { "api_name": "dash.dependencies.Input", "line_number": 21, "usage_type": "call" }, { "api_name": "dash.dependencies.Output", "line_number": 49, "usage_type": "call" }, { "api_nam...
74979196477
import numpy as np import random from collections import namedtuple import time import importlib from moves import * from display import * State = namedtuple('State', ['batman', 'alfred', 'field', 'socks']) size = 8 # could also make this periodic field = np.ones([size, size], dtype='bool') initial_batman = (0, 0)...
ananduri/alfred
simulation.py
simulation.py
py
1,993
python
en
code
0
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 15, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 44, "usage_type": "call" }, { "api_name": "time.sleep", "lin...
32712334090
import copy import math import random from typing import * import torch from torch import Tensor from torch import nn from torch.nn import functional as F from transformers import modeling_bart as bart from transformers.modeling_utils import BeamHypotheses, calc_banned_ngram_tokens, calc_banned_bad_words_ids, \ to...
SapienzaNLP/spring
spring_amr/modeling_bart.py
modeling_bart.py
py
60,795
python
en
code
115
github-code
97
[ { "api_name": "torch.arange", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 26, "usage_type": "name" }, { "api_name": "transformers.modeling_bart...
19888533812
import torch.nn as nn import torch.nn.functional as F from cnns.nnlib.pytorch_layers.conv_picker import Conv def get_conv(args, in_channels, out_channels, kernel_size, stride=1, padding=0, bias=True): return Conv(kernel_sizes=[kernel_size], in_channels=in_channels, out_channels=[out_c...
adam-dziedzic/bandlimited-cnns
cnns/nnlib/pytorch_architecture/net_synthetic.py
net_synthetic.py
py
1,349
python
en
code
17
github-code
97
[ { "api_name": "cnns.nnlib.pytorch_layers.conv_picker.Conv", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name"...
7897573592
"""Main script """ from application.process import Process from application.app import App from utils.data_reader import get_properties properties = get_properties() DEBUG = properties.get("DEBUG").data def main(): if DEBUG == "FALSE": proc = Process() proc.start() else: app = App() ...
strzecha/Educational-Process
main.py
main.py
py
378
python
en
code
0
github-code
97
[ { "api_name": "utils.data_reader.get_properties", "line_number": 8, "usage_type": "call" }, { "api_name": "application.process.Process", "line_number": 14, "usage_type": "call" }, { "api_name": "application.app.App", "line_number": 17, "usage_type": "call" } ]
31477750481
import os from io import open from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name =...
ChanMo/django-wechat-pay
setup.py
setup.py
py
1,334
python
en
code
32
github-code
97
[ { "api_name": "io.open", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 5...
72282229759
""" Authors: Asker Brejnrod & Arjun Sampath This file contains useful methods for plotting binned ms2 spectra data Notable libraries used are: - numpy: https://numpy.org/doc/stable/ - pandas: https://pandas.pydata.org - seaborn: https://seaborn.pydata.org - matplotlib: https://matplotlib.org - nim...
askerdb/ms2binner
ms2binner/visualization.py
visualization.py
py
6,770
python
en
code
0
github-code
97
[ { "api_name": "numpy.exp", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 32, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.close", "line_number": 44, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "...
6843806435
from django.shortcuts import render, redirect from django.http import HttpResponse from django.forms import inlineformset_factory from .models import * from .form import OrderForm from django.contrib.auth.forms import UserCreationForm from django.contrib import messages # Create your views here. def home(request): ...
funsojoba/CRM_django
crm_app/views.py
views.py
py
2,886
python
en
code
0
github-code
97
[ { "api_name": "django.shortcuts.render", "line_number": 30, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 35, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 46, "usage_type": "call" }, { "api_name"...
35496809547
"""IngrafenApp URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-b...
jjacaitu/IngrafenApp-2.0
IngrafenApp/IngrafenApp/urls.py
urls.py
py
3,698
python
es
code
1
github-code
97
[ { "api_name": "django.urls.path", "line_number": 24, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 24, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 24, "usage_type": "name" }, { "api_name": "...
34771222397
import sys import pandas as pd import numpy as np from scipy.stats import chi2_contingency from scipy.stats import mannwhitneyu OUTPUT_TEMPLATE = ( '"Did more/less users use the search feature?" p-value: {more_users_p:.3g}\n' '"Did users search more/less?" p-value: {more_searches_p:.3g} \n' ...
Ericzhouhy/CMPT353-Computational-Data-Science
e6/ab_analysis.py
ab_analysis.py
py
2,724
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pandas.read_json", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "scipy.stats.chi2_contingen...
9753816237
import numpy as np from numpy import linalg from matplotlib import pyplot as plt import Rosenbrock def EnsembleSampler(X0, N, L, alpha): # Functions to evaluate the density, grad log density, and Hessian of the # minus log density. log_pi = Rosenbrock.log_pi MCMC_chain = np.zeros((N+1, L, len(X0[0,:])...
terrencealsup/MonteCarloMethods
HW5/code/EnsembleSampler.py
EnsembleSampler.py
py
2,025
python
en
code
0
github-code
97
[ { "api_name": "Rosenbrock.log_pi", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.mod", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random.randint", ...
73140437119
import numpy as np import matplotlib.pyplot as plt from numpy.ma import log a = .6 s = np.random.logseries(a, 10000) count, bins, ignored = plt.hist(s) def logseries(k, p): return -p ** k / (k * log(1 - p)) plt.plot(bins, logseries(bins, a) * count.max() / logseries(bins, a).max(), 'r') plt.show()
yzozulya/numpy_test_examples
scipy_doc/routines.random.html/numpy.random.logseries.py
numpy.random.logseries.py
py
316
python
en
code
0
github-code
97
[ { "api_name": "numpy.random.logseries", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotl...
71436648638
import torch import torch.nn as nn import math class LSTM(nn.Module): def __init__( self, input_size, hidden_size, ): super().__init__() self.input_size = input_size self.hidden_size = hidden_size # forget layer self.W_f = nn.Parameter(torch.Ten...
lorenzinigiovanni/nlu-project
LSTM.py
LSTM.py
py
2,576
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
71579925440
import itertools n = int(input()) nails = [] for i in range(n): x, y = map(int, input().split()) nails.append((x, y)) max_area = 0 for corners in itertools.combinations(nails, 4): x_values = [c[0] for c in corners] y_values = [c[1] for c in corners] if len(set(x_values)) == 2 and len(set(y_valu...
Barebore/Learning_Programming
trainee/2 answer copy.py
2 answer copy.py
py
549
python
en
code
0
github-code
97
[ { "api_name": "itertools.combinations", "line_number": 13, "usage_type": "call" } ]
29237362418
from numpy.core.numeric import ones import pandas as pd import sys import numpy as np import matplotlib.pyplot as plt import math filename = sys.argv[1] sigma = float(sys.argv[2]) D = pd.read_csv(filename) D.pop('date') D.pop('rv2') #print(D) np.set_printoptions(precision=3, suppress=False, threshold=5) # Convert ...
LovingChester/DataMining
homework/hw3/Assign3.py
Assign3.py
py
2,812
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.set_printoptions", ...
6405054067
#!/usr/bin/python3 from bs4 import BeautifulSoup import requests from time import sleep from datetime import date,datetime import lxml import re def user_ans(in_name, default, example): print(f"\nE.g.: {example}") in_name = in_name.replace('_',' ').title() ans = False while ans is False: user_i...
Naderart/kino2csv
user_input.py
user_input.py
py
5,886
python
en
code
0
github-code
97
[ { "api_name": "re.sub", "line_number": 32, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 33, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 34, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 35, "usage_type"...
43184767675
import tkinter from lib.tracks import Track from lib.car import Car from brains import ParameterEvolutionBrain from random import uniform from random import randint import random from agents import ParameterEvolutionAgent from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from ...
wdjpng/CarAI
car_controller.py
car_controller.py
py
7,140
python
en
code
1
github-code
97
[ { "api_name": "keras.models.Sequential", "line_number": 17, "usage_type": "call" }, { "api_name": "tkinter.Canvas", "line_number": 21, "usage_type": "call" }, { "api_name": "lib.tracks.Track.level", "line_number": 26, "usage_type": "call" }, { "api_name": "lib.tra...
4149090912
import os import torch from torch.utils.ffi import create_extension this_file = os.path.dirname(__file__) sources = ['src/my_lib.c'] headers = ['src/my_lib.h'] defines = [] with_cuda = False if torch.cuda.is_available(): print('Including CUDA code.') sources += ['src/my_lib_cuda.c'] headers += ['src/my_l...
wutianyiRosun/PyTorch_Tools
extension-ffi/build.py
build.py
py
1,010
python
en
code
1
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.cuda.is_available", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda", "...
22093489066
#! /usr/bin/python import numpy as np import scipy.io.wavfile as wav import pylab import sys import scikits.audiolab import os sys.path.append('/scratch2/nxs113020/pyknograms/code/tools/pykno') from pyknogram_extraction import * def mix_files(f1,f2): base1 = f1.split('/')[-1].split('.wav')[0] base2 = f2.s...
idnavid/hmm_overlap_detection
mix_channels.py
mix_channels.py
py
2,356
python
en
code
0
github-code
97
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "scipy.io.wavfile.read", "line_number": 18, "usage_type": "call" }, { "api_name": "scipy.io.wavfile"...
74848086397
from BCI_Interface import BCI from Shell_Interface import Shell from FTP_Interface import FTP from N5180_Interface import N5180 from conman import Conman from time import sleep import datetime from math import log import csv import re import os import argparse import sys VERSION = 4 ## Argument parsing parser = argpa...
Anapollonsky/utest
freq_sweep/new/rx_lo_sweep.py
rx_lo_sweep.py
py
3,891
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "conman.Conman", "line_number": 32, "usage_type": "call" }, { "api_name": "conman.storage", "line_number": 33, "usage_type": "attribute" }, { "api_name": "datetime.da...
200012163
import dataclasses import logging from lib.targetop import TargetOp from lib import util logger = logging.getLogger(__name__) @dataclasses.dataclass class Device: name: str flash_size: int page_size: int eeprom_size: int DEVICE_SIGNATURES = { (0x1e, 0x91, 0x0a): Device("attiny2313", 2**11, 32,...
ntki/nops
lib/target/avr_spi.py
avr_spi.py
py
4,518
python
en
code
1
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 10, "usage_type": "attribute" }, { "api_name": "lib.util.cmd", "line_number": 53, "usage_type": "call" }, { "api_name": "lib.util", ...
30171704328
from django.urls import path, include from website.views import index, cadastro_candidato, cadastro_empresa, login, cadastro_cv, pagina_candidato, pagina_empresa, informacao_candidato app_name = 'curriculos' urlpatterns = [ path('', index), path('login', login), path('cadastro_empresa', cadastro_empresa)...
arenas-franklin/integra
website/urls.py
urls.py
py
577
python
pt
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "website.views.index", "line_number": 8, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "website.views....
18615633879
# -*- coding: utf-8 -*- import torch import random import os import json import argparse import pandas as pd import numpy as np from sub_edge_embedding import DrugDataset from sub_edge_embedding import DrugDataLoader from models import RealFakeDDICo from engine4rf import Engine4RealFakeDDI def config(): parser = ...
anywayas/CBA-ZI
main_real_fake.py
main_real_fake.py
py
6,133
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.random", ...
20407951209
import numpy as np import cv2 cap = cv2.VideoCapture(0) fgbg = cv2.createBackgroundSubtractorMOG2() title_window = "Substraction" slider_max = 255 learning_rate = 0.5 cv2.namedWindow(title_window, cv2.WINDOW_NORMAL) ret, frame = cap.read() rows,cols,channels = frame.shape def on_trackbar(val): global learning_rat...
tomsfernandez/computervision
background_sub/3_rt_view_background.py
3_rt_view_background.py
py
911
python
en
code
1
github-code
97
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.createBackgroundSubtractorMOG2", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2....
35169947647
import torch import torch.nn as nn from typing import Optional, Tuple from foldacc.model.modules.ops import Linear, LayerNorm from foldacc.model.modules.utils import one_hot, chunk_layer class InputEmbedder(nn.Module): def __init__( self, tf_dim: int, msa_dim: int, d_pair: int, ...
alibaba/BladeDISC
examples/PyTorch/Inference/CUDA/AlphaFold/FoldAcc/foldacc/model/modules/embedder.py
embedder.py
py
7,019
python
en
code
707
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.float", "line_n...
5541884141
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon May 21 17:53:10 2018 @author: niharika-shimona """ from IPython import get_ipython get_ipython().magic('reset -sf') import sys,os import numpy as np import pickle import matplotlib # matplotlib.use('Agg') from matplotlib import pyplot as plt # plt.ioff(...
Niharika-SD/Graph-Analysis
test_PCA.py
test_PCA.py
py
4,146
python
en
code
0
github-code
97
[ { "api_name": "IPython.get_ipython", "line_number": 9, "usage_type": "call" }, { "api_name": "Data_Extraction.Split_class", "line_number": 27, "usage_type": "call" }, { "api_name": "Data_Extraction.create_dataset", "line_number": 31, "usage_type": "call" }, { "api...
41847009105
import numpy as np import matplotlib.pyplot as plot T = 5730 m = float(input("Provide m: ")) k = -0.000121 t = np.linspace(0, 50000, 100) # e^kt = r ^ (t/T) # kt = t/T ln r # k = 1/T ln r # n(t) = n(0) e^kt = n(0) e^(t * ln r)/T # where r = 1/2 # y = m * np.exp(t/T * np.log(0.5)) y = m * np.exp(k*t) _, ax = plot.sub...
Zmroqk/Wizualizacja-i-symulacja-proces-w
Lab-2/task-4.py
task-4.py
py
430
python
en
code
0
github-code
97
[ { "api_name": "numpy.linspace", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
74981856318
import pandas as pd import numpy as np from utils import paths, read, save from utils.consts import features, datasets, n_candidates, undersampling_percentages def check_features(feats, cands): """Checks if the candidates dataframe is the same as the features dataframe after merging (e.g., if there are no re...
asgaardlab/done-21-arthur-duplicate_gamedev_questions-code
code/scripts/merge_features.py
merge_features.py
py
3,073
python
en
code
1
github-code
97
[ { "api_name": "utils.read", "line_number": 21, "usage_type": "call" }, { "api_name": "utils.paths.test_candidate_pairs", "line_number": 21, "usage_type": "call" }, { "api_name": "utils.paths", "line_number": 21, "usage_type": "name" }, { "api_name": "utils.save", ...
35804246990
from setuptools import setup, find_packages module_name = "PMAC-Trajectory-Scans" setup( name=module_name, version="0-1", description='PMAC trajectory scan motion program with a python test script ', url='https://github.com/dls_controls/PMAC-Trajectory-Scans', author='Gary Yendell', author_ema...
dls-controls/PMAC-Trajectory-Scans
setup.py
setup.py
py
863
python
en
code
1
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 5, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 13, "usage_type": "call" } ]
1756037279
#!/usr/bin/python # -*- coding: utf-8 -*- # pylint: disable=c0209, r0902, r0912, r0913, r0915 """ certificate class """ from __future__ import print_function import json from acme_srv.helper import b64_url_recode, generate_random_string, cert_san_get, cert_extensions_get, hooks_load, uts_now, uts_to_date_utc, date_to_u...
grindsa/acme2certifier
acme_srv/certificate.py
certificate.py
py
43,579
python
en
code
125
github-code
97
[ { "api_name": "acme_srv.db_handler.DBstore", "line_number": 21, "usage_type": "call" }, { "api_name": "acme_srv.helper.error_dic_get", "line_number": 22, "usage_type": "call" }, { "api_name": "acme_srv.message.Message", "line_number": 27, "usage_type": "call" }, { ...
40364652330
from memory_profiler import memory_usage from main import get_args from sort import * from tool.darknet2pytorch import Darknet from tool.torch_utils import * from tool.utils import * """hyper parameters""" use_cuda = True def mem_test(cfgfile, weightfile, filename, w, h, inpath='data/input/'): # create instance...
Tpoc311/pedestrian_tracker
memory_testing.py
memory_testing.py
py
1,660
python
en
code
0
github-code
97
[ { "api_name": "tool.darknet2pytorch.Darknet", "line_number": 15, "usage_type": "call" }, { "api_name": "main.get_args", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path", ...
37195122212
# -*- coding: utf-8 -*- """ Created on Mon Oct 28 22:12:32 2019 Save images to file. Use it if want to save the image in different format such as PNG, GIF, PEG In this script, load image in JPEG format and save in PNG format in same dictionary @author: dina """ from PIL import Image #load the image image = Image.o...
dinakrausz/Examples
UsePillow/SaveImageToFile.py
SaveImageToFile.py
py
531
python
en
code
0
github-code
97
[ { "api_name": "PIL.Image.open", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 14, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
11803284197
from django.urls import path from . import views urlpatterns = [ path('', views.writers_home_page, name = "writers_home_page"), path('blogpostdetails/<str:post_id>', views.blog_post_details, name = "blog_post_details"), path('blogpostdetails/<str:post_id>/delete', views.delete_blog_post, name = "delete_blo...
ClaudiusMango/blog
writers/urls.py
urls.py
py
723
python
en
code
0
github-code
97
[ { "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", ...
30138880947
"""empty message Revision ID: 5693a93281a4 Revises: None Create Date: 2015-10-06 18:10:18.227471 """ # revision identifiers, used by Alembic. revision = '5693a93281a4' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ###...
stoddardg/virality_prediction_game
migrations/versions/5693a93281a4_.py
5693a93281a4_.py
py
718
python
en
code
0
github-code
97
[ { "api_name": "alembic.op.add_column", "line_number": 19, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 19, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
72474659519
import sys import matplotlib.pyplot as plt from polynomial import * N = 10 #number of points d = 50 #degree of the polynomial c_sample, x_sample, y_sample = getRandomPoints(N,d, seed=N*d) x_lin = np.linspace(min(x_sample), max(x_sample), 100) y_lin = getPolynomial(x_lin, c_sample, d) plt.title("SVD fits for polynomi...
ettenhup/fun_projects
double_descent/svd_explore.py
svd_explore.py
py
680
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.title", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 13, "usage_type": "call" }, { "api_name": "m...
13934893965
from collections import defaultdict def update_post(post, group_by_id=False): # update the fields needed for the vis.js graph post["value"] = post.get("score") or 1 post["title"] = post.get("title") or post.get("id") post["shape"] = "triangle" if post.get("type") == "comment" else "dot" post["post...
itielshwartz/Hackernews-visualization
app/utils/vis.py
vis.py
py
1,759
python
en
code
2
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 33, "usage_type": "call" } ]
25046697576
from flask import Flask from flask_restful import Api, Resource, reqparse def run_server(port): app = Flask(__name__) api = Api(app) api.add_resource(Wish, "/message/wish") api.add_resource(Emoji, "/message/emoji") api.add_resource(Fireworks, "/message/fireworks") app.run(debug=True, host="0.0...
perkam/bot-sylwek
bot_sylwester/server.py
server.py
py
1,147
python
en
code
1
github-code
97
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 14, "usage_type": "name" }, { "api_name": "flask_restful.reqp...
34808107624
#!/usr/bin/env python # coding=utf-8 from __future__ import division import MySQLdb import conf # #------------------------- # Database connection #------------------------- # def connect_db(): con = MySQLdb.connect( host = conf.DB_HOST, user = conf.DB_USER, passwd = conf.DB_PASSWD, ...
MIchicho/Repackaged-APPs-detection
ResDroid/diff.py
diff.py
py
2,761
python
en
code
20
github-code
97
[ { "api_name": "MySQLdb.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "conf.DB_HOST", "line_number": 16, "usage_type": "attribute" }, { "api_name": "conf.DB_USER", "line_number": 17, "usage_type": "attribute" }, { "api_name": "conf.DB_PASSWD", ...
28691806292
from selenium import webdriver import os from os import listdir from os.path import isfile, join from tqdm import tqdm import json import sys # 輸入PDF保存的路徑 mypath = os.getcwd() if not os.path.isdir(mypath+'/pdf'): os.mkdir(mypath+"/pdf") files = [join(mypath+'/html', f) for f in listdir(mypath+'/html') if isfile(j...
moooooser999/notion_pdf_converter
script/to_pdf.py
to_pdf.py
py
1,188
python
en
code
0
github-code
97
[ { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 13...
71766733438
# Standard Python Imports import os import sys import traceback import logging # Log a message each time this module get loaded. logging.info('Loading %s, app version = %s', __name__, os.getenv('CURRENT_VERSION_ID')) def bootstrap_django(): # Declare the Django version we need. from google.appengine.dist impo...
briandorsey/WhereBeUs
www/bootstrap.py
bootstrap.py
py
2,639
python
en
code
4
github-code
97
[ { "api_name": "logging.info", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "google.appengine.dist.use_library", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.info",...
10267054710
import math from urllib.parse import urlencode from django.core.paginator import Paginator from django.template.loader import render_to_string from library.models import Book def set_pagination(request, items, item_numer=20): if not items: return [], "These is no items" params = request.GET ite...
shreekrishnaacharya/library-Django
library/utils.py
utils.py
py
1,885
python
en
code
0
github-code
97
[ { "api_name": "math.ceil", "line_number": 20, "usage_type": "call" }, { "api_name": "django.core.paginator.Paginator", "line_number": 25, "usage_type": "call" }, { "api_name": "urllib.parse.urlencode", "line_number": 44, "usage_type": "call" }, { "api_name": "djan...
36120469942
import asyncio from trafficlight.client_types import ElementWebStable from trafficlight.homerunner import HomeServer from trafficlight.internals.client import MatrixClient, NetworkProxyClient from trafficlight.internals.test import Test from trafficlight.server_types import SynapseDevelop # Test Script: # CLIENT_COUN...
matrix-org/trafficlight
trafficlight/tests/chat/test_verification_when_todevice_message_out_of_order_test.py
test_verification_when_todevice_message_out_of_order_test.py
py
1,573
python
en
code
6
github-code
97
[ { "api_name": "trafficlight.internals.test.Test", "line_number": 14, "usage_type": "name" }, { "api_name": "trafficlight.client_types.ElementWebStable", "line_number": 17, "usage_type": "call" }, { "api_name": "trafficlight.client_types.ElementWebStable", "line_number": 18, ...
14466871007
# # RDpass - Updateentryscreen # # Standard import requirements # Kivy app requirements from kivymd.app import MDApp from kivy.uix.screenmanager import Screen from kivy.properties import StringProperty, NumericProperty, ListProperty from kivy.metrics import dp from kivymd.uix.dialog import MDDialog from kivymd.uix.b...
jeffreyrdcs/RDPass-GUI
screens/updateentryscreen.py
updateentryscreen.py
py
6,710
python
en
code
18
github-code
97
[ { "api_name": "kivy.uix.screenmanager.Screen", "line_number": 22, "usage_type": "name" }, { "api_name": "RDconfig.rdconfig.hn_medium", "line_number": 24, "usage_type": "attribute" }, { "api_name": "RDconfig.rdconfig", "line_number": 24, "usage_type": "name" }, { "...
72152704959
# -*- coding: utf-8 -*- import json import re from decimal import Decimal field_names = ['current_location', 'current_experience', 'current_date'] find_exp = r'exp\d*' find_time = r'tm\d*.d*' with open("rpg.json", "r") as read_file: dungeon_data = json.load(read_file) class Hero: def __init__(self, mobs,...
fykvon/Study-projects
GameDndlite/Game_DnDlite.py
Game_DnDlite.py
py
8,712
python
ru
code
0
github-code
97
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "re.search", "line_number": 88, "usage_type": "call" }, { "api_name": "re.search", "line_number": 89, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 90...
71343270399
from cx_Freeze import setup, Executable import os os.environ['TCL_LIBRARY'] = r'C:\ProgramData\Miniconda3\tcl\tcl8.6' os.environ['TK_LIBRARY'] = r'C:\ProgramData\Miniconda3\tcl\tk8.6' base = None executables = [Executable("file_open_dialog.py", base=base)] packages = ["idna"] options = { 'build_exe': { ...
pdubucq/gists
file_open_dialog_setup.py
file_open_dialog_setup.py
py
582
python
en
code
0
github-code
97
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cx_Freeze.Executable", "line_number": 9, "usage_type": "call" }, { "api_name": "cx_Freeze.setup", ...
11731716750
import contextlib import datetime import logging import traceback from persistent.list import PersistentList LEVELS = { logging.DEBUG: 'debug', logging.INFO: 'info', logging.WARNING: 'warning', logging.ERROR: 'error', logging.CRITICAL: 'critical', } class PersistentLog(PersistentList): def...
karlproject/karl
karl/box/log.py
log.py
py
1,822
python
en
code
48
github-code
97
[ { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.WARNING", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.ERR...
37270528331
import requests import logging import json from SmsSender import SendMessageReceiver from UrlCreator import get_url, headers class SendSmsRequest(SendMessageReceiver): uuid = "" def __init__(self): logging.debug(SendSmsRequest.__class__.__name__) def send_message_request(self): url = get...
Gopihegde/PythonForRest
SmsRequester.py
SmsRequester.py
py
960
python
en
code
0
github-code
97
[ { "api_name": "SmsSender.SendMessageReceiver", "line_number": 8, "usage_type": "name" }, { "api_name": "logging.debug", "line_number": 12, "usage_type": "call" }, { "api_name": "UrlCreator.get_url", "line_number": 15, "usage_type": "call" }, { "api_name": "request...
22933282857
from collections import deque from typing import Optional ''' 116. Populating Next Right Pointers in Each Node | Medium You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: struct Node { int val; Node *left; ...
Varun-Date98/LeetCode150
Next_Right_Pointer.py
Next_Right_Pointer.py
py
1,522
python
en
code
0
github-code
97
[ { "api_name": "typing.Optional", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.Optional", ...
28986030380
from matplotlib import pyplot as plt from colorseq import DistinctColors dc_h = DistinctColors(20, (0.0, 1.0), 1.0, 1.0) dc_s = DistinctColors(20, 0.4, (0.1, 1.0), 1.0) dc_v = DistinctColors(20, 0.4, 1.0, (0.1, 1.0)) dc_comb = DistinctColors( 20, (0.0, 1.0), (0.1, 1.0), (0.7, 1.0), h_shuffle=True, s_sh...
j-i-l/ColorSequence
examples/simple_scatter.py
simple_scatter.py
py
1,043
python
en
code
4
github-code
97
[ { "api_name": "colorseq.DistinctColors", "line_number": 4, "usage_type": "call" }, { "api_name": "colorseq.DistinctColors", "line_number": 5, "usage_type": "call" }, { "api_name": "colorseq.DistinctColors", "line_number": 6, "usage_type": "call" }, { "api_name": "...
5698964000
import argparse import logging import numpy import mesh_annotate.Config import mesh_annotate.Mesh import mesh_annotate.Expression # parse command line options l_parser = argparse.ArgumentParser( description='Mesh annotations in EDGE.' ) l_parser.add_argument( '-x', '--xml', dest = 'xml', ...
hewhocannotbetamed/edge
tools/processing/mesh_annotate/mesh_annotate.py
mesh_annotate.py
py
2,914
python
en
code
null
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging...
74944057278
import cv2 import math import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import random import time from Simulator.Constants import HFOV, VFOV, IMG_WIDTH, IMG_HEIGHT, TARGET_POINTS class CameraSim: #constants for https://www.amazon.com/Microsoft-H5D-00013-LifeCam-Cinema/dp/B...
NathanMalta/TargetAcquisition
Simulator/CameraSim.py
CameraSim.py
py
3,227
python
en
code
0
github-code
97
[ { "api_name": "Simulator.Constants.HFOV", "line_number": 17, "usage_type": "name" }, { "api_name": "Simulator.Constants.VFOV", "line_number": 17, "usage_type": "name" }, { "api_name": "Simulator.Constants.IMG_WIDTH", "line_number": 17, "usage_type": "name" }, { "a...
19207447250
import datetime import random def load_pending_tasks(): try: with open("data.txt", "r") as file: tasks = file.readlines() tasks = [task.strip() for task in tasks] return tasks except FileNotFoundError: return [] def save_pending_tasks(tasks): with...
swami-hai-ham/To-do-list-coach---David-goggins
Coach.py
Coach.py
py
3,064
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 37, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 37, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 40, "usage_type": "call" }, { "api_name": "datet...
43587998669
from nose.tools import * from mock import MagicMock import pandas as pd from philharmonic import Schedule from philharmonic.scheduler.bcf_scheduler import * from philharmonic.simulator.environment import FBFSimpleSimulatedEnvironment from philharmonic.simulator.simulator import FBFSimulator from philharmonic.simulato...
philharmonic/philharmonic
philharmonic/scheduler/tests/test_bcf_scheduler.py
test_bcf_scheduler.py
py
4,102
python
en
code
8
github-code
97
[ { "api_name": "philharmonic.Cloud", "line_number": 16, "usage_type": "call" }, { "api_name": "philharmonic.simulator.environment.FBFSimpleSimulatedEnvironment", "line_number": 17, "usage_type": "call" }, { "api_name": "mock.MagicMock", "line_number": 18, "usage_type": "ca...
43148172863
from lxml import etree, objectify from StringIO import StringIO from utils import fence_pair, Splitter_Symbols class norm_splitter: __fpair = fence_pair() __dtd = '' __xml_parser = etree.XMLParser() __relation_symbols = set([]) def __init__(self, dtd, relation_fl): self.__dtd = dtd ...
frozstone/dependency_graph
utilities/norm_splitter.py
norm_splitter.py
py
2,821
python
en
code
2
github-code
97
[ { "api_name": "utils.fence_pair", "line_number": 6, "usage_type": "call" }, { "api_name": "lxml.etree.XMLParser", "line_number": 8, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 8, "usage_type": "name" }, { "api_name": "lxml.etree.XMLParser", ...
11958981365
import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl import genai_evaluation as ge from genai_evaluation import multivariate_ecdf, ks_statistic import nogan_synthesizer as ns from nogan_synthesizer import NoGANSynth from nogan_synthesizer.preprocessing import wrap_category_col...
badshahmukherjeeSAS/Synthetuc_Data
NoGAN_library_sudents.py
NoGAN_library_sudents.py
py
7,619
python
en
code
null
github-code
97
[ { "api_name": "warnings.simplefilter", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.core.common.random_state", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.core", "line_number": 14, "usage_type": "attribute" }, { "api_name":...
20793517062
import netifaces as nif def hello(): return { 'mac_addresses': __mac() } def __mac(): macs = {} for iface in nif.interfaces(): macs[iface] = nif.ifaddresses(iface)[nif.AF_LINK][0]['addr'] return macs
astral1/vagrant-salt-test
salt/roots/_grains/mac_address.py
mac_address.py
py
251
python
en
code
1
github-code
97
[ { "api_name": "netifaces.interfaces", "line_number": 10, "usage_type": "call" }, { "api_name": "netifaces.ifaddresses", "line_number": 11, "usage_type": "call" }, { "api_name": "netifaces.AF_LINK", "line_number": 11, "usage_type": "attribute" } ]