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
28105491571
from flask import Flask import pandas as pd import numpy as np from flask import request from sklearn.feature_extraction.text import CountVectorizer from sklearn.metrics.pairwise import cosine_similarity app = Flask(__name__) def create_soup(x): return x['task_title'] + ' ' + x['difficulty_level'] + ' '+x['task_...
M-Hammad0/recommendation-engine
app.py
app.py
py
3,255
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction...
20020535165
import yfinance ' some text '.strip a = "AB" print(a.lower) asx_value = 7111.4 date = "2021-01-25" units = 1 currency = "AUD" print(f"The closing value of {units} unit of the All Ordinaries on {date} was {asx_value} {currency}.") # Downloads Qantas share price beginning 1 January 2020 tic = "QAN.AX" start = '2020-0...
TerryChan74/z5466707_lecture
main.py
main.py
py
415
python
en
code
0
github-code
18
[ { "api_name": "yfinance.download", "line_number": 18, "usage_type": "call" } ]
25660929949
#this is a comment from collections import Counter def checkAnagram(num1,num2): bin1 = bin(num1)[2:] bin2 = bin(num2)[2:] zeros = abs(len(bin1)-len(bin2)) if (len(bin1)>len(bin2)): bin2 = zeros * '0' + bin2 else: bin1 = zeros * '0' + bin1 dict1 = Counter(bin1) dict2 = Counter(bin2) if dict1 == dic...
GyanPrakashSinghIIITG/Create-your-pull-request-for-Hactoberfest
Python_Algorithms/is_anagram.py
is_anagram.py
py
504
python
en
code
6
github-code
18
[ { "api_name": "collections.Counter", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 13, "usage_type": "call" } ]
41219784875
import pytest from chalice import UnprocessableEntityError, ChaliceViewError, NotFoundError from fire_manager.application.firefighter.remove_firefighter.remove_firefighter_error_serializers import \ RemoveFirefighterErrorSerializers from fire_manager.domain.firefighter.remove_firefighter.remove_firefighter_usecase...
MiguelCatalan/fire.manager
test/application/remove_firefighter/test_remove_firefighter_error_serializers.py
test_remove_firefighter_error_serializers.py
py
2,230
python
en
code
0
github-code
18
[ { "api_name": "fire_manager.domain.firefighter.remove_firefighter.remove_firefighter_usecase.FirefighterNotFound", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 15, "usage_type": "call" }, { "api_name": "chalice.NotFoundError", "line...
4090519187
"""scrapli_netconf.transport.plugins.system.transport""" from io import BytesIO from scrapli.exceptions import ScrapliConnectionNotOpened from scrapli.transport.base import BaseTransportArgs from scrapli.transport.plugins.system.transport import PluginTransportArgs, SystemTransport # imported from base driver _ = Plu...
HWNET12/Nornir
.venv/lib/python3.9/site-packages/scrapli_netconf/transport/plugins/system/transport.py
transport.py
py
2,112
python
en
code
0
github-code
18
[ { "api_name": "scrapli.transport.plugins.system.transport.PluginTransportArgs", "line_number": 9, "usage_type": "name" }, { "api_name": "scrapli.transport.plugins.system.transport.SystemTransport", "line_number": 12, "usage_type": "name" }, { "api_name": "scrapli.transport.base.B...
16057371709
import requests from bs4 import BeautifulSoup def get_html(url): response = requests.get(url) html = response.text soup = BeautifulSoup(html, 'html.parser') return soup def get_table_data(table): teams = table.find_all('tr') for team in teams: team_info = dict() info = team.fin...
SyedMohamedHyder/WebScraping
PremierLeague/pl.py
pl.py
py
1,027
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" } ]
32210089860
from torch import nn import torch class MyNet(nn.Module): def __init__(self): # 第一个方法,初始化 super(MyNet, self).__init__() # 继承父类的方法 self.layers = nn.Sequential( nn.Conv2d(3, 11, 3), # 输入通道为3,输出通道为11,卷积核为3*3 nn.LeakyReLU(), # 激活一下 nn.MaxPool2d(3), ...
Gary144/How_to_Build_a_DeepLearning_Project
From_Begin_to_Final/net.py
net.py
py
2,007
python
en
code
0
github-code
18
[ { "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.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
26945116952
import base64 import functools import os from django.conf import settings from django.contrib.auth import login, logout from django.core import signing from django.core.urlresolvers import reverse from django.db.models import Q from django.http import HttpResponseRedirect from django.utils.encoding import force_bytes ...
squarewave/addons-server
src/olympia/accounts/views.py
views.py
py
15,536
python
en
code
null
github-code
18
[ { "api_name": "olympia.core.logger.core.logger.getLogger", "line_number": 37, "usage_type": "call" }, { "api_name": "olympia.core.logger.core", "line_number": 37, "usage_type": "attribute" }, { "api_name": "olympia.core.logger", "line_number": 37, "usage_type": "name" }...
34714229688
import os import sys sys.path.insert(0, os.path.realpath(os.getcwd())) import importlib import os import sys import time from fabric.api import local from fabric.decorators import task import version from secrets import pypi_auth def fatal(msg): print("Fatal error: {}; exiting.".format(msg)) sys.exit(1) ...
elehcimd/hmm_filter
fabfile.py
fabfile.py
py
5,572
python
en
code
10
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
14181212212
import numpy as np from scipy.io import loadmat import pickle import random window_len = 30*256 pid = 1 file_x = r'\Users\Owner\Desktop\chb-mit\data\patient{0}\features_se.mat'.format(pid) file_y = r'\Users\Owner\Desktop\chb-mit\data\patient{0}\y_data{0}.npy'.format(pid) interval_file = r'\Users\Owner\Desktop\chb-mi...
jopineda/csc2516_project
svm_features.py
svm_features.py
py
1,342
python
en
code
1
github-code
18
[ { "api_name": "scipy.io.loadmat", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 16, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.int", "line_number"...
14375553955
import discord import os import json from discord.ext import commands, tasks from itertools import cycle def get_prefix(client, message): with open('prefixes.json', 'r') as f: prefixes = json.load(f) return prefixes[str(message.guild.id)] intents = discord.Intents.all() client = commands.Bot(com...
richardrxn/Symbot
bot.py
bot.py
py
2,608
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.Intents.all", "line_number": 14, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 14, "usage_type": "attribute" }, { "api_name": "discord.ext.comman...
70989189481
from collections import defaultdict from utils.env import Environment class JobProcessor(): def __init__(self, param_dict): self.env = Environment() self.job_name = 'job_{0}'.format(self.env.get_env()) self.jobparam_dict = param_dict[self.job_name] self.build_table() self.d...
hashmup/genie
genie/simulator/jobprocessor.py
jobprocessor.py
py
3,155
python
en
code
1
github-code
18
[ { "api_name": "utils.env.Environment", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 15, "usage_type": "call" }, { "api_name": "...
21009349503
import pandas as pd import numpy as np import matplotlib.pyplot as plt import warnings from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder, OrdinalEncoder from xgboost import XGBClassifier from sklearn.metrics import ( ...
M2Max/AdultCensusIncomeClassification
Confronto.py
Confronto.py
py
2,982
python
en
code
0
github-code
18
[ { "api_name": "warnings.simplefilter", "line_number": 19, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 20, "usage_type": "call" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 30, "usage_type": "call" }, { "api_...
10662883274
import random from typing import List, Tuple, Any from jass.agents.agent import Agent from jass.logic.card import Card, Suit from jass.logic.deck import Deck from jass.logic.exceptions import GameOver from jass.logic.player import Player from jass.logic.trick import Trick GOAL = 1000 class Team: def __init__(se...
gregunz/JassAI
jass/logic/game.py
game.py
py
7,543
python
en
code
0
github-code
18
[ { "api_name": "jass.logic.player.Player", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "jass.logic.player.Player", "line_number": 21, "usage_type": "name" }, { "api_name": "jass.lo...
36252982325
import sys, os, json from subprocess import Popen, PIPE api_url = 'https://api.github.com/repos/tikzit/tikzit' tok = os.getenv('GITHUB_TOKEN', '') if tok == '': print("Must set GITHUB_TOKEN environment variable.") sys.exit(1) # pretty-print JSON responses def pr(j): print(json.dumps(j, indent=2)) # call GitHub A...
tikzit/tikzit
scripts/gh.py
gh.py
py
918
python
en
code
1,028
github-code
18
[ { "api_name": "os.getenv", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 10, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 13, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 24...
33854667261
import torch from modules.bnn.modules.linear import BayesLinear from modules.bnn.modules.emp_linear import EmpBayesLinear from modules.bnn.modules.ext_emp_linear import ExtEmpBayesLinear from modules.bnn.modules.mlg_linear import MLGBayesLinear from modules.bnn.modules.cm_linear import CMBayesLinear from modules.bnn.m...
mattcodeins/Individual-Research-Project
bayes_approx/modules/bnn/functional.py
functional.py
py
5,802
python
en
code
0
github-code
18
[ { "api_name": "torch.log", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.pow", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.pow", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 27, ...
41726578255
from sklearn import svm, metrics import torch import numpy as np from exp_config import ONESHOT_CONFIG import random np.random.seed(35813) torch.manual_seed(35813) ### Direct to working environment MODEL_OUTPUT_PATH = "/home/jia/Desktop/MSc_Project/imagetemplate/FedLIT/output" data_path = "/home/jia/Desktop/MSc_Proj...
jiaji01/FedLIT
experiments/one_shot.py
one_shot.py
py
3,429
python
en
code
1
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 9, "usage_type": "call" }, { "api_name": "random.randint", ...
22682032023
import shutil from pathlib import Path from unittest import TestCase import numpy as np import pytest from geojson_modelica_translator.modelica.modelica_runner import ModelicaRunner class GMTTestCase(TestCase): def setUp(self): # extend as needed to run these methods for all inherited test cases ...
urbanopt/geojson-modelica-translator
tests/base_test_case.py
base_test_case.py
py
4,907
python
en
code
17
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 33, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_...
23177737154
import asyncio import logging import json class UDPProtocol(asyncio.DatagramProtocol): def __init__(self, queue, request_handler_resolver, loop): self.queue = queue self.request_handler_resolver = request_handler_resolver self.loop = loop self.transport = None def __call__(sel...
vitrun/pok
raft/raft/network.py
network.py
py
1,062
python
en
code
2
github-code
18
[ { "api_name": "asyncio.DatagramProtocol", "line_number": 6, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "asyncio.ensure_future", "line_number": 25, "usage_type": "call" }, { "api_name": "json.lo...
13353144212
# -*- coding: utf-8 -*- import re import traceback from django.views.generic import View, ListView, TemplateView from django.contrib.auth.mixins import PermissionRequiredMixin from django.db.models import Q, F from django.http import QueryDict, JsonResponse from common.mixins import JSONResponseMixin from cmdb.models....
yyukai/oneops
apps/cmdb/views/jump_wire.py
jump_wire.py
py
9,029
python
en
code
18
github-code
18
[ { "api_name": "django.contrib.auth.mixins.PermissionRequiredMixin", "line_number": 39, "usage_type": "name" }, { "api_name": "common.mixins.JSONResponseMixin", "line_number": 39, "usage_type": "name" }, { "api_name": "django.views.generic.TemplateView", "line_number": 39, ...
42917285160
"""Upper Confidence Bound 1 This module contains a class that implements UCB1 algorithm, a famous multi-armed bandit algorithm without context. """ from __future__ import division import numpy as np import six from striatum.bandit.bandit import BaseBandit class UCB1(BaseBandit): r"""Upper Confidence Bound 1 ...
ntucllab/striatum
striatum/bandit/ucb1.py
ucb1.py
py
6,570
python
en
code
110
github-code
18
[ { "api_name": "striatum.bandit.bandit.BaseBandit", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.sqrt", "line_number": 64, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 64, "usage_type": "call" }, { "api_name": "six.viewitems"...
70404738601
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages description = "Bottle authentication, for Personal, Google, Twitter and "\ "facebook." setup( name='bottle-auth', version="0.3.3", description=description, author="Thiago Avelino", author_email="thiago@av...
avelino/bottle-auth
setup.py
setup.py
py
982
python
en
code
29
github-code
18
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 15, "usage_type": "call" } ]
4586288877
from typing import Any, Callable, MutableMapping, Optional from tensorflow import keras class HyperparameterScheduler(keras.callbacks.Callback): """Generic hyperparameter scheduler. !!! example ```python bop = lq.optimizers.Bop(threshold=1e-6, gamma=1e-3) adam = tf.keras.optimizers.A...
jwfromm/larq
larq/callbacks.py
callbacks.py
py
2,864
python
en
code
null
github-code
18
[ { "api_name": "tensorflow.keras.callbacks", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 31, "usage_type": "name" }, { "api_name": "typing...
7529824230
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision from torchvision import datasets, transforms from torch.utils.data import DataLoader from logger import Logger from datetime import datetime import numpy as np import matplotlib.pyplot as plt from matplot...
bahammel/bayes
bay_nn_gauss_1HL_m1.py
bay_nn_gauss_1HL_m1.py
py
8,502
python
en
code
1
github-code
18
[ { "api_name": "torch.set_default_tensor_type", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 25, "usage_type": "attribute" }, { "api_name": ...
26563564664
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 14 12:21:18 2018 @author: timothy """ import pandas as pd import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit from scipy import stats from sklearn import linear_model from sklearn.decomposition import PCA from skl...
tshokair/jupyterhub_hosted
regression_tools/lib/regressions_statsmodel.py
regressions_statsmodel.py
py
15,815
python
en
code
0
github-code
18
[ { "api_name": "numpy.exp", "line_number": 26, "usage_type": "call" }, { "api_name": "statsmodels.formula.api.GLS", "line_number": 46, "usage_type": "call" }, { "api_name": "statsmodels.formula.api", "line_number": 46, "usage_type": "name" }, { "api_name": "matplot...
44351049778
import time import datetime import re class CronSchedule(object): _minutes = None _hours = None _doms = None # days of the month _months = None _dows = None # days of the week def __init__(self,cron_line): kwargs = parseCronLine(cron_line) self._minutes = kwargs.get('minutes'...
medulla-tech/medulla
agent/mmc/core/tasks/cron.py
cron.py
py
11,513
python
en
code
17
github-code
18
[ { "api_name": "copy.copy", "line_number": 78, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 137, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 192, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
14932749866
import asyncio import copy import logging from dataclasses import dataclass from typing import Dict, Optional from quadradiusr_server.config import GameConfig from quadradiusr_server.constants import QrwsCloseCode from quadradiusr_server.db.base import Game from quadradiusr_server.db.base import User from quadradiusr_...
Fruktus/QuadradiusR
Server/src/quadradiusr_server/game.py
game.py
py
11,839
python
en
code
9
github-code
18
[ { "api_name": "typing.Optional", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 24, "usage_type": "name" }, { "api_name": "quadradiusr_server.game_state.GameState", "line_number": 24, "usage_type": "name" }, { "api_name"...
71642417639
# -*- coding: utf-8 -*- import scrapy class GdpDebtSpider(scrapy.Spider): name = 'gdp_debt' allowed_domains = ['worldpopulationreview.com'] start_urls = ['http://worldpopulationreview.com/countries/countries-by-national-debt/'] def parse(self, response): countries = response.xpath("//table[@c...
Adamoc14/Scrapers_And_Crawlers
Scrapers/national_debt/national_debt/spiders/gdp_debt.py
gdp_debt.py
py
780
python
en
code
0
github-code
18
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" } ]
29664088255
#!/usr/bin/python from RPLCD.i2c import CharLCD from gpiozero import RotaryEncoder, Button, Buzzer import threading import os import sys import time class One_Wire(threading.Thread): Device_Temp = ['00.0','00.0','00.0'] Device_ID = [] def __init__(self): threading.Thread.__init__(self) def r...
msandholz/CraftBeerPi
one_wire.py
one_wire.py
py
5,363
python
en
code
0
github-code
18
[ { "api_name": "threading.Thread", "line_number": 10, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 15, "usage_type": "attribute" }, { "api_name": ...
4446104979
from collections import defaultdict def solution(clothes): clothesDict = defaultdict(lambda:0) for value, key in clothes: clothesDict[key] += 1 result = 1 for key in clothesDict: result *= (clothesDict[key]+1) return result-1 #어떤 옷도 착용하지않는 경우 제외
prography-6th-study/algorithm-code
yeji/2-위장.py
2-위장.py
py
295
python
en
code
4
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 3, "usage_type": "call" } ]
4668592281
from typing import List, Optional class Solution: def findMin(self, nums: List[int]) -> Optional[int]: n = len(nums) if n == 1: return nums[0] if nums[0] < nums[-1]: return nums[0] for i in range(1,n): if nums[i] > nums[i+1]: ret...
yucongxing/leetcode
0153_Find_Minimum_in_Rotated_Sorted_Array.py
0153_Find_Minimum_in_Rotated_Sorted_Array.py
py
416
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 5, "usage_type": "name" } ]
32801954589
import datetime import json import os import boto3 def delete_recovery_point(client: boto3.client, vault_name: str, arn: str) -> None: "Deletes a recovery point with the given arn from a given vault" client.delete_recovery_point(BackupVaultName=vault_name, RecoveryPointArn=arn) def get_old_recovery_points(...
marktheskies/aws-helper-scripts
delete-old-backup-recovery-points/delete_old_recovery_points.py
delete_old_recovery_points.py
py
1,177
python
en
code
0
github-code
18
[ { "api_name": "boto3.client", "line_number": 8, "usage_type": "attribute" }, { "api_name": "boto3.client", "line_number": 14, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "attribute" }, { "api_name": "boto3.clien...
71427120680
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O...
aorursy/new-nb-3
henningyan_introduction-to-image-classification.py
henningyan_introduction-to-image-classification.py
py
3,867
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_csv", "lin...
10535269774
import sys from collections import deque input = sys.stdin.readline T = int(input()) for _ in range(T): N, M = map(int, input().split()) q = deque() temp = list(map(int, input().split())) for i in range(len(temp)): q.append((temp[i], i)) cnt = 0 while (q): max_val = q[0][0] max_idx = 0 for...
tsinghua-auto4/ct_note
BOJ/2303/12/이경훈_1966_프린터 큐.py
이경훈_1966_프린터 큐.py
py
568
python
en
code
4
github-code
18
[ { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" } ]
39778644271
#!/usr/bin/env python3 """Represent one leg of a trip.""" import datetime import numpy import shapely __all__ = ["TripLeg"] class TripLeg: """ Represent one leg of a trip. This is a base class, use one the specific classes, e.g., TransitLeg, or DirectLeg """ COLUMNS = [ "transp...
r5py/r5py
src/r5py/r5/trip_leg.py
trip_leg.py
py
4,276
python
en
code
90
github-code
18
[ { "api_name": "numpy.datetime64", "line_number": 36, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 39, "usage_type": "call" }, { "api_name": "shapely.LineSt...
30271810436
import logging from pytos.common.base_types import XML_Object_Base, XML_List from pytos.common.logging.definitions import XML_LOGGER_NAME from pytos.common.definitions import xml_tags from pytos.common.functions.xml import get_xml_text_value, get_xml_int_value, get_xml_node from pytos.securetrack.xml_objects.rest.rule...
tgratzi/pytos
pytos/securetrack/xml_objects/rest/cleanups.py
cleanups.py
py
3,634
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "pytos.common.logging.definitions.XML_LOGGER_NAME", "line_number": 9, "usage_type": "argument" }, { "api_name": "pytos.common.base_types.XML_List", "line_number": 12, "usage_type": ...
73144323561
"""A mix of tools that didn't fit anywhere else.""" import numpy as _numpy import scipy.fft as _fft class Resampler(object): """Can be used to resample arbitrarily positioned points to another set of arbitrarily positioned points.""" def __init__(self, input_points, output_points): self._set_input...
ekeberg/Python-tools
eke/tools.py
tools.py
py
17,824
python
en
code
4
github-code
18
[ { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 64, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": ...
10310754204
from django.urls import include, path from djoser.views import TokenCreateView, TokenDestroyView from rest_framework.routers import DefaultRouter from .views import CustomUserViewSet, SubscriptionListView, SubscriptionView router = DefaultRouter() router.register('users', CustomUserViewSet, basename='users') urlpat...
uprofound/foodgram-project
backend/users/urls.py
urls.py
py
752
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 7, "usage_type": "call" }, { "api_name": "views.CustomUserViewSet", "line_number": 8, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "a...
32049308635
import frida,sys def on_message(message,data): if message["type"] == 'send': print("[*]{0}".format(message["payload"])) else: print(message) # jscode = """ # Java.perform( # function () { # var v = Java.androidVersion; # send('version:'+v); # # var classnames = Java.enumerateLoad...
qiaoxin0620/hook_demo
Hook/aliCrackme_jump_pass.py
aliCrackme_jump_pass.py
py
873
python
en
code
2
github-code
18
[ { "api_name": "frida.get_usb_device", "line_number": 37, "usage_type": "call" }, { "api_name": "sys.stdin.read", "line_number": 42, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 42, "usage_type": "attribute" } ]
1058211302
from datetime import datetime, timedelta from lib2to3.pgen2.token import GREATEREQUAL from typing import Optional, Sequence from sqlalchemy import create_engine, Column, Integer, String, DateTime, Interval from sqlalchemy import func, select, text, desc, and_, or_ from sqlalchemy.orm import declarative_base, sessionma...
tglanz/webcheck
backend/repository.py
repository.py
py
3,989
python
en
code
0
github-code
18
[ { "api_name": "sqlalchemy.orm.declarative_base", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.String", "line_number": 22, "usage_type": "argument" }, { "api_name":...
71257021160
import game_data import art import random import os def cls(): os.system('cls' if os.name == 'nt' else 'clear') def print_intel(data): print(f"""here we have {data["name"]} a {data["description"]} from {data["country"]} """) def follower_count_returner(data): return data["follower_count"] ...
bv94/higher-lower-game
main.py
main.py
py
1,889
python
en
code
0
github-code
18
[ { "api_name": "os.system", "line_number": 8, "usage_type": "call" }, { "api_name": "os.name", "line_number": 8, "usage_type": "attribute" }, { "api_name": "random.choice", "line_number": 23, "usage_type": "call" }, { "api_name": "art.logo", "line_number": 27, ...
25139809699
from scipy import fftpack import numpy as np N = 10 def main(): fftpack.fft(np.ones(N)) # The first component is np.mean(x) * N z = np.ones(10) z[::2] = -1 print("Applying FFT to {}".format(z)) fftpack.fft(z) x = np.array([1, 5, 12, 7, 3, 0, 4, 3, 2, 8]) X = fftpack.fft(x) np.set_p...
666sempron999/FFT
article_examples/4.py
4.py
py
515
python
en
code
0
github-code
18
[ { "api_name": "scipy.fftpack.fft", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.fftpack", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.ones", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number...
36319801920
""" Image diff """ from PIL import Image import argparse import os def get_args() -> None: """ Gets args from user """ parser = argparse.ArgumentParser("Gets the difference between two images.") parser.add_argument('image1', help="Image 1") parser.add_argument('image2',...
eduardosm7/image-diff
img_diff.py
img_diff.py
py
1,991
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 32, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 32, "usage_type": "name" }, { "api_name": "PIL.Image.open", ...
73813124520
import json, urllib2 # need to create a copy of the job so as to create a new job # include the cml in order to embed the image files # API requisites job = "44839" key = "2e3d5066518dc1880eea0eb5c068b76b8163ae16" # API Calls new = "http://api.crowdflower.com/v1/jobs/upload.json?key=%s" % (key) copy = "https://api.c...
dataarts/3-dreams-of-black
tests/crowdflower/imageThrow.py
imageThrow.py
py
1,105
python
en
code
518
github-code
18
[ { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" }, { "api_name": "urllib2.Request", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 17, "usage_type": "call" }, { "api_name": "json.loads", "line_num...
17885907108
#!/usr/bin/env python3 import mysql.connector from mysql.connector import Error import pandas as pd import logging from mysql.connector import errorcode from multiprocessing import Lock from datetime import datetime, timedelta import collections #EmailMessage import smtplib import ssl from email.m...
roldanwselipgo/webapp
webapp/core/database/db.py
db.py
py
3,370
python
en
code
0
github-code
18
[ { "api_name": "multiprocessing.Lock", "line_number": 33, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 40, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 40, "usage_type": "attribute" }, { ...
39715636572
#!/usr/bin/env python # standard libs import pandas as pd import subprocess import numpy as np import functools import pickle from matplotlib import pyplot as plt # ML and keras import keras from sklearn.model_selection import train_test_split, StratifiedShuffleSplit from keras.preprocessing.image import ImageDataGen...
Jodahr/gans-learning
main.py
main.py
py
4,103
python
en
code
0
github-code
18
[ { "api_name": "utils.predictGenerator", "line_number": 34, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 37, "usage_type": "name" }, { "api_name": "ker...
29126217443
import os import boto3 from boto3.dynamodb.types import TypeDeserializer import concurrent.futures html_bucket_name = os.environ.get("S3_HTML", "scoreboard-html") html_bucket = boto3.resource('s3').Bucket(html_bucket_name) s3client = boto3.client('s3') serializer = TypeDeserializer() def deserialize(data): if i...
jhogstrom/aoc-highscores
boarddeletions/boarddeletions.py
boarddeletions.py
py
3,655
python
en
code
0
github-code
18
[ { "api_name": "os.environ.get", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "boto3.resource", "line_number": 7, "usage_type": "call" }, { "api_name": "boto3.client", "line_n...
69830336681
import sys import os import requests import csv import pandas as pd import numpy as np import re import pg8000 import certifi import shutil import errno os.environ['REQUESTS_CA_BUNDLE'] = os.path.join(os.path.dirname(sys.argv[0]), 'cacert.pem') # 定义插件目录 plugins_dir = 'C:/Users/rex/Anaconda3/Lib/site-packages/PyQt5/Qt5...
wenyi22/data-processing
wra_res_history_daily.py
wra_res_history_daily.py
py
5,614
python
en
code
0
github-code
18
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line...
33646407293
import pandas as pd from pandas_datareader import data as web import numpy as np import datetime as dt import sqlalchemy import matplotlib.pyplot as plt import matplotlib.cbook as cbook import matplotlib.ticker as ticker import numpy as np import os STOCK_SYMBOLS = ['AAPL'] FINANCE_SOURCE_NAME = 'yahoo' data_frames...
TundraJake/grad_project
symbol_fetcher.py
symbol_fetcher.py
py
2,638
python
en
code
0
github-code
18
[ { "api_name": "pandas_datareader.data.DataReader", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas_datareader.data", "line_number": 26, "usage_type": "name" }, { "api_name": "numpy.float32", "line_number": 27, "usage_type": "attribute" }, { "api_n...
25159917355
# import json import requests # def get_sentiment_result(text): """ 利用情感倾向分析API来获取返回数据 :param text: 输入文本 :return response: 返回的响应 """ if text == '': return '' # 请求接口 url = 'https://aip.baidubce.com/oauth/2.0/token' # 需要先获取一个 token client_id = 'gzd43E1o9zs5oYSYYGH55GUH' ...
belieberly/judicial_doc_measurement
utils/SubjectiveIndex/sentiment_classify.py
sentiment_classify.py
py
1,842
python
en
code
1
github-code
18
[ { "api_name": "requests.post", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 36, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 40, "usage_type": "call" } ]
7580146060
import subprocess import argparse # subprocess.call('ls -la', shell=True) # subprocess.call('echo $HOME', shell=True) # subprocess.call('mkdir hello',shell=True) parser = argparse.ArgumentParser() parser.add_argument("operations",help="operation") parser.add_argument("suboperation",help="sub operation") parser.add_ar...
Pranav-guptaa/Hacking-Stuff
automation/automated.py
automated.py
py
2,281
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 16, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 18, "usage_type": "call" }, { "api_name": "subprocess.cal...
10013893799
# import required module(s) import pandas as pd from ta.utils import dropna import yfinance as yf import os # ta module reference # https://technical-analysis-library-in-python.readthedocs.io/en/latest/ # import local python file(s) from . import chaikinMoneyFlow as CMF from . import movAvgConvDiv as MACD from . impo...
siegewallace06/stock-signal-prediction
techIndicators/menu.py
menu.py
py
6,121
python
en
code
0
github-code
18
[ { "api_name": "yfinance.download", "line_number": 36, "usage_type": "call" }, { "api_name": "os.system", "line_number": 45, "usage_type": "call" }, { "api_name": "os.system", "line_number": 46, "usage_type": "call" }, { "api_name": "os.system", "line_number": ...
39250185698
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #who needs ROOT anyway? import numpy as np import matplotlib.pyplot as plt from scipy import optimize from scipy.stats import norm import FC gamma = 29.3 #'magic' gamma value for g-2 #make plots in g-2 style plt.style.use('gm2.mplstyle') plt.ion() usingAllMomenta = F...
DragonDodo/gm2-EDMsim
wiggleFitter.py
wiggleFitter.py
py
7,083
python
en
code
2
github-code
18
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 16, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_na...
3638545456
# 5) (JSON exercise) Create a list of dictionaries with 5 countries, their capital, and approx. # population(of the capital) # Sample entry: # {‘Country’: ‘Canada’, ‘Capital’:’Ottawa’, ‘Population’: 883,391} # Write the dictionary to a json format file. # Check the contents of the file in notepad or other text editor. ...
JeffKingsbury/Python_courses_JAC
Python 2/class 3/5.py
5.py
py
1,171
python
en
code
0
github-code
18
[ { "api_name": "json.dump", "line_number": 19, "usage_type": "call" }, { "api_name": "json.load", "line_number": 23, "usage_type": "call" } ]
26438060190
from datetime import datetime from django.contrib.postgres.fields import JSONField from django_currentuser.middleware import get_current_user, get_current_authenticated_user from django.db import models from absolutum.mixins import CoreMixin, DisplayMixin class Log(models.Model, CoreMixin, DisplayMixin): """ ...
tayursky/med-crm
sip/models/log.py
log.py
py
2,485
python
en
code
0
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "absolutum.mixins.CoreMixin", "line_number": 9, "usage_type": "name" }, { "api_name": "...
1972442772
import logging import pandas as pd import os import numpy as np import re import pickle import json from collections import OrderedDict, defaultdict from torch.utils.data import Dataset from tikuna.common.utils import decision def load_sessions(data_dir): with open(os.path.join(data_dir, "data_desc.json"), "r") a...
edenia/tikuna
tikuna/common/dataloader.py
dataloader.py
py
6,850
python
en
code
14
github-code
18
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number":...
33100824349
from pprint import pprint import ast import re import json import requests TOKEN = "3018687491722745" class Superhero: def __init__(self,name,intelligence): self.name = name self.intelligence = intelligence hero_intel = [] def compare(heroes): max_int = 0 hero_name = "...
EgorOnischenko/http_hww
http_hw1.py
http_hw1.py
py
1,166
python
en
code
0
github-code
18
[ { "api_name": "pprint.pprint", "line_number": 24, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 41, "usage_type": "call" } ]
35889878051
import os import sys import pandas as pd from text.constants import * from text.logger import logging from datasets import load_from_disk from transformers import AutoTokenizer from transformers import AdamWeightDecay from text.exception import CustomException from text.entity.config_entity import ModelTrainerConfig fr...
Jvdboss7/text-summarization-using-tensorflow
text/components/model_trainer.py
model_trainer.py
py
5,162
python
en
code
0
github-code
18
[ { "api_name": "text.entity.artifacts_entity.DataTransformationArtifacts", "line_number": 14, "usage_type": "name" }, { "api_name": "text.entity.config_entity.ModelTrainerConfig", "line_number": 15, "usage_type": "name" }, { "api_name": "datasets.load_from_disk", "line_number"...
13673827106
from __future__ import annotations from .tensor import Tensor, Dependency from . import utils as U import numpy as np import math from typing import ( Optional, Union, List, Tuple ) def abs(x: Tensor) -> Tensor: data = np.absolute(x.data) requires_grad = x.requires_grad dependencies = [] if x....
shizuku/cranet
src/cranet/autograd/function.py
function.py
py
13,018
python
en
code
3
github-code
18
[ { "api_name": "tensor.Tensor", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.absolute", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.where", "li...
71874862441
from django.shortcuts import render from rest_framework.views import APIView from django.http import JsonResponse, HttpResponse from .models import TopicPlaylist, Playlists, Artists, PlaylistOfTopic, ArtistOfPlaylist from .serializers import TopicPlaylistSerializers, PlaylistSerializers, ArtistSerializers, PlaylistSort...
DUC-LV/zingmp3_projects
src/playlists/views.py
views.py
py
3,689
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 10, "usage_type": "name" }, { "api_name": "rest_framework.permissions.AllowAny", "line_number": 11, "usage_type": "name" }, { "api_name": "django.http.HttpResponse", "line_number": 16, "usage_type": "call" }, ...
37740711105
from datetime import datetime, timedelta from airflow.decorators import task, dag default_args = { "start_date": datetime(2022, 4, 1), } @task.python(task_id="new_getting_data", do_xcom_push=False, multiple_outputs=True) def getting_data(): print("getting data") # multiple return xcom by key return ...
marti1125/airflow2-demo
dags/task_flow_dag.py
task_flow_dag.py
py
826
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "call" }, { "api_name": "airflow.decorators.task.python", "line_number": 10, "usage_type": "call" }, { "api_name": "airflow.decorators.task", "line_number": 10, "usage_type": "name" }, { "api_name"...
36271053745
from cerberus.validator import DocumentError from flask import abort from flask import current_app as app from eve.auth import requires_auth from eve.methods.common import (build_response_document, marshal_write_response, oplog_push, parse, payload, pre_e...
pyeve/eve
eve/methods/post.py
post.py
py
11,222
python
en
code
6,647
github-code
18
[ { "api_name": "eve.methods.common.ratelimit", "line_number": 18, "usage_type": "call" }, { "api_name": "eve.auth.requires_auth", "line_number": 19, "usage_type": "call" }, { "api_name": "eve.methods.common.pre_event", "line_number": 20, "usage_type": "name" }, { "...
74045136679
import copy import math import numpy as np import scipy.stats from typing import List, Dict, Tuple, Set, Sequence Player = str PlayerIdx = int ELO_PER_STRENGTH = 400.0 * math.log10(math.exp(1.0)) P1_ADVANTAGE_NAME = "P1Advantage" class EloInfo: """Summarizes maximum likelihood Elos and uncertainties for a group of...
AlignmentResearch/KataGo-custom
python/elo.py
elo.py
py
18,973
python
en
code
4
github-code
18
[ { "api_name": "math.log10", "line_number": 10, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 19, ...
8894837739
from operator import truediv import sqlite3 as sl import json import time import datetime import os from db_dictionary import dict_factory from sys import platform global car_space_id car_space_id = 9 # no owner, need to add in frontend def convert_path_to_data(path): text_file = open(path, "r") data = text_file...
jiaqi-714/carpark-renting-system
backend/car_spaces.py
car_spaces.py
py
7,031
python
en
code
0
github-code
18
[ { "api_name": "os.getcwd", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.platform", "line_number": 24, "usage_type": "name" }, { "api_name": "sqlite3.connect", "line_number": 32, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number":...
28162500665
# https://leetcode.com/problems/task-scheduler/ # leetcode # 그리디 # 테스크 스케줄러 # 해결 못하고 책 풀이 분석함 #%% tasks = ["A","A","A","B","B","B"] n = 2 # tasks = ["A","A","A","B","B","B"] # n = 0 # tasks = ["A","A","A","A","A","A","B","C","D","E","F","G"] # n = 2 #%% from collections import Counter count = Counte...
ecosy/TIL
Algorithm/Greedy/leetcode/621_task-scheduler.py
621_task-scheduler.py
py
3,413
python
ko
code
0
github-code
18
[ { "api_name": "collections.Counter", "line_number": 18, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 25, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 54, "usage_type": "call" }, { "api_name": "heapq.heappush", ...
19115059569
from conans import ConanFile, tools class SFTPAdapterInterfaceConan(ConanFile): name = "SFTPAdapterInterface" description = "Interface of library-agnostic API for C++ to work with SFTP" author = "CSW <csw@werfen.com>" topics = ("conan", "sftp", "adapter", "wrapper") license = "MIT" generators = "visual_studio" ...
systelab/cpp-sftp-adapter
SFTPAdapterInterface/conanfile.py
conanfile.py
py
537
python
en
code
3
github-code
18
[ { "api_name": "conans.ConanFile", "line_number": 3, "usage_type": "name" } ]
29130984123
"""Multiple TQDM progress bar manager singleton class""" import random from contextlib import contextmanager from tqdm import tqdm class Mtqdm(): """Manage multiple nested tqdm progress bars with optional auto-coloring""" def __new__(cls, use_color : bool=True, palette : str="default"): if not hasattr(...
jhogsett/EMA-VFI-WebUI
webui_utils/mtqdm.py
mtqdm.py
py
11,260
python
en
code
38
github-code
18
[ { "api_name": "contextlib.contextmanager", "line_number": 176, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_number": 193, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 195, "usage_type": "call" }, { "api_name": "random.shuffle", ...
4005203214
import os import sys def bool_env(varname: str, default: bool) -> bool: """Read an environment variable and interpret it as a boolean. True values are (case insensitive): 'y', 'yes', 't', 'true', 'on', and '1'; false values are 'n', 'no', 'f', 'false', 'off', and '0'. Args: varname: the name of the vari...
tensorflow/tensorflow
tensorflow/python/ops/numpy_ops/tests/config.py
config.py
py
3,807
python
en
code
178,918
github-code
18
[ { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "absl.flags", "line_number": 80, "usage_type": "name" }, { "api_name": "absl.flags.DEFINE_bool", "line_number": 81, "usage_type": "attribute" }, { "api_name": "absl.flags", "li...
28933452141
import sys assert sys.version_info > (3, 9) from dataclasses import KW_ONLY, dataclass import hypothesis.strategies as st import pytest from hypothesis import assume, given from hydra_zen import builds, instantiate, just, make_config from hydra_zen.structured_configs._type_guards import safe_getattr from hydra_zen....
mit-ll-responsible-ai/hydra-zen
tests/test_py310.py
test_py310.py
py
2,486
python
en
code
235
github-code
18
[ { "api_name": "sys.version_info", "line_number": 3, "usage_type": "attribute" }, { "api_name": "hydra_zen.typing.DataclassOptions", "line_number": 16, "usage_type": "call" }, { "api_name": "dataclasses.KW_ONLY", "line_number": 22, "usage_type": "name" }, { "api_na...
3116720352
import numpy as np import torch from functools import reduce from collections import Counter import scipy as sp from sklearn.preprocessing import normalize class Mesh: def __init__(self, path, build_mat=False): self.path = path self.vs, self.faces = self.fill_from_file(path) self.compute_fa...
astaka-pe/Dual-DMP
util/mesh.py
mesh.py
py
13,428
python
en
code
25
github-code
18
[ { "api_name": "numpy.asarray", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.array", "line...
41762906707
from datetime import date, datetime, timedelta try: from .song_history import load_df from .song_history import get_durations except: from song_history import load_df from song_history import get_durations import pandas as pd import plotly.offline as opy pd.options.plotting.backend = "plotly" def to...
pmhalvor/website
radio/worker/plot.py
plot.py
py
6,168
python
en
code
0
github-code
18
[ { "api_name": "pandas.options", "line_number": 10, "usage_type": "attribute" }, { "api_name": "plotly.offline.plot", "line_number": 14, "usage_type": "call" }, { "api_name": "plotly.offline", "line_number": 14, "usage_type": "name" }, { "api_name": "song_history.l...
12960202378
import matplotlib.pyplot as plt import pyNN.spiNNaker as sim from spynnaker.pyNN.utilities import neo_convertor # number of neurons in each population n_neurons = 100 n_populations = 10 weights = 0.5 delays = 17.0 simtime = 1000 sim.setup(timestep=1.0, min_delay=1.0) spikeArray = {'spike_times': [[0]]} stimulus = si...
SpiNNakerManchester/IntroLab
synfire/synfire_collab.py
synfire_collab.py
py
1,709
python
en
code
5
github-code
18
[ { "api_name": "pyNN.spiNNaker.setup", "line_number": 12, "usage_type": "call" }, { "api_name": "pyNN.spiNNaker", "line_number": 12, "usage_type": "name" }, { "api_name": "pyNN.spiNNaker.Population", "line_number": 15, "usage_type": "call" }, { "api_name": "pyNN.sp...
71078560041
from typing import Any, Dict, List, Optional, Tuple from torch import Tensor import torch import torch.nn.functional as F from fairseq.models.fairseq_encoder import EncoderOut from fairseq.models.transformer import ( TransformerModel, TransformerEncoder, TransformerDecoder, ) from fairseq.models import ( ...
NJUNLP/knn-box
knnbox/models/pck_knn_mt.py
pck_knn_mt.py
py
10,477
python
en
code
95
github-code
18
[ { "api_name": "adaptive_knn_mt.AdaptiveKNNMT", "line_number": 30, "usage_type": "name" }, { "api_name": "adaptive_knn_mt.AdaptiveKNNMT.add_args", "line_number": 39, "usage_type": "call" }, { "api_name": "adaptive_knn_mt.AdaptiveKNNMT", "line_number": 39, "usage_type": "na...
71991340201
from flask import Blueprint, abort, jsonify, request import urllib from util import filter_actors_helper def construct_actor_blueprint(actor_data): """ Create blueprint to handle API routing for actors :param actor_data: JSON data for actors :return: blueprint to handle routing for actor requests """ # initiali...
lstrait2/Wikipedia-Scraper
view/actor_views.py
actor_views.py
py
3,161
python
en
code
0
github-code
18
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.abort", "line_number": 26, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 27, "usage_type": "call" }, { "api_name": "flask.request.query_string"...
8028009451
#!/usr/bin/env python ## Time-stamp: "2015-12-03 17:03:20 marine" import numpy as np from scipy.integrate import quad import matplotlib.pyplot as plt IRON = {'name' : 'Fe', 'f1' : 5.26e-9, 'f2' : 1.24, 'f3' : -3.21} def rho(f,f1,f2,f3) : """ equation 9 Gomi 2013 """ return f1*(f2 - f)**f3 def resisti...
MarineLasbleis/StratifiedCore
diffusivity/kmodel.py
kmodel.py
py
3,147
python
en
code
0
github-code
18
[ { "api_name": "numpy.exp", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 32, "usage_type": "call" }, { "api_name": "scipy.integrate.quad", "line_number...
36530735654
# Se importa openCV con cv2 para la inteligencia artificial de reconocimiento de caras import cv2 # El haarcascade tiene precargado un reconocmiento de caras face_cascade=cv2.CascadeClassifier("haarcascade_frontalface_default.xml") ds_factor=0.6 class VideoCamera(object): def __init__(self): # De esta forma se capt...
alegrimminck/codigosTesis
raspberry/flaskWebServer/camera.py
camera.py
py
1,100
python
es
code
0
github-code
18
[ { "api_name": "cv2.CascadeClassifier", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", ...
72159809320
from typing import Optional from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel from core.executor import exec_run_python, get_container app = FastAPI() origins = [ "*", ] app.add_middleware( CORSMiddleware, allow_origins=origins, allow_cr...
istommao/CodeRunner
main.py
main.py
py
1,249
python
en
code
0
github-code
18
[ { "api_name": "fastapi.FastAPI", "line_number": 10, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 18, "usage_type": "argument" }, { "api_name": "pydantic.BaseModel", "line_number": 26, "usage_type": "name" }, { "api...
12110885995
from __future__ import print_function from SOAP import * import os import profile import sys import pdb import numpy as np rfeature=[['d',0,15,0.5]] #'sftype':'psn3','par':range(1,15,3),'parvalue':range(4) runenv.otherrun=False # uniform refers to the number of anchor points in the recovery function par2={'uniform':2...
salilab/SOAP
examples/aabench/distpot7.py
distpot7.py
py
10,912
python
en
code
3
github-code
18
[ { "api_name": "numpy.arange", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 123, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_numbe...
36991836624
import wx from wx.lib.scrolledpanel import ScrolledPanel import service import gui.mainFrame import gui.shipBrowser import gui.globalEvents as GE from gui import characterEditor as CharEditor class GangView ( ScrolledPanel ): def __init__( self, parent ): ScrolledPanel.__init__ ( self, parent, id = wx....
blitzmann/pyfa-chinese
gui/gangView.py
gangView.py
py
15,675
python
en
code
0
github-code
18
[ { "api_name": "wx.lib.scrolledpanel.ScrolledPanel", "line_number": 12, "usage_type": "name" }, { "api_name": "wx.lib.scrolledpanel.ScrolledPanel.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "wx.lib.scrolledpanel.ScrolledPanel", "line_number": 15, "u...
6214406067
from typing import Callable import pytest from flexmock import flexmock from thoth.adviser.context import Context from thoth.adviser.beam import Beam from thoth.adviser.enums import RecommendationType from thoth.adviser.pipeline_builder import PipelineBuilderContext from thoth.adviser.pipeline_config import PipelineC...
thoth-station/adviser
tests/conftest.py
conftest.py
py
6,220
python
en
code
33
github-code
18
[ { "api_name": "thoth.adviser.predictor.Predictor", "line_number": 30, "usage_type": "name" }, { "api_name": "thoth.python.Project", "line_number": 39, "usage_type": "name" }, { "api_name": "flexmock.flexmock", "line_number": 41, "usage_type": "call" }, { "api_name...
3401844214
import time from selenium import webdriver from tool.loginFile.login import Login from tool.random.randomMember import RandomMember from tool.random.randomPhone import RandomPhone from tool.time.loadingTime import LoadTime url = Login.location(1) login_name = Login.name(1) login_pwd = Login.password(1) me = RandomMem...
YangZhongHai/wanboyun_0619
retail/Business/member/test5_member_message.py
test5_member_message.py
py
4,781
python
en
code
0
github-code
18
[ { "api_name": "tool.loginFile.login.Login.location", "line_number": 9, "usage_type": "call" }, { "api_name": "tool.loginFile.login.Login", "line_number": 9, "usage_type": "name" }, { "api_name": "tool.loginFile.login.Login.name", "line_number": 10, "usage_type": "call" ...
29425730114
import argparse #import string import os.path import sys import csv import collections import json # pylint: disable=invalid-name VERSION= "1.0" SUMMARY="Convert CSV to JSON and vice versa." USAGE= "%(prog)s [OPTIONS] COMMAND FILE" DESC= ''' This program converts CSV to JSON and vice versa. known COMMANDS: js...
goetzpf/bii_scripts
bin/csv2json.py
csv2json.py
py
9,066
python
en
code
0
github-code
18
[ { "api_name": "os.path.path.basename", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 25, "usage_type": "name" }, { "api_name": "sys.argv", "line_...
36239629165
import pytest from datetime import timedelta from gusty.utils import days_ago from gusty import create_dag from gusty.parsing import parse ############## ## FIXTURES ## ############## @pytest.fixture(scope="session") def parsing_dag_dir(): return "tests/dags/parsing" @pytest.fixture(scope="session") def dag(pa...
pipeline-tools/gusty
tests/test_parsing.py
test_parsing.py
py
1,929
python
en
code
187
github-code
18
[ { "api_name": "pytest.fixture", "line_number": 12, "usage_type": "call" }, { "api_name": "gusty.create_dag", "line_number": 19, "usage_type": "call" }, { "api_name": "gusty.utils.days_ago", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.timedel...
72659275559
# coding: utf-8 # In[54]: import requests from bs4 import BeautifulSoup r = requests.get("http://www.oabrj.org.br/") c = r.content c # In[55]: soup=BeautifulSoup(c,"html.parser") # In[66]: all=soup.find_all("div",{"class":""}) # In[67]: all # In[69]: import pandas as pd df= pd.DataFrame(all) df.t...
LondonComputadores/Prazo_Project
oabrj_crawl.py
oabrj_crawl.py
py
914
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 39, "usage_type": "call" }, { "api_name": "psycopg2.connect", ...
13766309379
from kivymd.app import MDApp from kivy.lang import Builder from kivymd.uix.card import MDCardSwipe from kivymd.uix.dialog import MDDialog from kivymd.uix.button import MDRaisedButton from kivymd.uix.boxlayout import MDBoxLayout from kivy.core.window import Window from kivymd.uix.snackbar import Snackbar from ki...
MrSandipSharma/Task-Manager-App
main.py
main.py
py
7,276
python
en
code
1
github-code
18
[ { "api_name": "kivymd.uix.card.MDCardSwipe", "line_number": 118, "usage_type": "name" }, { "api_name": "kivy.properties.StringProperty", "line_number": 119, "usage_type": "call" }, { "api_name": "kivy.properties.StringProperty", "line_number": 120, "usage_type": "call" ...
43429924015
from django.shortcuts import render, redirect from usuarios.models import User from django.contrib.auth import authenticate, login as logins, logout as logouts from django.http import HttpResponseRedirect from django.contrib import messages from django.contrib.auth.decorators import login_required from resenna.models i...
Estefania-M/Pagina-Web-Resenas
banos_beauchef/usuarios/views.py
views.py
py
3,963
python
es
code
1
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "usuarios.models.User.objects.filter", "line_number": 18, "usage_type": "call" }, { "api_name": "usuarios.models.User.objects", "line_number": 18, "usage_type": "attribute" ...
1546260696
from model.contact import CONTACT from selenium.webdriver.support.ui import Select import re class CONTACTHelper: def __init__(self, app): self.app = app def open_home_page(self): wd = self.app.wd if not (wd.current_url.endswith("/addressbook") and len( wd.find_eleme...
Nata82/python_training
fixture/contact.py
contact.py
py
8,729
python
en
code
0
github-code
18
[ { "api_name": "model.contact.CONTACT", "line_number": 167, "usage_type": "call" }, { "api_name": "model.contact.CONTACT", "line_number": 205, "usage_type": "call" }, { "api_name": "re.search", "line_number": 212, "usage_type": "call" }, { "api_name": "re.search", ...
2284079272
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import time import skimage from skimage import io from skimage import feature from skimage import morphology from skimage import measure import matplotlib as mpl import matplotlib.pyplot as plt import scipy.stats as stats from scipy import ndimage as...
efryer/worm_collector
worms_4AI.py
worms_4AI.py
py
8,457
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 28, "usage_type": "call" }, { "api_name": "skimage.io.imread", "line_number": 41, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 41, "usage_type": "attribute" }, { "api_name": "skimage.io.imread", ...
7864906773
import itertools # 재귀를 이용한 순열 def permute(nums): results = [] prev_elements = [] def dfs(elements): if len(elements) == 0: results.append(prev_elements[:]) for e in elements: next_elements = elements[:] next_elements.remove(e) prev_elements...
ohy1023/pythonAlgorithm
book/파이썬 알고리즘 인터뷰/비선형 자료구조/Permutations.py
Permutations.py
py
625
python
en
code
1
github-code
18
[ { "api_name": "itertools.permutations", "line_number": 24, "usage_type": "call" } ]
23873922434
import yaml trunk_template = [ 'switchport trunk encapsulation dot1q', 'switchport mode trunk', 'switchport trunk native vlan 999', 'switchport trunk allowed vlan' ] access_template = [ 'switchport mode access', 'switchport access vlan', 'switchport nonegotiate', 'spanning-tree portfast', 'spannin...
natenka/pyneng-examples-exercises
examples/17_serialization/yaml/yaml_write.py
yaml_write.py
py
564
python
en
code
234
github-code
18
[ { "api_name": "yaml.dump", "line_number": 17, "usage_type": "call" } ]
27560481356
import unittest from oracle import Oracle from helper import Helper import requests class TestStockPrediction(unittest.TestCase): def test_stock_initalized(self): oracle = Oracle("msft", requests.session()) helper = Helper(oracle) result = helper.prediction(1000) ...
kevb10/delphi-oracle
tests/test_oracle.py
test_oracle.py
py
738
python
en
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "oracle.Oracle", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.session", "line_number": 9, "usage_type": "call" }, { "api_name": "helper.Helper", ...
36735511833
import cv2 import os import numpy as np filePath = os.path.dirname(__file__) imagePath = os.path.join(filePath, "../images/smarties.png") img = cv2.imread(imagePath, -1) output = img.copy gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) blurred = cv2.medianBlur(gray, 5) circles = cv2.HoughCircles(blurred, cv2.HOUGH_GRADI...
Arijit02/opencv-start
opencv-start/houghCircle.py
houghCircle.py
py
670
python
en
code
0
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6...
32409012747
import logging import configparser from novaclient import client as novaclient from neutronclient.v2_0 import client as neutronclient import utils from neutronapi import NeutronIF logging.basicConfig(level=logging.INFO) class Booter(): """ Boots the corresponding topology. """ def __init__(self, topo...
oaraque/openstack-controller
boot.py
boot.py
py
12,387
python
en
code
0
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 22, "usage_type": "call" }, { "api_name": "utils.p...
15167538374
# -*- coding: utf-8 -*- """ Created on Sun Nov 21 00:42:37 2021 @author: vonGostev """ import numpy as np import matplotlib.pyplot as plt area_size = 3.5 * 31.25 npoints = 256 bounds = [-area_size / 2, area_size / 2] max_si_mode = np.load('mmf_SI_50_properties.npz')['modes_list'][-1] max_grin_mode = np.load('mmf_GR...
vongostev/RSF-21-12-00155-1-MMF
plot_grin_si_max_mode.py
plot_grin_si_max_mode.py
py
1,027
python
en
code
0
github-code
18
[ { "api_name": "numpy.load", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
3466471540
import sys import argparse import os import logging import colorlog from thinkhazard.settings import load_full_settings from thinkhazard.session import get_engine, get_session_factory logger = colorlog.getLogger(__name__) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) formatter = colorlog.ColoredFormatter(...
GFDRR/thinkhazard
thinkhazard/processing/__init__.py
__init__.py
py
3,391
python
en
code
30
github-code
18
[ { "api_name": "colorlog.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 14, "usage_type": "attribute" }, { "api_name": "colorlog....
3301902816
from flask import Blueprint, request, jsonify from modules.API.chat_methods import db_addChat, db_addMessageForChat, db_addUserInChat, db_getMessagesFromChat from modules.API.functions import json_validate, initRedis_db from modules.json_schemas import chat_create_schema from modules.API.functions import isUserAuthoriz...
tensor-nsk-lesson/messenger_1
src/modules/Routes/ChatManager.py
ChatManager.py
py
2,777
python
ru
code
0
github-code
18
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "modules.API.functions.initRedis_db", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_n...
37316229204
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorDatabase # type: ignore import asyncio from abc import ABC from app.service.storage import StorageWrapper from typing import Dict from app.cfg import config class MongoClient: """An object for establishing connection with a database on a mongodb-se...
aleksruss-21/Weather
app/storage/mongo_client.py
mongo_client.py
py
4,236
python
en
code
0
github-code
18
[ { "api_name": "motor.motor_asyncio.AsyncIOMotorClient", "line_number": 14, "usage_type": "name" }, { "api_name": "asyncio.get_event_loop", "line_number": 15, "usage_type": "attribute" }, { "api_name": "motor.motor_asyncio.AsyncIOMotorDatabase", "line_number": 16, "usage_t...
2163144940
#!/usr/bin/env python3 import sys import random import networkx as nx from matplotlib import rcParams rcParams['font.family'] = 'IPAexGothic' import matplotlib.pyplot as plt from geopy.distance import geodesic try: filename = sys.argv[1] except: raise RuntimeError('usage: {} '.format(sys.argv[0])) G = nx.read...
y-satotani/dynamic-betweenness
src/data/road/visualize-road-affected-nodes.py
visualize-road-affected-nodes.py
py
2,063
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.rcParams", "line_number": 6, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "networkx.read_graphml"...
18719465481
import string from pyspark.sql import SparkSession from pyspark.sql.functions import to_date, col, date_add, expr spark = SparkSession.builder.master("local").appName("dealingwithdate").getOrCreate() df = spark.read.csv("dealing*", header=True, inferSchema=True) df.show() df.printSchema() df1 = df.withCo...
muralijak/pysparkChallenges
Spark_Scenarios/DealingwithDate.py
DealingwithDate.py
py
615
python
en
code
0
github-code
18
[ { "api_name": "pyspark.sql.SparkSession.builder.master", "line_number": 6, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 6, "usage_type": "n...
25464992950
import math import matplotlib.pyplot as plt import numpy as np class LeastSquares: def __init__(self, a, b, n, m, func): if a >= b: raise Exception("Invalid a,b values (a is more than b)") self.n = n self.m = m self.__calculate_a(a, b, func) @staticmethod def...
ojles/uni
computational-methods/task3.py
task3.py
py
1,618
python
en
code
0
github-code
18
[ { "api_name": "math.pow", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.linalg.solve", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_n...