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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16009044244 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Makes an organized git repo of a book folder
"""
from __future__ import print_function
import codecs
import os
from os.path import abspath, dirname
import jinja2
import sh
from .parameters import GITHUB_ORG
class NewFilesHandler():
""" NewFilesHandler - template... | mgotliboym/gitberg | gitenberg/make.py | make.py | py | 2,764 | python | en | code | null | github-code | 6 | [
{
"api_name": "jinja2.PackageLoader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "jinja2.Environment",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "parameters.GITHUB... |
73817284026 | """An ext to listen for message events and syncs them to the database."""
import discord
from discord.ext import commands
from sqlalchemy import update
from metricity.bot import Bot
from metricity.config import BotConfig
from metricity.database import async_session
from metricity.exts.event_listeners import _utils
fr... | python-discord/metricity | metricity/exts/event_listeners/message_listeners.py | message_listeners.py | py | 2,561 | python | en | code | 39 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "metricity.bot.Bot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "... |
33831413289 | from typing import List
def two_sum(lis: List[int], target: int):
dici = {}
for i, value in enumerate(lis):
objetive = target - value
if objetive in dici:
return [dici[objetive], i]
dici[value] = i
return []
print(two_sum([1, 2, 3, 4, 5, 6], 7))
| R0bertWell/interview_questions | reexercises/two_sum_target.py | two_sum_target.py | py | 298 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
}
] |
913555112 | from coc import utils
from datetime import datetime
from discord.ext import commands, tasks
class DatabaseBackground(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.update.start()
def cog_unload(self):
self.update.cancel()
@commands.command(name="add_user")
async ... | wpmjones/coc_sample_bot | cogs/database_bg.py | database_bg.py | py | 1,440 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "coc.utils.correct_tag",
"line_number": 17,
"usage_type": "call"
},
{
"api_name":... |
8779553577 | import requests
import logging
from bs4 import BeautifulSoup
logger = logging.getLogger()
logger.setLevel(level=logging.INFO)
class WikiWorker():
def __init__(self) -> None:
self._url = "https://en.wikipedia.org/wiki/List_of_S%26P_500_companies"
@staticmethod
def _extract_company_sy... | atula28os/Multithreads | workers/WikiWorker.py | WikiWorker.py | py | 1,125 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
60098854 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import mv
class HPPs_dispersion():
def __init__(self,filename):
self.name = filename
def ReadData(self):
data_file_y = os.path.join(fr'./dispersion/y/n{self.name}.txt')
data_y = pd.read_csv(data_file_y, sep... | foreseefy/HPPP | HPPs_dispersion.py | HPPs_dispersion.py | py | 2,318 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
16543286247 | from nuitka.containers.OrderedDicts import OrderedDict
from nuitka.Errors import NuitkaOptimizationError
from nuitka.PythonVersions import python_version
from nuitka.utils.InstanceCounters import (
counted_del,
counted_init,
isCountingInstances,
)
from nuitka.Variables import LocalsDictVariable, LocalVariab... | Nuitka/Nuitka | nuitka/nodes/LocalsScopes.py | LocalsScopes.py | py | 14,085 | python | en | code | 10,019 | github-code | 6 | [
{
"api_name": "nuitka.Errors.NuitkaOptimizationError",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "nuitka.containers.OrderedDicts.OrderedDict",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "nuitka.utils.InstanceCounters.counted_init",
"line_number": ... |
41119941323 | import numpy as np
import funcs
from utils import fs, unison_shuffled_copies
# from matplotlib import pyplot as plt
# import random
# from utils import *
# import scipy.io as sio
# from copy import deepcopy
LR = 2
LR_DECAY = .9999
MIN_LR = 0.000000001
DEBUG = False
class Layer:
def __init__(self, in_dim, out_dim):... | eladfeld/deepLearningFirstAssingnment | code/NN2.py | NN2.py | py | 6,346 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random"... |
32581486001 | import pickle
import pennylane as qml
from pennylane import numpy as np
from math import pi
from ChemModel import translator, quantum_net
from Arguments import Arguments
# load molecular datasets (OH: 12 qubits)
# OHdatasets = qml.data.load("qchem", molname="OH", basis="STO-3G", bondlength=0.9)
# OHdata = O... | katiexu/QC_Contest_test | chemistryOH.py | chemistryOH.py | py | 1,791 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pennylane.numpy.random.seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pennylane.numpy.random",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pennylane.numpy",
"line_number": 18,
"usage_type": "name"
},
{
"api_name"... |
71261714748 | # -*- coding: utf-8 -*-
__all__ = ('tianshou_imitation_policy',)
from utils.vec_data import VecData
from torch import nn
import torch
import gym
import numpy as np
from tianshou.data import Batch, to_torch
class tianshou_imitation_policy(nn.Module):
def __init__(self, network, lr, weight_decay, mod... | illusive-chase/ChineseStandardMahjong | learning/imitation.py | imitation.py | py | 6,685 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "gym.spaces.Box",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
"line_n... |
44092813645 | from gym_compete_rllib import create_env
from ray.tune.registry import ENV_CREATOR, _global_registry
def test_create_env():
env_creator = _global_registry.get(ENV_CREATOR, "multicomp")
env_config = {'with_video': False,
"SingleAgentToMultiAgent": False,
"env_name": ... | HumanCompatibleAI/better-adversarial-defenses | gym_compete_rllib/test_load_rllib_env.py | test_load_rllib_env.py | py | 1,332 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "ray.tune.registry._global_registry.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ray.tune.registry.ENV_CREATOR",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "ray.tune.registry._global_registry",
"line_number": 6,
"usage_type... |
28585638952 | from sklearn.model_selection import train_test_split
import pandas as pd
import tensorflow as tf
import tensorflow_hub as hub
from datetime import datetime
import tensorflow_datasets as tfds
import bert
from bert import run_classifier
from bert import optimization
from bert import tokenization
from bert import run_clas... | jdanene/patent-language-modeling | src/analysis/code/runBert.py | runBert.py | py | 18,927 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.gfile.DeleteRecursively",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "tensorflow.gfile",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.gfile.MakeDirs",
"line_number": 63,
"usage_type": "call"
},
{
... |
9506994070 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import lxml
import lxml.html.clean
import requests
import wikipedia as wp
from transliterate import translit
def get_html_from_text(raw_html):
# clean_args = {
# "javascript": True, # strip javascript
# "page_structure": False, # leave page structur... | OSLL/adfmp18-PiterSights | crawler/site_extractor.py | site_extractor.py | py | 4,706 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "lxml.html.fromstring",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "wikipedia.set_lang",... |
24126442093 | import gc
import sys
import wx
from weakref import ref
from testutil import check_collected
foo = 0
success = 0
def test_callafter_leak():
def func():
global foo
foo = 42
wr = ref(func)
wx.CallAfter(func)
del func
# make sure that func runs
wx.GetApp().Yield()
assert wr(... | ifwe/wxpy | src/tests/test_callafter.py | test_callafter.py | py | 804 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "weakref.ref",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "wx.CallAfter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "wx.GetApp",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gc.get_referrers",
"line_numbe... |
44426526976 | import json
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, connect_nodes_bi, connect_nodes, sync_blocks, disconnect_nodes_bi
from test_framework.key import CECKey
from test_framework.blocktools import create_block, create_coinbase
from test_framework.script... | bitcoin-sv/bitcoin-sv | test/functional/bsv-block-ds-attack.py | bsv-block-ds-attack.py | py | 9,229 | python | en | code | 597 | github-code | 6 | [
{
"api_name": "test_framework.key.CECKey",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "test_framework.script.CScript",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "test_framework.script.OP_DUP",
"line_number": 20,
"usage_type": "name"
},
{
... |
30823175530 | from django.urls import path
from payment import views
app_name = 'payment'
urlpatterns = [
path('canceled/$', views.payment_canceled, name='canceled'),
path('done/$', views.payment_done, name='done'),
path('(?P<id>\d+)/process', views.payment_process, name='process')
]
| studiosemicolon/onlineshop | payment/urls.py | urls.py | py | 287 | python | en | code | 23 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "payment.views.payment_canceled",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "payment.views",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "djang... |
580269488 | import json, requests, pytest
from pydantic import BaseModel, field_validator
from unittest.mock import Mock, MagicMock
class Location:
def __init__(self, longitudecls, latitudecls):
self._longitude = longitudecls
self._latitude = latitudecls
def get_weather(self):
weather_data = requ... | MrDumper/Roma | weather_HW.py | weather_HW.py | py | 4,128 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "pydantic.field_validator",... |
18042025196 | # __init__.py
__version__ = "1.2.2" # Be sure to update version in setup.py as well
from difflib import SequenceMatcher
from sh3ll.command import command
from art import tprint
class IS(object):
def __init__(self, name="", font="", prefix="CLA>"):
self.name = name
self.font = font
self.... | HullaBrian/sh3ll | sh3ll/__init__.py | __init__.py | py | 6,104 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "art.tprint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "art.tprint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sh3ll.command.command",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "sh3ll.command.command.nam... |
855722734 | #!/usr/bin/env python
# Demonstrate how to use the vtkBoxWidget to control volume rendering
# within the interior of the widget.
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Load a volume, use the widget to control what's volume
# rendered. Basically the idea is that the vtk... | VisTrails/VisTrails | examples/vtk_examples/GUI/VolumeRenderWithBoxWidget.py | VolumeRenderWithBoxWidget.py | py | 4,067 | python | en | code | 100 | github-code | 6 | [
{
"api_name": "vtk.util.misc.vtkGetDataRoot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "vtk.vtkVolume16Reader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "vtk.vtkPiecewiseFunction",
"line_number": 21,
"usage_type": "call"
},
{
"api_na... |
33522558184 | from django.contrib.auth import get_user_model
from django.utils import timezone
from django.core.mail import send_mail
User = get_user_model()
def wish_birthday():
today = timezone.now().date()
user_list = User.objects.filter(birthday__day=today.day, birthday__month=today.month)
for item in user_li... | napitsakun/backend_task | user/cron.py | cron.py | py | 497 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 9,
"usage_type": "name"
},
{
"a... |
20825309063 | from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
def get_feature_matrix(N = 55):
#initialize the feature vector with zeros.
x_vec = np.zeros((N,3))
x = []
for i in range (N):
im = Image.open("images/image_{number}.jpg".format(number=i+1))
width, height = i... | laurivoipio/MLBP | Round3 - Classification/ML3_2.py | ML3_2.py | py | 4,065 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.mean",
"line_number": 2... |
35351271287 | '''
started on 2022/06/13
end on 2022/xx/xx
@author zelo2
'''
import torch
import torch.nn as nn
class LightGCN(nn.Module):
def __init__(self, n_user, n_item, norm_adj, device, args):
super(LightGCN, self).__init__()
self.device = device
self.n_user = n_user
self.n_item = n_item
... | zelo2/NGCF | LightGCN/lightGCN_model.py | lightGCN_model.py | py | 4,989 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.init",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
17260440247 | """
Module that can parse chess notation for individual moves. Mostly to debug
things and/or introduce chess states without having to wire up the entire
camera setup on a physical board.
Note that we're using standard Algebraic Notation:
https://en.wikipedia.org/wiki/Algebraic_notation_(chess)
Maybe we move on to FE... | stay-whimsical/screamchess | src/chess/parser.py | parser.py | py | 4,334 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 27,
... |
13300580084 | # -*- coding: utf-8 -*-
"""
Helper functions for classification and quantization
Created on Mon Dec 5 14:50:27 2016
@author: brady
"""
import os
import numpy as np
from sklearn.tree import tree, _tree
def quantize(data, precision):
"""
Turns floating point into fixed point data
:param data: vector to q... | bradysalz/MinVAD | classifier/training_helpers.py | training_helpers.py | py | 3,449 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.amax",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.minimum",
"line_number": 2... |
30168367656 | # %%
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import ks_2samp
import seaborn as sns
import pandas as pd
import random
from collections import defaultdict
from scipy.stats import ks_2samp, wasserstein_distance
from doubt import Boot
from nobias import ExplanationShiftDetector
random.seed(0)
#... | cmougan/ExplanationShift | syntheticLime.py | syntheticLime.py | py | 5,594 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "... |
14762866711 | from tkinter import *
import tkinter.font
from gpiozero import LED
import RPi.GPIO
RPi.GPIO.setmode(RPi.GPIO.BCM)
blue = LED(2)
green = LED(3)
red = LED(4)
win = Tk()
win.title("LED GUI Toggler")
myFont = tkinter.font.Font(family = 'Helvetica', size = 12, weight = "bold")
def ledToggleBlue():
if blue.is_lit:
... | chris-yl31/SIT210-Task5.2C-RPiGUI | GUI.py | GUI.py | py | 1,525 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "RPi.GPIO.GPIO.setmode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.GPIO",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "gpiozero.LED",
"li... |
31179240116 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
demand = [990,1980,3961,2971,1980]
d=0 # d% shortage allowance
Y_b = [1.3086,1.3671,1.4183,1.4538,1.5122] # Fabric yield (consumption rate) rate per garment of size 饾浗
U = 0.85
l_max= 20
e= .07 # Fabric end allowance
f= 2.90 # Fabric cost
if len(dema... | sharif8410/COP_Doc | PSO Clean notebook-Heuristic import.py | PSO Clean notebook-Heuristic import.py | py | 18,651 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.default_rng",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "numpy.dot",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
... |
19875967712 |
import numpy as np
import matplotlib.pyplot as plt
import time
import numpy as np
import pandas as pd
import time
import gc
import random
import sklearn
import matplotlib.pyplot as plt
from sklearn.model_selection import cross_val_score, GridSearchCV, cross_validate, train_test_split
from sklearn.metrics import accur... | RuizeHu/Gatech_CS_7641_UnsupervisedLearning | code/Clusters_Plot.py | Clusters_Plot.py | py | 6,940 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 71,
"usage_type": "call"
},
{
"api_name... |
25129650646 | import numpy as np
import keras
from keras.datasets import mnist
class Dataset:
def __init__(self, path, local):
"""
Initialize the MNIST dataset.
Parameters path and local are only included to fit the interface of Dataset
:param path: Ignored
:param local: Ignored
... | jessica-dl/2XB3-ML-Training | trainer/mnist_dataset.py | mnist_dataset.py | py | 804 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.float32",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name":... |
31232927085 | import logging
import requests
from io import BytesIO
from django.core.management import BaseCommand
from places.models import Place, PlaceImage
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Load information about places with media files'
def add_arguments(self, parser):
... | vitaliy-pavlenko/where_to_go | places/management/commands/load_place.py | load_place.py | py | 2,202 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.core.management.BaseCommand",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requ... |
75226773628 | import pymongo
from data_handlers import import_from_csv
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
core_db = myclient["core"]
indices_col = core_db["indices"]
historical_data_col = core_db["historical_data"]
instruments_file = "C:\\Users\\Prathiksha\\Documents\\Prashanth\\Trading\\instrumen... | prashanth470/trading | source/data/db_operations.py | db_operations.py | py | 1,622 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "data_handlers.import_from_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "data_handlers.import_from_csv",
"line_number": 13,
"usage_type": "call"
},
{
"ap... |
9489616666 | import healsparse as hs
import healpy as hp
import numpy as np
from optparse import OptionParser
def main():
usage = "%prog [options]"
parser = OptionParser(usage=usage)
parser.add_option("--input_file",type="string",dest="infilename",help="Input file",default='/pool/cosmo01_data1/des/y6_sp_maps/mangle_map... | nsevilla/utilities | converthshp.py | converthshp.py | py | 4,218 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "optparse.OptionParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "healpy.read_map",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "healpy.read_map",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.where",
... |
18308321752 | from unittest import TestCase
from sqlite3 import IntegrityError
import os
from shutil import copytree, rmtree
from random import randint, random
import uuid
from tempfile import gettempdir
from shapely.geometry import Point
import shapely.wkb
from aequilibrae.project import Project
from ...data import siouxfalls_proj... | AequilibraE/aequilibrae | tests/aequilibrae/project/test_node.py | test_node.py | py | 3,560 | python | en | code | 140 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
75331159226 | import ops
import iopc
TARBALL_FILE="drbd-utils-8.9.10.tar.gz"
TARBALL_DIR="drbd-utils-8.9.10"
INSTALL_DIR="drbd-utils-bin"
pkg_path = ""
output_dir = ""
tarball_pkg = ""
tarball_dir = ""
install_dir = ""
install_tmp_dir = ""
cc_host = ""
def set_global(args):
global pkg_path
global output_dir
global tarb... | YuanYuLin/drbd-utils | Package/CONFIG.py | CONFIG.py | py | 3,434 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ops.path_join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ops.path_join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "ops.path_join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "ops.path_join",
"line_n... |
72128887548 | from OpenGL.GL import *
from common import get_namekey
import numpy as np
import pyglet
# #---badway
# vaoidx = VAO( {0:3,1:2},
# #np.array([0,0,0, 0,0, 0.5,0,0, 1,0, 0.5,0.5,0, 1,1, 0,0.5,0, 0,1, ]).astype('float32'),
# #np.array([0,0,0, 0,0, 1,0,0, 1,0, 1,1,0, 1,1, 0,1,0, 0,1, ]).astype('float32'),
# ... | liltmagicbox/3dkatsu | objects/vao_123123.py | vao_123123.py | py | 6,982 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "common.get_namekey",
"line_nu... |
71345484349 | import logging
from typing import List
from DAL.ItemDAL.ItemDALInterface import ItemDALInterface
from Database.DBConnection import DBConnection
from Entities.Item import Item
class ItemDALImplementation(ItemDALInterface):
def create_item(self, item: Item) -> Item:
logging.info("Beginning DAL method crea... | dmerc12/143Designs | back-end/DAL/ItemDAL/ItemDALImplementation.py | ItemDALImplementation.py | py | 3,158 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "DAL.ItemDAL.ItemDALInterface.ItemDALInterface",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "Entities.Item.Item",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 12,
"usage_type": "call"
},
{
"api_... |
4086684487 | import warnings
from functools import partial
from multiprocessing import Pool
import pandas as pd
import textacy
import textacy.preprocessing
import textacy.representations
import textacy.tm
from tqdm import tqdm
tqdm.pandas()
warnings.simplefilter(action="ignore", category=FutureWarning)
preproc = textacy.preproc... | charlesdedampierre/BunkaTopics | bunkatopics/functions/extract_terms.py | extract_terms.py | py | 5,458 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "tqdm.tqdm.pandas",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "warnings.simplefilter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "textacy.preprocessin... |
30358149781 | import contextlib
import datetime
import unittest
from traits.api import Date, HasTraits, List
from traitsui.api import DateEditor, View, Item
from traitsui.editors.date_editor import CellFormat
from traitsui.tests._tools import (
BaseTestMixin,
create_ui,
requires_toolkit,
reraise_exceptions,
Too... | enthought/traitsui | traitsui/tests/editors/test_date_editor.py | test_date_editor.py | py | 6,064 | python | en | code | 290 | github-code | 6 | [
{
"api_name": "traits.api.HasTraits",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "traits.api.List",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "traits.api.Date",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "traits.api.D... |
12485496681 | # Create your views here.
id = int()
iditemcourant = int()
#-*- coding: utf-8 -*-
from django.http import HttpResponse
from django.shortcuts import render , redirect
from utilisateur.forms import *
from utilisateur.models import *
#import time
from django.core.urlresolvers import reverse
def utilisateur(request):
if r... | 3SCS/hackaton-130813 | hommilliere/utilisateur/views.py | views.py | py | 8,734 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 29,
"usage_type": "call"
},
{
"api_n... |
13130316582 | from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from frontend.views import SPAView, UserConfigSPAWebService
# spa view
VIEWS_PATTERNS = [
url(regex=r'$',
view=login_required(SPAView.as_view()),
name='spa'),
]
# config endpoint
API_PATTERNS = [... | victordelval/spa-design-basics | frontend/urls.py | urls.py | py | 549 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "frontend.views.SPAView.as_view",
"line_number": 10,
"usage_type": "call... |
32341699285 | import json
import numpy as np
import pandas as pd
import tensorflow as tf
class BalancedGroupSoftmax:
def __init__(self,
dataset_json,
category_map,
empty_class_id,
selected_locations=None,
n_groups=4,
sl_max_groups=[0, 10, 1... | alcunha/iwildcam2021ufam | classification/bags.py | bags.py | py | 6,432 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "tensorflow.io.gfile.GFile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tensorflow.io",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.DataFra... |
74056208827 | import torch
import torch.nn as nn
import torch.nn.functional as F
class BiDirectionalTreeGRU(nn.Module):
def __init__(self, n_hidden=None, n_iters=1):
super().__init__()
self.n_hidden = n_hidden
self.n_iters = n_iters
self.down_root = nn.Linear(n_hidden, n_hidden)
self.dow... | isaachenrion/jets | src/architectures/utils/bidirectional_tree_gru.py | bidirectional_tree_gru.py | py | 3,809 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
9627877293 | from . import views
from django.urls import path, include
urlpatterns = [
path('', views.index, name="index"),
path('about/', views.about, name="about"),
path('contact/', views.contact, name="contact"),
path('services/', views.services, name="services"),
path('skill/', views.skill, name="sk... | abrahammmmmmmm/dynamicPortfolio | portfolio/app1/urls.py | urls.py | py | 329 | python | en | code | 0 | github-code | 6 | [
{
"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",
... |
5478969307 | # A simple MLP network structure for point clouds,
#
# Added by Jiadai Sun
import torch
import torch.nn as nn
import torch.nn.functional as F
class PointRefine(nn.Module):
def __init__(self, n_class=3,
in_fea_dim=35,
out_point_fea_dim=64):
super(PointRefine, self).__in... | haomo-ai/MotionSeg3D | modules/PointRefine/PointMLP.py | PointMLP.py | py | 1,699 | python | en | code | 206 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
29456763062 | import abc
import os.path
from oslo_config import cfg
from oslo_log import log
import requests
import requests.certs
import six
from atrope import exception
from atrope import ovf
from atrope import paths
from atrope import utils
opts = [
cfg.StrOpt('download_ca_file',
default=paths.state_path_def... | alvarolopez/atrope | atrope/image.py | image.py | py | 6,812 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "oslo_config.cfg.StrOpt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "oslo_config.cfg",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "atrope.paths.state_path_def",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "at... |
17508200123 | from typing import List
def products_div(arr: List[int]) -> List[int]:
prod = 1
for x in arr:
prod *= x
res = [prod//x for x in arr]
return res
'''
arr: [2, 3, 4, 5,]
l: [2 23 234]
r: [5 54 543]
res: [.-345, 2-45, 23-5, 234-.]
l = []
prod = 1
for i in range(len(arr)-1):
prod *= arr[i]
... | soji-omiwade/cs | dsa/before_rubrik/array_of_array_of_products.py | array_of_array_of_products.py | py | 982 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 31,
"usage_type": "name"
}
] |
9626855200 | import pandas as pd
import numpy as np
import os
import cv2
import json
from sklearn.model_selection import train_test_split
from trainer import Trainer
from sklearn.metrics import accuracy_score, mean_absolute_error, mean_squared_error
from collections import Counter
# read the images in the same order specified by ... | SebastianCojocariu/Detect-targets-in-radar-signals | src/main.py | main.py | py | 7,992 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number... |
35463005885 | from collections import namedtuple, Counter
import warnings
from math import sqrt
import numpy as np
from scipy.stats import special_ortho_group
import pytest
import kwant
from ... import lattice
from ...builder import HoppingKind, Builder, Site
from ...system import NoSymmetry
from .. import gauge
## Utilities
sq... | kwant-project/kwant | kwant/physics/tests/test_gauge.py | test_gauge.py | py | 17,404 | python | en | code | 76 | github-code | 6 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
... |
27228829856 | """This module implements classes and independent functions related to feature extraction
module of our work.
To be specific, this module helps identify handful of best features out of humongous number
of features; created from raw data """
import numpy as np
import pandas as pd
from namedlist import namedlist
from s... | waqasbukhari/optimal_pos_placement | best_feature_extraction.py | best_feature_extraction.py | py | 18,314 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.mean_squared_error",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": ... |
34736461093 | # -*- coding: utf-8 -*-
import scrapy
import re
import json
from video_scrapy.items import *
import hashlib
from video_scrapy.settings import my_defined_urls
class YoutubeDlSpider(scrapy.Spider):
name = 'video'
youtube_dl_not_you_get = False
handle_httpstatus_list = [404]
def __init__(self, my_url=Non... | yllgl/my_video_scrapy | video_scrapy/spiders/video_spider.py | video_spider.py | py | 19,315 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "video_scrapy.youtube_dl.main",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "video_... |
41584655028 | import json
import time
import requests
# 크롤링 대상 URL 리스트
PAGE_URL_LIST = [
'http://example.com/1.page'
'http://example.com/2.page',
'http://example.com/3.page',
]
def fetch_pages():
"""페이지의 내용을 추출합니다"""
# 처리 기록 전용 로그 파일을 append 모드로 엽니다
f_info_log = open('crawler_info.log', 'a')... | JSJeong-me/2021-K-Digital-Training | Web_Crawling/python-crawler/chapter_5/get_example_domain_pages.3.py | get_example_domain_pages.3.py | py | 1,939 | python | ko | code | 7 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "json.dump",
"lin... |
42641405385 | #!/usr/bin/env python3
# Simple Script to replace cron for Docker
import argparse
import sys
from subprocess import CalledProcessError, run
from time import sleep, time
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("interval", help="Time in seconds between runs", type=int)
ar... | osssanitizer/maloss | registries/rubygems/runner.py | runner.py | py | 985 | python | en | code | 98 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
... |
33120873994 | import json
import re
from typing import Any
from aiohttp import ClientSession
from .exceptions import FailedToParseIntialData
class Client:
"""YouTube API client."""
_session: ClientSession
@classmethod
async def new(cls, host: str = "https://www.youtube.com"):
"""Create a new YouTube cli... | Flowrey/youtube-bz | youtube_bz/api/youtube/api.py | api.py | py | 1,161 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "exceptions.Fai... |
34529799093 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='quantile_transformer_tf',
version='1.2',
description='An implemen... | yandexdataschool/QuantileTransformerTF | setup.py | setup.py | py | 905 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number":... |
71184167229 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as pl
from mpl_toolkits.basemap import Basemap
# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
# are the lat/lon values of the lower left and upper right corners
# of the map.
# lat_ts is the latitu... | ddboline/programming_tests | numpy/basemap_test.py | basemap_test.py | py | 847 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.clf",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "mpl_toolkits.ba... |
33557423336 | from django.conf import settings
from django.contrib.sites.models import Site
from .models import SiteSettings
class SiteSettingsMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
try:
request.wf_site = Site.objects._get_s... | phildini/wordfugue | wordfugue/sitesettings/middleware.py | middleware.py | py | 684 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.sites.models.Site.objects._get_site_by_request",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.contrib.sites.models.Site.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.sites.models.Site",
... |
17435637259 | import pytest
from collections import defaultdict
class UndergroundSystem:
def __init__(self):
self.user_table = defaultdict(list)
self.course_table = defaultdict(list)
def checkIn(self, id: int, stationName: str, t: int) -> None:
assert len(self.user_table[id]) == 0
self.use... | naubull2/codingtests | leetcode/solved/1512_Design_Underground_System/solution.py | solution.py | py | 3,711 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": ... |
6182705632 | import urllib.request
from bs4 import BeautifulSoup
f = open("Newyork_articles.txt", 'w')
html = 'http://www.nytimes.com/'
open_url = urllib.request.urlopen(html)
soup = BeautifulSoup(open_url, 'html.parser')
article_headings = soup.find_all(class_="indicate-hover")
head = "Articles for Today:\n"
i = 0
f.wri... | Jsid2022/Python | decode_web_page.py | decode_web_page.py | py | 437 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 6,
"usage_type": "name"
},
{
"api_name":... |
19109148247 | import asyncio
import async_timeout
import aiohttp
class DiscordAttachmentHandler:
def __init__(self):
self.loop = asyncio.get_event_loop()
@staticmethod
async def fetch_json(session, url):
async with async_timeout.timeout(10):
async with session.get(url) as response:
... | Mirdalan/discord_astro_bot | dastro_bot/attachments_downloader.py | attachments_downloader.py | py | 762 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "async_timeout.timeout",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "asy... |
39215055594 | import boto3
import random
import json
topic = 'arn:aws:sns:us-east-1:511086078676:temps'
client = boto3.client('sns')
def lambda_handler(event, context):
#id de la persona (editar con el id real)
#id = '11223344'
#simulador de aparato de medir la temperatura
temp = random.uniform(36,40)
... | ansmartin/Proyecto-PYGITIC-2020 | Pruebas/Ansel/temp_to_topic.py | temp_to_topic.py | py | 598 | python | es | code | 1 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 25,
"usage_type": "call"
}
] |
70400872827 | """
Snake game view.
"""
import sys
import pygame
from snake_controller import get_mouse_position
def play_eaten_sound():
"""
Plays a crunch sound.
"""
food_eaten_sound = pygame.mixer.Sound('sounds/snake_eat_sound.wav')
pygame.mixer.Sound.play(food_eaten_sound)
def play_click_sound():
"""
... | olincollege/ultimate-snake | snake_view.py | snake_view.py | py | 9,976 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.mixer.Sound",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.Sound.play",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.m... |
4601203522 | import subprocess
import py_compile
import os
from hashlib import md5
from datetime import datetime
from django.db import models
from django.conf import settings
from .constants import TYPES
def get_filename(instance, filename):
now = datetime.now()
base = now.strftime('utility_files/%Y/%m/%d')
hash = m... | viljan/intraweb | viljan/utility/models.py | models.py | py | 2,595 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "hashlib.md5",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
14011684325 | import numpy as np
from tqdm import tqdm
from collections import Counter
import pandas as pd
class PMI():
def __init__(self, text, lang):
self.text = text
self.lang = lang
self.p_1, self.c_1 = self.get_unigram_probs()
self.bigram = self.get_joint_probs()
self.distant = self... | awmcisaac/charles | winter/npfl067/hw2/best_friends.py | best_friends.py | py | 3,872 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm... |
70497736189 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 25 20:15:51 2021
@author: blgnm
"""
import george
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.optimize import minimize
from scipy.optimize import curve_fit
import random
from astropy.stats import biweight_location
impo... | Feliconut/PurduePHYS324-LSST | SupernovaClassification.py | SupernovaClassification.py | py | 36,879 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "antares_client.search.get_by_ztf_object_id",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 71,
"usage_type": "name"
},
{
... |
34429142094 | import glfw
from OpenGL.GL import *
from OpenGL.GLU import *
import numpy as np
gCamAng = 0.
def myLookAt(eye,at,up):
w = (eye-at)/np.sqrt(np.dot(eye-at,eye-at))
u = np.cross(up, w)/np.sqrt(np.dot(np.cross(up, w), np.cross(up,w)))
v = np.cross(w, u)
M= np.array([[u[0], u[1], u[2], -np... | vctr7/Computer_Graphics | hw8.py | hw8.py | py | 2,584 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.sqrt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.cross",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 10,
... |
71951318589 | from flask import Flask, render_template, request
import os
from Prediction import deep_ocr, easy_ocr
from flask_bootstrap import Bootstrap
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField
from wtforms.validators import InputRequired, Email, Length
# webserver gateway interf... | babakmbm/Optical-Character-Recognition-OCR-SYSTEM | App.py | App.py | py | 1,289 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_bootstrap.Bootstrap",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"l... |
9535093806 | #!/usr/bin/env python3
"""
RBE/CS549 Spring 2023: Computer Vision
Author(s):
Uday Sankar (usankar@wpi.edu)
Mechatronics, Robotics and Automation Engineering,
Worcester Polytechnic Institute
"""
# Dependencies:
# opencv, do (pip install opencv-python)
# skimage, do (apt install python-skimage)
# termco... | udaysankar01/Image-Classification-using-ResNet-ResNeXt-and-DenseNet | Train.py | Train.py | py | 11,349 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sys.dont_write_b... |
70276275707 |
"""
多头注意力机制:
每个头开始从词义层面分割输出的张量,也就是每个头都想获得一组Q,K,V进行注意力机制的计算,
但是句子中的每个词的表示只获得一部分,
也就是只分割了最后一维的词嵌入向量. 这就是所谓的多头.
将每个头的获得的输入送到注意力机制中, 就形成了多头注意力机制
多头注意力机制的作用:
这种结构设计能让每个注意力机制去优化每个词汇的不同特征部分,从而均衡同一种注意力机制可能产生的偏差,
让词义拥有来自更多元的表达,从而提升模型效果
"""
import copy
import torch
import math
import numpy as np
import t... | Jacquelin803/Transformers | transformerArc/MultiHeadAttention.py | MultiHeadAttention.py | py | 7,709 | python | zh | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
35765418423 | '''
Created on Apr 21, 2014
@author: Borja
'''
import os.path
import xlrd
import __data__
class XslReader(object):
def __init__(self):
if not os.path.exists(__data__.path()):
os.makedirs(__data__.path())
self._data_path = __data__.path();
def load_ind... | weso/landportal-importers | RAWImporter/es/weso/raw/ExcelManagement/excel_reader.py | excel_reader.py | py | 2,930 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "__data__.path",
"li... |
8261658572 | import functions
import utils
from functions import greet_user
# import ecommerce.shipping
# from ecommerce.shipping import calc_shipping
from ecommerce import shipping
shipping.calc_shipping()
import math
# Google search python 3 math module
price = 10
# variable must be lower case - booleans must be capitalized
i... | Rosenmatt1/Python-101 | App.py | App.py | py | 1,575 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "ecommerce.shipping.calc_shipping",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ecommerce.shipping",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "functions.greet_user",
"line_number": 76,
"usage_type": "call"
},
{
"api_name":... |
36691623039 | import streamlit as st
from streamlit_chat import message
from streamlit_extras.colored_header import colored_header
from streamlit_extras.add_vertical_space import add_vertical_space
from hugchat import hugchat
from document_processing import index, chain
st.set_page_config(page_title="HugChat - An LLM-powered Strea... | Ubond-edu/PF1-Chatbot | streamlit_app.py | streamlit_app.py | py | 2,211 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.si... |
9773551663 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 19:36:10 2020
@author: lnajt
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 15 11:57:08 2018
@author: MGGG
"""
import networkx as nx
import random
import numpy as np
##############
'''Wilsons Algorithm'''
def random_spanning_tree_wilson(graph):
'''Th... | ElleNajt/TinyProjects | boundaryofUST.py | boundaryofUST.py | py | 4,806 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "random.choice",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "random.choice",
"lin... |
20538374789 | # https://leetcode.com/problems/counting-bits/
"""
Time complexity:- O(N)
Space Complexity:- O(N)
"""
from typing import List
class Solution:
def countBits(self, n: int) -> List[int]:
# Initialize a list 'dp' to store the number of 1 bits for each integer from 0 to 'n'.
dp = [0] * (n + 1)
... | Amit258012/100daysofcode | Day51/counting_bits.py | counting_bits.py | py | 800 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
}
] |
42890816740 | import time
from pathlib import Path
import shutil
import torch
import torch.nn
from torch.utils.tensorboard import SummaryWriter
import torch.backends.cudnn as cudnn
from . import utils
class Bone:
def __init__(self,
model,
datasets,
criterion,
... | EvgenyKashin/backbone | back/bone.py | bone.py | py | 7,736 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "torch.utils",
... |
33146835188 | from flask import Flask, jsonify, redirect, url_for, request
import os
import pymysql
app = Flask(__name__)
@app.route('/')
def index():
response = jsonify({"Choo Choo": "Welcome to your Flask app 🚅"})
response.headers.add("Access-Control-Allow-Origin", "*")
return response
@app.route('/add', method... | zpdunlap/flask | main.py | main.py | py | 2,425 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
73662491386 | from multiprocessing import Pool
import time
from datetime import datetime
from typing import Any
from tqdm import tqdm
from tqdm.contrib.concurrent import process_map
import itertools
from classifiers import project_algorithms
from data_ingestion import ingestion_functions
from sklearn.model_selection import KFold, G... | lukebrb/final_project | runners.py | runners.py | py | 3,580 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Any",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 26,
... |
33944686501 | # -*- coding: utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics.scorer import make_scorer
from sklearn import model_selection
from sklearn.base import BaseEstimator, ClassifierMixin
from... | shahraizniazi/Regression-Simulation | Final_Final/Final.py | Final.py | py | 36,277 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.xticks",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "seaborn.barplot",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
39259069256 | import logging
from django.db import transaction
from rest_framework import serializers
from rest_framework import status
from rest_framework.decorators import detail_route
from rest_framework.permissions import DjangoModelPermissions
from rest_framework.response import Response
from rest_framework.routers import Defa... | unicefuganda/eums | eums/api/distribution_plan_node/distribution_plan_node_endpoint.py | distribution_plan_node_endpoint.py | py | 5,146 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 19,
"usage_type": "name"
... |
27673839201 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import html2text
class Html2TextPipeline(object):
def process_item(self, item, spider):
for f in ('description_md'... | redapple/pyvideo-contrib | pyconfr2015/pyconfr2015/pyconfr2015/pipelines.py | pipelines.py | py | 459 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "html2text.html2text",
"line_number": 15,
"usage_type": "call"
}
] |
72490450747 | from polygon import *
import math
from functools import wraps,lru_cache
from collections import namedtuple
@validate_type(int)
@validate_params
class Polygon_sequence:
def __init__(self,n,circumradius):
""" This function initializes the number of polygons and circum radius. """
self.n = n
... | m-shilpa/EPAI | Session_10_Sequence_Types/polygon_sequence.py | polygon_sequence.py | py | 2,781 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "polygon.interiorAngle",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "polygon.edgeLength",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "polygon.apothem",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name"... |
24021214626 | """
Allows for platform-specific configuration
options.
"""
import os
from enum import Enum
from typing import Any, Dict
class BaseOrigin(Enum):
"""
Enum for the origin of the base path
"""
ENV = 1
"""The base path is specified in the environment"""
CONF = 2
"""The base path is specified ... | MattMoony/d4v1d | d4v1d/config/platforms.py | platforms.py | py | 3,549 | python | en | code | 34 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.isdir",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number":... |
39131054965 | import os
import base64
from pathlib import Path
from sys import stdout
from Get_data import get_keys
from encrypt_setting import *
class colors:
def __init__(self):
self.blue = "\033[94m"
self.red = "\033[91m"
self.end = "\033[0m"
self.green = "\033[92m"
col = colors()
def print_hacked():
prin... | realsung/Ransomeware | encrypt.py | encrypt.py | py | 2,052 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "Get_data.get_keys",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_... |
17273180201 | import numpy as np
import pickle as pkl
import networkx as nx
import scipy.sparse as sp
from scipy.sparse.linalg.eigen.arpack import eigsh
import sys
from scipy.sparse.linalg import norm as sparsenorm
from scipy.linalg import qr
# from sklearn.metrics import f1_score
def parse_index_file(filename):
"""Parse index... | matenure/FastGCN | utils.py | utils.py | py | 12,670 | python | en | code | 514 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.bool",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_... |
8316768665 | from brownie import FundMe
from scripts.helpful_scripts import get_account
def fund():
# Set variable fund_me to the latest deployment of the FundMe contract
fund_me = FundMe[-1]
account = get_account()
entrance_fee = fund_me.getEntranceFee()
print(entrance_fee)
print(f"The current entry fee i... | AgenP/brownie_fund_me | scripts/fund_and_withdraw.py | fund_and_withdraw.py | py | 618 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "brownie.FundMe",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "scripts.helpful_scripts.get_account",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "brownie.FundMe",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "scrip... |
27535979388 |
import os
import matplotlib.pyplot as plt
def get_project_path(project_name):
"""
:param project_name: 项目名称,如pythonProject
:return: ******/project_name
"""
# 获取当前所在文件的路径
cur_path = os.path.abspath(os.path.dirname(__file__))
# 获取根目录
return cur_path[:cur_path.find(project_name)] + proj... | fym1057726877/Defense | utils.py | utils.py | py | 1,115 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure... |
31280749903 | import numpy as np, glob, face_recognition, ntpath, pickle, os
from os.path import basename
from shutil import copyfile
def copy_face_image():
for i in glob.glob("data/avatars/*.jpg"):
image = face_recognition.load_image_file(i)
face_locations = face_recognition.face_locations(image)
... | chechiachang/scouter | face_recognition/encoding_file_generator.py | encoding_file_generator.py | py | 1,509 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "face_recognition.load_image_file",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "face_recognition.face_locations",
"line_number": 8,
"usage_type": "call"
},
{
"api_name"... |
17034068791 | import logging, os, json
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework import status
from app.worker.tasks import recommend_options_exe
logger = logging.getLogger(__name__)
@api_view(['GET'])
def get_recommend_options(request, format=None):
key = o... | dearvn/tdameritrade-bot | app/api/views.py | views.py | py | 816 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.respon... |
72474001787 | import random
import numpy as np
from math import sqrt, log
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
x1_list = []
x2_list = []
y_list = []
counter = 0
def drawFunc(minX, minY, maxX, maxY):
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
ax.set_xlabel('x1')
ax.set_yla... | AlexSmirno/Learning | 6 Семестр/Оптимизация/Lab_6_test.py | Lab_6_test.py | py | 7,638 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.arang... |
40243178863 | import cv2
from snooker_table import find_snooker_table
from balls import find_balls
from holes import find_holes
# Videó feldolgozás
def process_video(input_path, output_path):
# Open the video file
video_capture = cv2.VideoCapture(input_path)
# Get video properties
frame_width = int(video_capture.g... | hirschabel/SZTE-snooker | snooker/process.py | process.py | py | 8,137 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 14,
"usage_type": "attribute"
},
{
"api... |
35935636198 | from gpt4all import GPT4All
import asyncio
import websockets
import datetime
print(r'''
$$$$$$\ $$\ $$\ $$$$$$\ $$$$$$\
$$ __$$\ $$ | \__| $$ __$$\ \_$$ _|
$$ / $$ |$$ | $$\ $$$$$$\ $$$$$$\ $$\ $$ / $$ | $$ |
$$$$$$$$ |$$ | $$ ... | 76836/Akari | experimental/server.py | server.py | py | 3,098 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gpt4all.GPT4All",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "datetime... |
72013262909 |
import gym
from memory import ReplayBuff
from models import Network
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils import clip_grad_norm_
class agent():
'''DQN Agent.
Attribute:
memory: replay buffer to store transition
batch_si... | linnaeushuang/RL-pytorch | value-based/distributionalDQN/distributionalDQN_learner.py | distributionalDQN_learner.py | py | 9,928 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "gym.make",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_... |
5123241016 | """
Requests モジュールによりリモートファイルを読み込むサンプル
事前にRequestsモジュールをインストールしましょう
# pip install requests
"""
import requests
url = 'https://it-engineer-lab.com/feed'
try:
r = requests.get(url, timeout=10.0)
print(r.text)
except requests.exceptions.RequestException as err:
print(err)
# ダウンロード(読み込み + ローカル保存)
# ダウンロードして... | toksan/python3_study | network/get_by_requests.py | get_by_requests.py | py | 690 | python | ja | code | 2 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.exception... |
33644608975 | from django.shortcuts import render, redirect, get_object_or_404
from .models import Product, Category, Cart, Address, Order
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
import decimal
from django.contrib.auth.models import User
from django.contrib import messag... | digital-era-108/Ecommerce-django | storeApp/views.py | views.py | py | 7,779 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Category.objects.filter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Category.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "models.Category",
"line_number": 13,
"usage_type": "name"
},
{
"api_n... |
36572760050 | import random
import colorgram
from turtle import Turtle, Screen
colors = colorgram.extract("./example.jpg", 10)
list_colors = []
for color in colors:
current_color = color.rgb
color_tuple = (current_color[0], current_color[1], current_color[2])
list_colors.append(color_tuple)
porto = Turtle()
porto.penup... | porto-o/Python_projects | 18. hirst-painting/main.py | main.py | py | 725 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "colorgram.extract",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "turtle.Turtle",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "turtle.Screen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.choice",
"lin... |
17640174097 | """
Use blender to convert FBX (T-pose) to BVH file
"""
import os
import bpy
import numpy as np
def get_bvh_name(filename):
filename = filename.split(".")[-2]
return filename + ".bvh"
def main():
fbx_dir = "./mixamo/fbx/"
bvh_dir = "./mixamo/bvh/"
for filename in os.listdir(fbx_dir):
fbx_... | awkrail/mixamo_preprocessor | fbx2bvh.py | fbx2bvh.py | py | 935 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number"... |
43085026671 | sqmesh_min_coord = [359919.189 - 360600.0, 3972158.559 - 3973000.0]
sqmesh_step = 2.0
import h5py
import math
tmesh_data = h5py.File("visdump_surface_mesh_jaramillo_384.h5",'r')
tmesh_key = '6234'
ME_len = len(tmesh_data[tmesh_key]['Mesh']['MixedElements'])
ntris = ME_len // 4;
tricells_inodes = [[0 for x in range(... | amanzi/ats | tools/square_to_tri_mesh_data_parser/tri_square_overlap_weights.py | tri_square_overlap_weights.py | py | 9,284 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "h5py.File",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 95,
"usage_type": "attribute"
},
{
"api_name": "math.atan2",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 238,... |
21053864803 | # Import the necessary libraries
import PySimpleGUI as sg
import qrcode
# Set the theme for the UI
sg.theme('GreenMono')
# Define the layout for the app
layout = [ [sg.Text('Enter Text: ', font=('Helvetica', 12, 'bold')), sg.InputText(font=('Helvetica', 12), size=(30,1))],
[sg.Button('Create', font=('... | haariswaqas/Project2 | QR Code Generator.py | QR Code Generator.py | py | 1,401 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PySimpleGUI.theme",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Text",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.InputText",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.But... |
1499727625 | from bs4 import BeautifulSoup
import json
import logging
import requests
from Mongo import client as MongoClient
from Redis import client as RedisClient
WEB = 'https://www.gensh.in/events/promotion-codes'
class RequestErrorException(Exception):
def __init__(self, message, resp):
super().__init__(message)... | BRAVO68WEB/genshin-notify | scrapperCodes/scrapper.py | scrapper.py | py | 2,107 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.info",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Mongo.client.existCode",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "Mongo.client",
... |
18997085490 | import torch.nn as nn
from efficientnet_pytorch import EfficientNet
class EfficientNetCustom(nn.Module):
def __init__(self, model_name, in_channels, num_classes,
load_pretrained_weights=True, train_only_last_layer=False):
super(EfficientNetCustom, self).__init__()
self.model_name = model_name
... | sanjeebSubedi/cats-dogs-efficientnet | efficientNetCustom.py | efficientNetCustom.py | py | 1,204 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "efficientnet_pytorch.EfficientNet.from_pretrained",
"line_number": 16,
"usage_type": "call"
},
{
"api... |
25294948506 | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from .forms import *
from .models import *
import psycopg2
from mysite.settings import DATABASES
from psycopg2.extras import RealDictCursor
def db_answer(query):
try:
connection = psycopg2.connect(
... | Fastsnai1/Employee_log | mysite/employees/views.py | views.py | py | 6,205 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psycopg2.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mysite.settings.DATABASES",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "mysite.settings.DATABASES",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.