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
2000013829
#!/usr/bin/env python from collections import namedtuple import struct from datetime import datetime import zlib Header = namedtuple('Header', ('signature', 'version', 'offsets', 'creation_date')) unpack = lambda f, fmt: struct.unpack(fmt, f.read(struct.calcsize(fmt))) #FATHeader = namedtuple('FATHeader', 'unused time...
NickBeeuwsaert/AFDesignLoad
affinity/__init__.py
__init__.py
py
3,644
python
en
code
27
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 7, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 8, "usage_type": "call" }, { "api_name": "struct.calcsize", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.f...
6134616460
from django.urls import path from .views import ( ImageListView, ImageDetailView, ImageCreateView, ImageUpdateView, ImageDeleteView, ) from . import views urlpatterns = [ path('', ImageListView.as_view(), name='blog-home'), path('image/<int:pk>/', ImageDetailView.as_view(), name='image-deta...
BwanaQ/forthegram
blog/urls.py
urls.py
py
569
python
en
code
1
github-code
6
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "views.ImageListView.as_view", "line_number": 12, "usage_type": "call" }, { "api_name": "views.ImageListView", "line_number": 12, "usage_type": "name" }, { "api_name": "djan...
20666136386
import lib, re, random def task1(): """ Напишите программу вычисления арифметического выражения заданного строкой. Используйте операции +,-,/,*. приоритет операций стандартный. """ s = source = "(-1+2*3/5)*3+(1-2)-(-12/5)+2" # В первую очередь найти и вычислить все выражения в скобках. substr...
nadia3373/GeekBrains-Python-Developer
Introduction to Python/Seminars/6/Homework/tasks.py
tasks.py
py
4,436
python
ru
code
1
github-code
6
[ { "api_name": "re.search", "line_number": 10, "usage_type": "call" }, { "api_name": "re.split", "line_number": 17, "usage_type": "call" }, { "api_name": "lib.find_arithmetic_signs", "line_number": 18, "usage_type": "call" }, { "api_name": "re.search", "line_nu...
73628582589
import numpy as np import pygame import sys import math import random import time ROW_COUNT = 6 COL_COUNT = 7 SQUARE_SIZE = 100 WHITE = (255,255,255) BLUE = (0, 0, 200) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) RADIUS = int(SQUARE_SIZE / 2.25) WINDOW_LENGTH = 4 EMPTY = 0 PLAYER1 = 1 PLAYER2 = 2 def create...
Dschinds/Connect4
main.py
main.py
py
18,822
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 107, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 107, "usage_type": "attribute" }, { "api_name": "pygame.draw.circle", ...
21565785360
import SimpleITK as sitk import numpy as np import argparse from PIL import Image from pathlib import Path Path.ls = lambda x: sorted(list(x.iterdir())) parser = argparse.ArgumentParser( prog=__file__, formatter_class=argparse.RawDescriptionHelpFormatter, description="""Create nifti previews""") parser.ad...
Inria-Empenn/shanoir_downloader
create_previews.py
create_previews.py
py
6,082
python
en
code
2
github-code
6
[ { "api_name": "pathlib.Path.ls", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "argparse.RawDe...
5484830747
import ROOT import uproot import pandas as pd import numpy as np import argparse ROOT.gROOT.SetBatch(True) def fill_th1_hist(h, df, var): for var_val in df[var]: h.Fill(var_val) def fill_th2_hist(h, df, var1, var2): for var1_val, var2_val in zip(df[var1], df[var2]): h.Fill(var1_val, var2_val...
lbariogl/HyperRoutine
itstpc_matching_study/dau_mom_reso.py
dau_mom_reso.py
py
1,753
python
en
code
0
github-code
6
[ { "api_name": "ROOT.gROOT.SetBatch", "line_number": 7, "usage_type": "call" }, { "api_name": "ROOT.gROOT", "line_number": 7, "usage_type": "attribute" }, { "api_name": "ROOT.TH2F", "line_number": 19, "usage_type": "call" }, { "api_name": "ROOT.TH2F", "line_num...
40667252045
#################### WEB SCRAPING WITH PYTHON ########################## import requests from bs4 import BeautifulSoup import time from email.message import EmailMessage import ssl import smtplib text = 'Enter the skill to search>>' # allow the user to search the type of job they dont have the experience unkno...
Darrey1/real-time-job-alert-with-email-message
scrap.py
scrap.py
py
2,667
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "email.message.EmailMessage", "line_number": 37, "usage_type": "call" }, { "api_name": "ssl.create_...
73751459708
import torch import torch.nn as nn import torch.nn.functional as F import collections def compute_cost_volume(features1, features2, max_displacement=4): """Compute the cost volume between features1 and features2. Displace features2 up to max_displacement in any direction and compute the per pixel cost of...
dongliangcao/OCFlow
models/networks/correlation_layer.py
correlation_layer.py
py
3,103
python
en
code
4
github-code
6
[ { "api_name": "torch.nn.functional.pad", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 33, "usage_type": "name" }, { "api_name": "torch.mean", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.cat", ...
2424748730
import json import sys import warnings from pathlib import Path # import matplotlib.pyplot as plt import pandas as pd import requests class Timeseries: def __init__(self, dataset, id_timeseries="", name_timeseries=""): self.ds = dataset self._id_ds = self.ds._id self._id_proj = self.ds.c...
DHI/mikecloudio
mikecloudio/timeseries.py
timeseries.py
py
14,177
python
en
code
1
github-code
6
[ { "api_name": "warnings.warn", "line_number": 29, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 60, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 68, "usage_type": "call" }, { "api_name": "warnings.warn", "line...
25123950581
import json import logging from typing import Any from paho.mqtt.client import Client, MQTTMessage from cloudlink.models.telemetry import Telemetry class MQTTClient(Client): def __init__(self, client_id: str, host: str, port: int, telemetry_topic: str) -> None: super().__init__(client_id) self._...
OpenHerb/cloudlink
cloudlink/mqtt/client.py
client.py
py
3,009
python
en
code
1
github-code
6
[ { "api_name": "paho.mqtt.client.Client", "line_number": 9, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "paho.mqtt.client.Client", "line_number": 34, "usage_type": "name" }, { "api_name": "typi...
22964273213
"""Fano Coding Shannon coding is a basic prefix free coding. There is some confusion in literature about Shannon, Fano and Shannon-Fano codes, e.g. see Naming section of https://en.wikipedia.org/w/index.php?title=Shannon–Fano_coding&oldid=1076520027. This document uses Fano coding as described in the wiki article abov...
kedartatwawadi/stanford_compression_library
scl/compressors/fano_coder.py
fano_coder.py
py
7,227
python
en
code
46
github-code
6
[ { "api_name": "scl.compressors.prefix_free_compressors.PrefixFreeTree", "line_number": 20, "usage_type": "name" }, { "api_name": "scl.core.prob_dist.ProbabilityDist.get_sorted_prob_dist", "line_number": 24, "usage_type": "call" }, { "api_name": "scl.core.prob_dist.ProbabilityDist...
32491034709
import os import math import numpy as np import torch import torch.nn as nn from torch.optim import Adam, RMSprop from torch.nn.utils import clip_grad_norm_ from torchtext import data from torchtext.data import Field, Dataset, Example from firelab import BaseTrainer from firelab.utils import cudable, HPLinearScheme, c...
universome/text-vae
src/trainers/vae_trainer.py
vae_trainer.py
py
8,373
python
en
code
2
github-code
6
[ { "api_name": "firelab.BaseTrainer", "line_number": 20, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torchtext.data.Field", ...
31850091142
from django.db import models STATE_CHOICES = [('NSW', 'New South Wales'), ('TAS', 'Tasmania')] FUEL_CHOICES = [('E10', 'Ethanol 94'), ('U91', 'Unleaded 91'), ('E85', 'Ethanol 105'), ('P95', 'Premium 95'), ('P98', 'Premium 98'), ...
jwood13/petrolweb
trend/models.py
models.py
py
2,641
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 49, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 49, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 50, "usage_type": "call" }, { "api_name"...
17195267047
from nltk import pos_tag, RegexpParser from tokenize_words import word_sentence_tokenize from chunk_counters import np_chunk_counter, vp_chunk_counter # import text dorian_txt = open("dorian_gray.txt", encoding="utf-8").read().lower() iliad_txt = open("the_iliad.txt", encoding="utf-8").read().lower() # sentence and ...
ganton000/Codecademy
Python_Projects/NLTK_Project/script.py
script.py
py
2,075
python
en
code
0
github-code
6
[ { "api_name": "tokenize_words.word_sentence_tokenize", "line_number": 11, "usage_type": "call" }, { "api_name": "tokenize_words.word_sentence_tokenize", "line_number": 12, "usage_type": "call" }, { "api_name": "nltk.pos_tag", "line_number": 27, "usage_type": "call" }, ...
8702237528
from __future__ import division import matplotlib matplotlib.rcParams.update({'font.size': 14}) # ============================================================================= # IMPORTS # ============================================================================= import os import pdb import sys import astropy.io...
kammerje/spaceKLIP
spaceKLIP/make_psfmasks.py
make_psfmasks.py
py
8,440
python
en
code
14
github-code
6
[ { "api_name": "matplotlib.rcParams.update", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 4, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "l...
27249010183
from main.views import * from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'mysite.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^new...
Shmelik/gmf
mysite/mysite/urls.py
urls.py
py
2,447
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 9, "usage_type": "call" }, { "api...
37430356218
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: qibocms s.php文件参数fids SQL注入 referer: http://www.wooyun.org/bugs/wooyun-2014-079938 author: Lucifer description: 文件/coupon/s.php中,参数fids存在SQL注入。 ''' import sys import requests class qibocms_s_fids_sqli_BaseVerify: def __init__(self, url): self.url = ...
iceyhexman/onlinetools
scanner/plugins/cms/qibocms/qibocms_s_fids_sqli.py
qibocms_s_fids_sqli.py
py
1,148
python
en
code
1,626
github-code
6
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 34, "usage_type": "attribute" } ]
3226258441
#!/usr/bin/env python #! -*- coding: utf-8 -*- import requests import sys import json class Stock(): symbol = "" stock_name = "" high_price = 0.0 low_price = 100_000_000.0 price = 0.0 prev_close = 0.0 diff = 0.0 def __init__(self, symbol, stock_name): self.symbol = s...
peppermint8/background
stock.py
stock.py
py
2,788
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 35, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 36, "usage_type": "attribute" }, { "api_name": "requests.exceptions"...
26024543640
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from fealpy.mesh.uniform_mesh_2d import UniformMesh2d from scipy.sparse.linalg import spsolve from fealpy.pde.wave_2d import MembraneOscillationPDEData pde = MembraneOscillationPDEData() # 空间离散 domain = pde.domain() nx = 100 ny =...
suanhaitech/pythonstudy2023
python-jovan/Numerical solution of differential equation/wave/wave2_exp_y.py
wave2_exp_y.py
py
2,098
python
en
code
2
github-code
6
[ { "api_name": "fealpy.pde.wave_2d.MembraneOscillationPDEData", "line_number": 7, "usage_type": "call" }, { "api_name": "fealpy.mesh.uniform_mesh_2d.UniformMesh2d", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.sparse.linalg.spsolve", "line_number": 52, "...
32005538127
import logging import yaml from schema import Schema, SchemaError, Optional from collections import Counter from util import weighted_LCS import heapq from difflib import SequenceMatcher _LOGGER = logging.getLogger(__name__) _LOGGER.setLevel(logging.DEBUG) class Reasoner: def __init__( self, kb, ...
Fengrui-Liu/MicroCBR
microCBR/reasoning.py
reasoning.py
py
17,331
python
en
code
6
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "yaml.safe_load", "line_number": 63, "usage_type": "call" }, { "api_name": "yaml.safe_load", ...
73537708347
import flask from flask import Flask, render_template, jsonify, request import pickle import numpy as np app = Flask(__name__) @app.route("/") @app.route("/index") def index(): return flask.render_template('index.html') @app.route("/predict", methods=['POST']) def predict(): if request.method == 'POST': ...
dhanmane/Data-Science-Analysis-with-Python-Know-Your-Market-Value
Job Salary Prediction.py
Job Salary Prediction.py
py
1,073
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.requ...
6541118433
''' Created on Apr 28, 2015 @author: Yaser ''' import time import pygame import random pygame.init() # color = ( R , G , B ) black = (0,0,0) white = (255,255,255) red = (255,0,0) green = (0,255,0) blue = (0,0,255) grey = ( 100, 100, 100) nc = (251, 205, 152) bl_color=(234,23,123) display_width=800 display_height=600 ...
YaserAlamin/my1game
src/airplane.py
airplane.py
py
5,407
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pygame.display...
8301995237
import asyncio import websockets import json message = json.dumps({ "content": "Message content", "realm": "CFC3", "rankColor": 16711680, "avatar": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/c3/c3364b63359c0c8d0c1b3cca74eb5768e533b366_full.jpg", "steamName": "Phatso", ...
CFC-Servers/cfc_chat_transit
web/discord_relay/client.py
client.py
py
680
python
en
code
1
github-code
6
[ { "api_name": "json.dumps", "line_number": 5, "usage_type": "call" }, { "api_name": "websockets.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 25, "usage_type": "call" } ]
16539915795
# Módulos import discord from discord.ext import commands import traceback import sys from utils import funcs class Events(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): print(f""" +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
ides-dev/moji
cogs/events.py
events.py
py
1,999
python
es
code
0
github-code
6
[ { "api_name": "discord.ext.commands.Cog", "line_number": 8, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 8, "usage_type": "name" }, { "api_name": "discord.Status", "line_number": 21, "usage_type": "attribute" }, { "api_name": "...
22104855934
import torch import torch.nn as nn import torch.nn.functional as F from face_swap import utils, face_recognizer from face_swap.config import Config from .AADLayer import AAD_ResBlk def weight_init(m): if isinstance(m, nn.Linear): m.weight.data.normal_(0, 0.001) m.bias.data.zero_() if isinstanc...
faddey-w/face-swap
face_swap/faceshifter/AEI_Net.py
AEI_Net.py
py
4,413
python
en
code
8
github-code
6
[ { "api_name": "torch.nn.Linear", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "li...
2785625641
from flask import render_template,request,redirect from flask_app import app from flask_app.models.cookie import Cookie @app.route("/") def index(): # call the get all classmethod to get all friends cookies = Cookie.get_all() print(cookies) return render_template("index.html", all_cookies = cookies) ...
Helenyixuanwang/flask_cookies
flask_app/controllers/cookies_controller.py
cookies_controller.py
py
1,644
python
en
code
0
github-code
6
[ { "api_name": "flask_app.models.cookie.Cookie.get_all", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_app.models.cookie.Cookie", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }...
19218090443
from rest_framework import serializers def inline_serializer( *, name: str, fields: dict[str, serializers.Field], data=None, **kwargs, ) -> serializers.Serializer: Serializer = type(name, (serializers.Serializer,), fields) if data is not None: return Serializer(data=data, **kwargs...
plathanus-tech/django_boilerplate
src/app/drf/serializers.py
serializers.py
py
355
python
en
code
2
github-code
6
[ { "api_name": "rest_framework.serializers.Field", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.serializers.Serializer", "line_number": 11, "usage_type": "...
11068192129
from django.contrib.auth import * from django.http import * from forms import * from django.template.loader import get_template from django.template import Context from django.utils.decorators import method_decorator from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_requir...
hughsons/lawcore
auth_views.py
auth_views.py
py
3,770
python
en
code
1
github-code
6
[ { "api_name": "django.views.generic.base.TemplateView", "line_number": 15, "usage_type": "name" }, { "api_name": "google.appengine.api.users.get_current_user", "line_number": 17, "usage_type": "call" }, { "api_name": "google.appengine.api.users", "line_number": 17, "usage...
39269062607
import torch import torchtext def text_tokenize(s): """Tokenize input sentence Convert a sentence from csv file to reversed list of words Args: s (string): a sentence from csv file Returns: list of string: list of words converted from a sentence """ split = s.strip().spl...
masahiro-negishi/Semantic_Parsing
preprocess.py
preprocess.py
py
2,974
python
en
code
0
github-code
6
[ { "api_name": "torchtext.data.Field", "line_number": 45, "usage_type": "call" }, { "api_name": "torchtext.data", "line_number": 45, "usage_type": "attribute" }, { "api_name": "torch.long", "line_number": 51, "usage_type": "attribute" }, { "api_name": "torchtext.da...
32596138436
import dash import dash_core_components as dcc import dash_html_components as html import dash_table import dash_bootstrap_components as dbc import pandas as pd import numpy as np import math import time import json from scipy import stats from dash.dependencies import Input, Output, State from dash.exceptions import...
Hopefully73/HP
components/production_speed.py
production_speed.py
py
25,046
python
en
code
0
github-code
6
[ { "api_name": "dash_html_components.Div", "line_number": 18, "usage_type": "call" }, { "api_name": "dash_html_components.H6", "line_number": 20, "usage_type": "call" }, { "api_name": "dash_core_components.Dropdown", "line_number": 21, "usage_type": "call" }, { "ap...
32833780990
import unittest import pytest from AppiumFrameWork.pages.KeyboardOutputtoBrowser import KeyboardOutputtoBrowser @pytest.mark.usefixtures("beforeClass", "setUp") class KeyboardOutputtoBrowserTest(unittest.TestCase): @pytest.fixture(autouse=True) def classObjects(self): self.kb = KeyboardOutputtoBrows...
candi-project/Automation_framework_Android
Appiumpython/AppiumFrameWork/tests/test_KeyboardOutputtoBrowser.py
test_KeyboardOutputtoBrowser.py
py
784
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "AppiumFrameWork.pages.KeyboardOutputtoBrowser.KeyboardOutputtoBrowser", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_ty...
24057828214
#!/usr/bin/env python3 import os import time import logging from collections import deque from typing import Dict, List import openai import chromadb import tiktoken as tiktoken from chromadb.utils.embedding_functions import OpenAIEmbeddingFunction import re import chainlit as cl # default opt out of chromadb telemetr...
Chainlit/cookbook
babyagi/babyagi.py
babyagi.py
py
17,489
python
en
code
271
github-code
6
[ { "api_name": "chromadb.Client", "line_number": 17, "usage_type": "call" }, { "api_name": "chromadb.config.Settings", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 22, "usage_type": "call" }, { "api_name": "os.getenv", "l...
8774456070
#解碼器 import torch.nn as nn import config import torch import torch.nn.functional as F class Decoder(nn.Module): def __init__(self): super(Decoder,self).__init__() self.embedding=nn.Embedding(num_embeddings=len(config.num_sequence), embedding_dim=config.embedding...
chenchenghung/seq2seq_numbers_prediction
decoder.py
decoder.py
py
4,044
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
73573196987
import json import requests from base58 import Base58 import SolTypeConvert nile = 'https://api.nileex.io' trongrid = 'https://api.trongrid.io' def gettransactioninfobyid(transaction_id, host="mainnet"): if host == "nile": domain = nile else: domain = trongrid return requests.get(domain +...
dpneko/pyutil
wallet.py
wallet.py
py
2,722
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "base58.Base58", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 30, "usage_type": "call" }, { "api_name": "base58.Base58", "line_nu...
14454221602
# Warning: The code is pretty messy! It was written in a hurry, but there still may be some interesting # stuff here. In particular, take a look at how animation.FuncAnimation works near the end by using the # callback to update import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animatio...
seanshahkarami/seanshahkarami.github.io
docs/static/cbmg-2015/anim.py
anim.py
py
1,015
python
en
code
1
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot....
40411559521
""" Name: ndfc_reachability.py Description: Test switch reachability (from NDFC controller perspective). The JSON payload constructed by this class is shown below. { "maxHops":"0", "seedIP":"10.1.150.104", "cdpSecondTimeout":5, "snmpV3AuthProtocol":0, "username":"admin", "password":"myPassword...
allenrobel/ndfc-python
lib/ndfc_python/ndfc_reachability.py
ndfc_reachability.py
py
9,448
python
en
code
0
github-code
6
[ { "api_name": "ndfc_python.validations.Validations", "line_number": 77, "usage_type": "call" }, { "api_name": "ndfc_python.log.log", "line_number": 101, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 172, "usage_type": "call" }, { "api_name": "nd...
40635133450
import numpy as np import mlrose_hiive as ml from util import set_seed, start_time from sklearn.metrics import accuracy_score from yoga import yoga_count, get_yoga_data algos = [ 'random_hill_climb', 'simulated_annealing', 'genetic_alg', 'gradient_descent' ] activations = ['tanh', 'tanh', 'relu', 'sigm...
duttaoindril/omscs_7641
2/nn.py
nn.py
py
2,143
python
en
code
0
github-code
6
[ { "api_name": "yoga.get_yoga_data", "line_number": 27, "usage_type": "call" }, { "api_name": "mlrose_hiive.NeuralNetwork", "line_number": 28, "usage_type": "call" }, { "api_name": "yoga.yoga_count", "line_number": 30, "usage_type": "name" }, { "api_name": "mlrose_...
34183741462
from collections import defaultdict from operator import itemgetter def solution(genres, plays): # value를 기본으로 []를 갖는 딕셔너리 생성 dic_g = defaultdict(lambda : []) # 장르 : [노래이름, 재생횟수] 형태로 딕셔너리에 저장 # dic_g = {'classic': [[0, 500], [2, 150], [3, 800]], 'pop': [[1, 600], [4, 2500]]} for i, z in enumerate(zi...
study-for-interview/algorithm-study
hanjo/개인용/programmers/구현/L3_베스트앨범/solution.py
solution.py
py
1,426
python
ko
code
8
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 16, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 23, "usage_type": "call" } ]
19345133763
import pygame from abc import ABC, abstractmethod import numpy as np from vector import Vector2 from constants import * # Define an abstract base class to represent pellets class Pellet(ABC): # Initialize pellet properties def __init__(self, row, column): self.position = Vector2(column*TILEWIDTH, row*T...
DavidSatria29/Game_PAK-MAN
pellets.py
pellets.py
py
4,252
python
en
code
0
github-code
6
[ { "api_name": "abc.ABC", "line_number": 8, "usage_type": "name" }, { "api_name": "vector.Vector2", "line_number": 11, "usage_type": "call" }, { "api_name": "abc.abstractmethod", "line_number": 15, "usage_type": "name" }, { "api_name": "vector.Vector2", "line_n...
27591651630
"""API receives and processes audio files""" import logging from fastapi import FastAPI, File, UploadFile from fastapi.responses import FileResponse from audio_processor.exceptions.audio_file import SaveTempFileException from audio_processor.exceptions.audio_processing import AudioProcessingException from audio_proce...
andre1393/noise-reduction
audio_processor/api/app.py
app.py
py
4,385
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "fastapi.UploadFile", "line_number": 30, "usage_type": "name" }, { "api_name": "fastapi.File", ...
36257580775
from collections import deque def bfs(n, visited): queue = deque([n]) visited[n] += 1 while queue: x = queue.popleft() if 0 <= x*2 <= 100000: if visited[x*2] == 1: visited[x*2] += visited[x] if x*2 == k: break ...
hon99oo/PythonAlgorithmStudy
BOJ/DFS_BFS/1697_숨바꼭질/solution.py
solution.py
py
869
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
5268880308
import re import numpy as np from sklearn.cluster import MiniBatchKMeans, KMeans from sklearn.datasets.samples_generator import make_blobs import sys import os import kmeanspp from aux import MyPlot, DIRR from numpy.random import randint from matplotlib import pyplot as plt import glob BUFFER_FILE = '__dont_use_a_fi...
maffei2443/trabalho-final-mineracao-texto
src/main.py
main.py
py
5,379
python
en
code
0
github-code
6
[ { "api_name": "re.findall", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 3...
4220350634
import streamlit as st from PIL import Image from sklearn import datasets import pandas as pd class main_page(object): def __init__(self): st.set_page_config(layout="wide") #####Main Page s self.image=Image.open('media/bedo2.png') st.image(self.image,width=250) st.title('Be...
bedovlabs/ML_app
Page_layout.py
Page_layout.py
py
3,100
python
en
code
0
github-code
6
[ { "api_name": "streamlit.set_page_config", "line_number": 9, "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": "streamlit.image", ...
4721551437
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 17 14:22:41 2019 @author: snoone """ # step 1 extracts the archive files to .cvs separted files(delete, insert, update) current directory import os import sys import glob import pandas as pd import calendar import requests import ...
glamod/glamod-nuim
PYTHON_CDM_Conversion_code/Monthly_update_code/gsom_update_step1_jasmin.py
gsom_update_step1_jasmin.py
py
5,144
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "utils.MONTHLY_URL_HOST", "line_number": 37, "usage_type": "attribute" }, { "api_name": "utils.MONTH...
16252777076
import pygame import sys import random # ----- [윈도우창 설정] ----- WINDOW_WIDTH = 540 WINDOW_HEIGHT = 600 GRID = 30 GRID_WIDTH = int(WINDOW_WIDTH/GRID) GRID_HEIGHT = int(WINDOW_HEIGHT/GRID) # ===== [색상설정] ===== BLACK = "#000000" RED = "#FF5555" BLUE1 = "#03256C" BLUE2 = "#3066BE" BLUE3 = "#40BCD8" GREEN = "#4A7c59" BEI...
DrunkenProgram/SnakeGame
snake.py
snake.py
py
6,323
python
en
code
0
github-code
6
[ { "api_name": "random.choice", "line_number": 45, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 90, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 91, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_n...
26902591987
#!/usr/bin/env python # coding: utf-8 # # Logistic_regression # ## 1.加载数据 # In[1]: import numpy as np import matplotlib.pyplot as plt # In[2]: pimaForm = np.loadtxt('Pima.csv', dtype=np.float64, delimiter=',') # 加载整个表格 data = pimaForm[:,:8].T # 数据部分 label = pimaForm[:,8:].astype(np.int16) # 标签部分 # In[3...
AgentGuo/logistic_regression
Logistic_regression.py
Logistic_regression.py
py
2,674
python
en
code
1
github-code
6
[ { "api_name": "numpy.loadtxt", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.int16", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.random.rand",...
3755378710
import grpc.experimental.aio as agrpc from . skeleton import NeptuneServiceSkeleton class NeptuneGRPCService(NeptuneServiceSkeleton): def add_to_server(self): raise NotImplementedError() class GRPCServerService(NeptuneServiceSkeleton): def __init__(self, bind_address): super().__init__("grpc...
kstardust/neptune
neptune_py/skeleton/neptune_rpc/grpc_service.py
grpc_service.py
py
1,200
python
en
code
0
github-code
6
[ { "api_name": "skeleton.NeptuneServiceSkeleton", "line_number": 5, "usage_type": "name" }, { "api_name": "skeleton.NeptuneServiceSkeleton", "line_number": 10, "usage_type": "name" }, { "api_name": "grpc.experimental.aio.server", "line_number": 19, "usage_type": "call" }...
22058534187
# PyGame Skeleton import pygame, sys, random from ant import Ant from map import Map from tile import Tile from food import Food from dirt import Dirt GAME_WIDTH = 600 GAME_HEIGHT = 600 antList = [] foodList = [] map = Map(GAME_WIDTH, GAME_HEIGHT) spawnAnts = False spawnRAnts = False spawnBAnts = False spawnGAnts = F...
lgessler/agents
00_ants/game.py
game.py
py
7,306
python
en
code
0
github-code
6
[ { "api_name": "map.Map", "line_number": 14, "usage_type": "call" }, { "api_name": "ant.Ant", "line_number": 27, "usage_type": "call" }, { "api_name": "ant.Ant", "line_number": 37, "usage_type": "call" }, { "api_name": "ant.Ant", "line_number": 47, "usage_t...
9370527680
import sys import time from utils.pathCalculator import calc_best_path, calc_best_path_from_matrix from utils.timeExecution import TimeExecution from graphBuilder.builder import build_graph from utils.costCalculator import calc_cost, calc_cost_from_matrix file = input("Informe o numero equivalente ao arquivo contend...
mateussr7/CaminhoMinimo
Caminho minimo/main.py
main.py
py
2,154
python
en
code
1
github-code
6
[ { "api_name": "sys.exit", "line_number": 17, "usage_type": "call" }, { "api_name": "graphBuilder.builder.build_graph", "line_number": 34, "usage_type": "call" }, { "api_name": "utils.timeExecution.TimeExecution", "line_number": 35, "usage_type": "call" }, { "api_n...
74675145146
import re, math import os import textblob.tokenizers as tt import pickle #from profanity import profanity from textblob import TextBlob from textstat.textstat import textstat as ts from collections import Counter from functools import partial class NLPanalysis: # FIELDS __nameOfFinalDictionary = '' ...
KvitnucaZahradka/FAKE_NEWS_APP
flaskapp/NLPanalysis.py
NLPanalysis.py
py
9,891
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 87, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 93, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 97...
16422927695
# -*- coding: UTF-8 -*- import argparse import json import os from datetime import datetime from copy import deepcopy from torch import optim import torch import torch.multiprocessing as mp from torch.cuda.amp import GradScaler from torch.nn.parallel import DistributedDataParallel as DDP from torch.utils.data import Da...
grandchicken/M2DF
MAESC_training.py
MAESC_training.py
py
21,814
python
en
code
3
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 35, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "l...
73814823226
from collections import defaultdict class Solution(object): def subdomainVisits(self, cpdomains): """ :type cpdomains: List[str] :rtype: List[str] """ subDomains = defaultdict(int) result = [] for i in cpdomains: info = i.split(" ") len...
davidyip50/WallBreakers
Week #2/mutliSet/subdomainVisit.py
subdomainVisit.py
py
1,074
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" } ]
43627050974
from typing import List class Solution: def numPairsDivisibleBy60(self, time: List[int]) -> int: hashmap = {} res = 0 for num in time: num = num % 60 res += hashmap.get((60-num) % 60, 0) hashmap[num] = hashmap.get(num, 0) + 1 return res def ...
MichaelTQ/LeetcodePythonProject
solutions/leetcode_1001_1050/LeetCode1010_PairsOfSongsWithTotalDurationsDivisibleBy60.py
LeetCode1010_PairsOfSongsWithTotalDurationsDivisibleBy60.py
py
623
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
38852214942
from django.db import models from degvabank.apps.card.models import DebitCard from degvabank.apps.petitions.models import Petition class AccountManager(models.Manager): def get_queryset_by_user(self, user): return user.accounts.filter(is_active=True) def request_account(self, **kwargs): obj =...
Vixx-X/DEGVABank-backend
degvabank/degvabank/apps/account/manager.py
manager.py
py
592
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Manager", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "degvabank.apps.card.models.DebitCard.objects.create", "line_number": 12, "usage_type": "call...
42842732992
import logging import os import sys import burn_lock_functions import test_utilities from burn_lock_functions import EthereumToSifchainTransferRequest from integration_env_credentials import sifchain_cli_credentials_for_test from test_utilities import get_required_env_var, SifchaincliCredentials, get_optional_env_var,...
Sifchain/sifnode
test/integration/src/py/hand_setup.py
hand_setup.py
py
2,117
python
en
code
106
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdo...
19399829529
# https://leetcode-cn.com/problems/find-closest-lcci/ # 单词距离 from typing import List class Solution: def findClosest(self, words: List[str], word1: str, word2: str) -> int: i_1 = -1 i_2 = -1 ans = float('inf') for i in range(len(words)): w = words[i] if w =...
Yigang0622/LeetCode
findClosest.py
findClosest.py
py
756
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" } ]
31646307386
from __future__ import division import sklearn import sys #sys.path.append('C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages') import nltk import math import random import datetime,re,sys from nltk.corpus import reuters from nltk.stem.snowball import SnowballStemmer from sklearn.featu...
harshithavisvanath/KEYWORD-EXTRACTION
exrel.py
exrel.py
py
2,520
python
en
code
0
github-code
6
[ { "api_name": "nltk.corpus.reuters.raw", "line_number": 14, "usage_type": "call" }, { "api_name": "nltk.corpus.reuters", "line_number": 14, "usage_type": "name" }, { "api_name": "nltk.corpus.reuters.fileids", "line_number": 14, "usage_type": "call" }, { "api_name"...
12010477538
from __future__ import annotations import json import os import random from typing import List, TypeVar import wandb from datasets.dataset_dict import DatasetDict from datasets.load import load_dataset from sitaevals.common import combine_and_shuffle, load_from_jsonl, save_to_jsonl class DatasetDocument: def _...
AsaCooperStickland/situational-awareness-evals
sitaevals/dataset.py
dataset.py
py
3,367
python
en
code
23
github-code
6
[ { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.List", "line_number": ...
35014448433
# coding: utf-8 import time import requests from multiprocessing import Process from app import app from app.mysql.messages import Messages from app.redis.connect import Connect class Simulate(): ''' DBからworks, messagesデータを取得し、Redisキューに入れるための処理 ローカル環境でテストしたいときに使う ''' def __init__(self): ...
jasonsmithj/spam_public
app/utility/simulate.py
simulate.py
py
2,199
python
en
code
0
github-code
6
[ { "api_name": "app.mysql.messages.Messages", "line_number": 20, "usage_type": "call" }, { "api_name": "app.redis.connect.Connect", "line_number": 23, "usage_type": "call" }, { "api_name": "app.app.config", "line_number": 24, "usage_type": "attribute" }, { "api_nam...
30354001801
from os.path import basename # Enthought imports. from traits.api import Instance, Str,Dict from traitsui.api import View, Item, Group, Include from tvtk.api import tvtk # Local imports from mayavi.core.file_data_source import FileDataSource from mayavi.core.pipeline_info import PipelineInfo from mayavi.core.common i...
enthought/mayavi
mayavi/sources/poly_data_reader.py
poly_data_reader.py
py
5,587
python
en
code
1,177
github-code
6
[ { "api_name": "mayavi.core.file_data_source.FileDataSource", "line_number": 16, "usage_type": "name" }, { "api_name": "traits.api.Instance", "line_number": 26, "usage_type": "call" }, { "api_name": "tvtk.api.tvtk.Object", "line_number": 26, "usage_type": "attribute" }, ...
21916814109
#!/usr/bin/env python2 import os import logging import subprocess l = logging.getLogger('qsym.tests.build') KNOWN_ERRORS = [ "SSE4.1 instruction set not enabled", "SSE instruction set not enabled", "Only for x86_64" ] if __name__ == "__main__": logging.basicConfig(level=logging.INFO) for root, d...
sslab-gatech/qsym
tests/build.py
build.py
py
1,134
python
en
code
615
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.walk", ...
6418946772
from aiogram import types from FSM import Registration from config import dp, re, FSMContext # Ф-ция для отправки пользователю его анкеты. Получаем данные из базы и складываем их в переменную data. # Пробуем если photo == 0 просто прислать Данные без фото, иначе отправляем с фото. async def user_profile(messag...
AposazhennikovDS/telegrambot
handlers/registration/start/__init__.py
__init__.py
py
15,803
python
ru
code
0
github-code
6
[ { "api_name": "aiogram.types.Message", "line_number": 8, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 8, "usage_type": "name" }, { "api_name": "aiogram.types.Message", "line_number": 35, "usage_type": "attribute" }, { "api_name": "aio...
32914354562
from load_data import load_data_from_npz, load_batch, load_data_names, load_batch_from_names_random, load_batch_from_names import numpy as np import cv2 import os import glob from os.path import join import json train_path = "E:\gig-dl.ir\Dataset/SETrain" val_path = "E:\gig-dl.ir\Dataset/SEValidation" test_p...
Devilinator/GollaK
chk.py
chk.py
py
3,098
python
en
code
0
github-code
6
[ { "api_name": "load_data.load_data_names", "line_number": 24, "usage_type": "call" }, { "api_name": "load_data.load_data_names", "line_number": 26, "usage_type": "call" }, { "api_name": "load_data.load_data_names", "line_number": 28, "usage_type": "call" }, { "api...
35687481056
# -*- coding: utf-8 -*- """ Created on Wed Apr 1 11:47:33 2020 @author: Yury """ import networkx as nx import pandas as pd def link_graph(dff): dff.columns=['a','b', 'v'] G = nx.DiGraph() edges=list(zip(dff['a'],dff['b'], dff['v'])) G.add_weighted_edges_from(edges, weight...
yurywallet/test_assignments
2020_wise_transferwise/TOOLS/tools_graph_nx.py
tools_graph_nx.py
py
10,599
python
en
code
0
github-code
6
[ { "api_name": "networkx.DiGraph", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.merge", ...
25012191793
#!/usr/bin/env python # -*- coding: utf-8 -*- """ pytorch-dl Created by raj at 11:05 Date: January 18, 2020 """ from torch import nn from models.embeddings.position_emb import PositionalEncoding from models.embeddings.seg_emb import SegmentEmbedding from models.embeddings.token_emb import Embeddings class BertEmbed...
patelrajnath/pytorch-dl
models/embeddings/bert_embeddings.py
bert_embeddings.py
py
1,001
python
en
code
10
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "models.embeddings.token_emb.Embeddings", "line_number": 21, "usage_type": "call" }, { "api_name": "...
30043040494
import pathlib import pytest import bgraph.utils def test_recurse(): # Empty mapping assert list(bgraph.utils.recurse({})) == [] # Classic mapping mapping = {"a": "b", "c": "d"} for key, value in bgraph.utils.recurse(mapping): assert key in mapping assert value in mapping.values...
quarkslab/bgraph
tests/test_utils.py
test_utils.py
py
1,692
python
en
code
15
github-code
6
[ { "api_name": "bgraph.utils.utils.recurse", "line_number": 10, "usage_type": "call" }, { "api_name": "bgraph.utils.utils", "line_number": 10, "usage_type": "attribute" }, { "api_name": "bgraph.utils", "line_number": 10, "usage_type": "name" }, { "api_name": "bgrap...
22993257957
import argparse import logging import os import pdb import pickle import sys import traceback import json from metrics import Recall from best_predictor import BestPredictor def main(args): # load config config_path = os.path.join(args.model_dir, 'config.json') with open(config_path) as f: config =...
Hungyi5/ML2019FALL
final/src/predict.py
predict.py
py
3,037
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": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.info", "line_number":...
3665973864
######################################################################################################################## ######################################################################################################################## ############################################################################...
gmourac19/CFDcoding
2Dheatdiffusion/2Dheatdiffusion_nonOOP.py
2Dheatdiffusion_nonOOP.py
py
20,249
python
en
code
0
github-code
6
[ { "api_name": "meshio.read", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 115, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 116, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number"...
41368190774
from rest_framework.views import APIView from rest_framework.response import Response from .models import Project, Pledge from .serializers import ProjectSerializer,ProjectDetailsSerializer, PledgeSerializer from django.http import Http404 from rest_framework import status, generics, permissions from .permissions impor...
SheCodesAus/she-codes-crowdfunding-api-project-ReaNtumba
crowdfunding/projects/views.py
views.py
py
3,949
python
en
code
2
github-code
6
[ { "api_name": "rest_framework.views.APIView", "line_number": 9, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticatedOrReadOnly", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.permissions", "line_number": 10, "us...
650760937
import os import sys import unittest import luigi import numpy as np import nifty.ground_truth as ngt import nifty.distributed as ndist import nifty.tools as nt import z5py try: from ..base import BaseTest except Exception: sys.path.append(os.path.join(os.path.split(__file__)[0], "..")) from base import B...
constantinpape/cluster_tools
test/node_labels/test_node_labels.py
test_node_labels.py
py
5,952
python
en
code
32
github-code
6
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number...
74766327868
from tkinter import NO from django.contrib.auth import authenticate from rest_framework import serializers from .models import (Incident,User) class userSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('password','email','first_name','last_name','role') def getUser(...
cjuan-code/Manfy_DRF_React
backend/manfy/apps/users/serializers.py
serializers.py
py
8,325
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "models.User", "line_number": 8, "usage_type": "name" }, { ...
7095936424
""" Tests for fantasm.fsm """ import unittest import urllib import datetime from django.utils import simplejson import random # pylint: disable-msg=W0611 from google.appengine.api.taskqueue.taskqueue import Queue, Task # pylint: disable-msg=W0611 from google.appengine.api import memcache # pylint: disable-msg=W0611 fr...
iki/fantasm
test/fantasm_tests/fsm_test.py
fsm_test.py
py
44,138
python
en
code
29
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 43, "usage_type": "attribute" }, { "api_name": "fantasm.config._MachineConfig", "line_number": 49, "usage_type": "call" }, { "api_name": "fantasm.config", "line_number": 49, "usage_type": "name" }, { "api_name": "f...
39476547685
import requests import json from lxml import etree class Mask(): def __init__(self): self.url='http://m.ask.j1.com/keshi/' self.headers={'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36', } def frist_url...
zhang8929/zhangyuguang
zhangbingshen/m.ask.py
m.ask.py
py
1,879
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 13, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 13, "usage_type": "name" }, { "api_name": "requests.get", "line_numb...
33619290693
import ga_params if ga_params.draw_plot: import matplotlib.pyplot as plt if ga_params.export_spreadsheet: from openpyxl import Workbook from datetime import datetime import re class Reporter: plot_x_axis = [] plot_y_axis = [] sheet_wb = None sheet_ws = None sheet_dest = 'output' sheet...
shayan-ys/VRPTW-ga
report.py
report.py
py
2,507
python
en
code
63
github-code
6
[ { "api_name": "ga_params.draw_plot", "line_number": 2, "usage_type": "attribute" }, { "api_name": "ga_params.export_spreadsheet", "line_number": 4, "usage_type": "attribute" }, { "api_name": "ga_params.draw_plot", "line_number": 20, "usage_type": "attribute" }, { ...
2000414686
from collections import OrderedDict from typing import Dict class VuePlugin: vue_script_sources: Dict[str, str] = OrderedDict() vue_style_sources: Dict[str, str] = OrderedDict() @classmethod def get_vue_script_sources(cls): return cls.vue_script_sources @classmethod def get_vue_style...
maximdeclercq/django-vue
django_vue/plugins.py
plugins.py
py
2,326
python
en
code
55
github-code
6
[ { "api_name": "typing.Dict", "line_number": 6, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 6, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 7, "usage_type": "name" }, { "api_name": "collections.OrderedDict"...
72531821949
"""add groups inclusion_rules column Revision ID: 43766dcf0fc2 Revises: 01073b43fc74 Create Date: 2020-08-25 08:54:55.441452+00:00 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = "43766dcf0fc2" down_revision = "01073b43...
ITISFoundation/osparc-simcore
packages/postgres-database/src/simcore_postgres_database/migration/versions/43766dcf0fc2_add_groups_inclusion_rules_column.py
43766dcf0fc2_add_groups_inclusion_rules_column.py
py
887
python
en
code
35
github-code
6
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy.dialect...
38388033876
# Web driver and html parsing from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from bs4 import BeautifulSoup import re # Utilities import requests import csv from tqdm import tqdm # User defined from helper_functions import * # Save path to local chrome driver (install if ...
SarahAmiraslani/zara-scrape
picture.py
picture.py
py
5,716
python
en
code
0
github-code
6
[ { "api_name": "tqdm.tqdm", "line_number": 55, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 62, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 63, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOpt...
30823651661
# -*- coding: utf-8 -*- """ Created on Fri Dec 11 01:17:31 2020 @author: Wallace """ import numpy as np from numpy import sin, cos, pi, sqrt, exp from scipy.linalg import norm from scipy.interpolate import interp1d from scipy.integrate import trapz import pandas as pd def traj4DOF(time,muz, aero_coef, v2...
wrosendoeng/scientf-comp-mecheng-ime
final_project/BB_Traj_V2/BB_Traj_V2/Traj4_Functions/mpm_active_v2013B1120_1.py
mpm_active_v2013B1120_1.py
py
6,698
python
en
code
0
github-code
6
[ { "api_name": "numpy.pi", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 51, "usage_type": "call" }, { "api_name": "scipy.linalg.norm", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.array", "line_number...
4758401695
"""Utility code that doesn't fit anywhere else.""" import sys from typing import Iterator, Tuple, Callable, Iterable from functools import singledispatch, wraps def zip_strict(*iterables: Iterator) -> Iterator[Tuple]: """Like the builtin ``zip`` function but raises an error if any argument is exhausted before the o...
jlumpe/gambit
gambit/util/misc.py
misc.py
py
3,461
python
en
code
16
github-code
6
[ { "api_name": "typing.Iterator", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Iterator", "line_number": 56, "usage_type": "name" }, { "api_name": "sys.version_info", "li...
8295167899
import sys import paramiko import subprocess import os key = paramiko.RSAKey.from_private_key_file("./elevation-student.pem") client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) print("Connecting") client.connect(hostname="ec2-52-59-204-217.eu-central-1.compute.amazonaws...
prettyleka/ssh-python
printDirsNamesAlphabetical.py
printDirsNamesAlphabetical.py
py
706
python
en
code
0
github-code
6
[ { "api_name": "paramiko.RSAKey.from_private_key_file", "line_number": 6, "usage_type": "call" }, { "api_name": "paramiko.RSAKey", "line_number": 6, "usage_type": "attribute" }, { "api_name": "paramiko.SSHClient", "line_number": 7, "usage_type": "call" }, { "api_na...
19373559057
import dash from dash import html, dcc path = '/aligner' dash.register_page(__name__, path=path, name='Aligner', order='b', image='images/icons/aligner_icon.png' ) # Layout for picking the aligner and run alignment def layout(): # Main Div of the page return html.Div( dcc.Ma...
Gioele-Bio/temporary_tempoportal
utils/pages/aligner.py
aligner.py
py
396
python
en
code
0
github-code
6
[ { "api_name": "dash.register_page", "line_number": 6, "usage_type": "call" }, { "api_name": "dash.html.Div", "line_number": 17, "usage_type": "call" }, { "api_name": "dash.html", "line_number": 17, "usage_type": "name" }, { "api_name": "dash.dcc.Markdown", "li...
44549441220
import sys import pytz from datetime import datetime import urllib3 from bs4 import BeautifulSoup from apscheduler.schedulers.blocking import BlockingScheduler urllib3.disable_warnings() SEOUL_TZ = pytz.timezone('Asia/Seoul') sched = BlockingScheduler() HANSUNG_MENU_URL = 'https://www.hansung.ac.kr/web/www/life_03...
cjh5414/hansung-bab
hansung-bab.py
hansung-bab.py
py
2,208
python
en
code
0
github-code
6
[ { "api_name": "urllib3.disable_warnings", "line_number": 11, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number": 13, "usage_type": "call" }, { "api_name": "apscheduler.schedulers.blocking.BlockingScheduler", "line_number": 14, "usage_type": "call" }, ...
73076320187
from __future__ import annotations import logging import os import re import sys from typing import AnyStr, List, TYPE_CHECKING, Optional, Union from queue import Queue from bot import app_vars from bot.sound_devices import SoundDevice, SoundDeviceType if sys.platform == "win32": if sys.version_info.m...
gumerov-amir/TTMediaBot
bot/TeamTalk/__init__.py
__init__.py
py
13,733
python
en
code
52
github-code
6
[ { "api_name": "sys.platform", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.add_dll_directory", "line_number": 14, "usage_type": "call" }, { "api_name": "bot.app_...
29880798585
# -*- coding: utf-8 -*- """ Created on Wed Jul 14 18:08:59 2021 公開鍵暗号方式 C≡P^e(mod n) 暗号化 P≡C^d(mod n) 復号化 ディジタル署名 C≡P^d(mod n) 暗号化 P≡C^e(mod n) 復号化 n=p*q L=LCM(p-1,q-1)=p-1*q-1/gcd(p,q) Max{p,q}<e<L and L e が互いに素な数 gcd(l,e)=1 # MAX{p,q}<e<Lに必要 暗号文C =平文^e mod N 平文P =暗号文^d mod N Nを可変では...
Shunsuke-Torus/RSA_Variable
utils_rsa2.py
utils_rsa2.py
py
8,957
python
ja
code
0
github-code
6
[ { "api_name": "importlib.reload", "line_number": 54, "usage_type": "call" }, { "api_name": "sympy.randprime", "line_number": 60, "usage_type": "call" }, { "api_name": "sympy.randprime", "line_number": 65, "usage_type": "call" }, { "api_name": "sympy.randprime", ...
21657183449
import matplotlib.pyplot as plt import numpy as np def show(datas): assert isinstance(datas, np.ndarray) num_datas = datas.shape[0] n_rows = np.ceil(np.sqrt(num_datas)).astype(np.int64) n_cols = n_rows fig, axes = plt.subplots(n_rows, n_cols) for i in range(n_rows): for j in range(n_...
keithyin/mycodes
TSCGAN/tools/visualization.py
visualization.py
py
474
python
en
code
23
github-code
6
[ { "api_name": "numpy.ndarray", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.ceil", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.int64", "line_number"...
40129833084
""" Dinic: MaxFlow """ from collections import defaultdict from collections import deque class Dinic: def __init__(self, numVertex): from collections import defaultdict self.numVertex = numVertex self.edges = defaultdict(lambda: defaultdict(int)) def add_edge(self, frm, to, capacity, ...
nishio/atcoder
libs/dinic_maxflow.py
dinic_maxflow.py
py
4,281
python
en
code
1
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 37, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 94, "usage_type": "call" }, { "api_name": "doctest.t...
41601989389
# -*- coding: utf-8 -*- from unittest import TestCase import QUANTAXIS as QA from QUANTAXIS.QAFetch import QATdx from QUANTAXIS.QAFetch.QATdx import QA_fetch_get_stock_day, select_best_ip, ping, get_ip_list_by_multi_process_ping from QUANTAXIS.QASU.save_tdx import gen_param from QUANTAXIS.QAUtil.QASetting import QA_Se...
Chrisen99/QUANTAXIS
QUANTAXIS_Test/QAFetch_Test/QATdx_Test_multi_process_map.py
QATdx_Test_multi_process_map.py
py
4,869
python
en
code
null
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "name" }, { "api_name": "QUANTAXIS.QAFetch.QATdx.select_best_ip", "line_number": 18, "usage_type": "call" }, { "api_name": "QUANTAXIS.QAFetch.QATdx.ping", "line_number": 23, "usage_type": "call" }, { ...
8710073614
# -*- encoding: utf-8 -*- from django.template import Context from django.template.engine import Engine engine = Engine(autoescape=True) # @idlesign though these settings will speed up # rendering, but seems they are not play any role builtin_tags = engine.template_builtins[0] builtin_tags.tags = {'for': builtin_tag...
AllMyChanges/move-to-cl
django_speed_tuned.py
django_speed_tuned.py
py
1,495
python
en
code
0
github-code
6
[ { "api_name": "django.template.engine.Engine", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template.Context", "line_number": 34, "usage_type": "call" } ]
26961911804
#!/usr/bin/env python3 # Usado para crear un servidor Web Local # Legacy: # import SimpleHTTPServer # import SocketServer import http.server import socketserver PORT = 8887 Handler = http.server.SimpleHTTPRequestHandler Handler.extensions_map.update({ # ".js": "application/javascript", '.manifest': 'text/ca...
danse1434/danse1434.github.io
visualizarInicio.py
visualizarInicio.py
py
712
python
en
code
0
github-code
6
[ { "api_name": "http.server.server", "line_number": 11, "usage_type": "attribute" }, { "api_name": "http.server", "line_number": 11, "usage_type": "name" }, { "api_name": "socketserver.TCPServer", "line_number": 25, "usage_type": "call" } ]
10691403825
from celery.task import task from datetime import date, datetime, timedelta from scheduling import models from llauth.models import CustomUser as User from celery.signals import task_failure from django.conf import settings from celery.decorators import periodic_task from user_notifier import notify_user from django.db...
8planes/langolab
django/web/apps/scheduling/tasks.py
tasks.py
py
4,266
python
en
code
3
github-code
6
[ { "api_name": "datetime.datetime.utcnow", "line_number": 17, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "traceback.print_exception", "line_number": 26, "usage_type": "call" }, { "api_nam...
14837073160
from setuptools import setup, find_packages with open("requirements.txt") as f: install_requires = f.read().strip().split("\n") # get version from __version__ variable in yhen/__init__.py from yhen import __version__ as version setup( name="yhen", version=version, description="Yuehuan ERPNext", author="hyaray",...
cwlong1987/yhen
setup.py
setup.py
py
465
python
en
code
0
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" }, { "api_name": "yhen.__version__", "line_number": 11, "usage_type": "name" }, { "api_name": "setuptools.find_packages", "line_number": 15, "usage_type": "call" } ]
30970038695
from plone.namedfile.interfaces import INamedFile from Products.CMFCore.interfaces import IFolderish from ZODB.POSException import POSKeyError """ Usage: bin/instance debug # fetch folderish item, e.g. a country: item = app.Plone2.sectors.cy recurse(cy) Note: recurse() can call both check_dexterity_blobs and check_a...
euphorie/osha.oira
scripts/find_bad_images_helper.py
find_bad_images_helper.py
py
2,713
python
en
code
4
github-code
6
[ { "api_name": "plone.namedfile.interfaces.INamedFile.providedBy", "line_number": 40, "usage_type": "call" }, { "api_name": "plone.namedfile.interfaces.INamedFile", "line_number": 40, "usage_type": "name" }, { "api_name": "ZODB.POSException.POSKeyError", "line_number": 43, ...
39660578723
import itertools from collections import defaultdict import numpy as np from .get_atom_properties import getAtomProperties class Atom: def __init__(self, element, label, aindex, mass, x, y, z, intensity): """ 原子类 :param element: 元素符号 :param label: 晶体文件里的原子标签,如C001 :param ...
jingshenSN2/CrystalTool
crystalbase/atom_base/atom_group.py
atom_group.py
py
6,299
python
en
code
1
github-code
6
[ { "api_name": "numpy.matmul", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.round", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.deg2rad", "line_number...
40281672764
import simplejson as json from model.box import Box from drawing.box import Box as Cube from model.tiles import tile class goal: def __init__(self, symbol, location): self.symbol = symbol self.location = location class maps: def __init__(self, path=None): se...
NunoSilvaa/AI_project
model/map.py
map.py
py
4,735
python
en
code
0
github-code
6
[ { "api_name": "simplejson.loads", "line_number": 27, "usage_type": "call" }, { "api_name": "model.box.Box", "line_number": 41, "usage_type": "call" }, { "api_name": "model.tiles.tile", "line_number": 59, "usage_type": "call" }, { "api_name": "model.tiles.tile", ...
35470677767
from flask import Flask, request from flask_restful import Resource, Api, marshal_with, fields # from flask-restful you can use Class based Views # pip install flask-restful import os from flask_sqlalchemy import SQLAlchemy print(os.getenv('port')) app = Flask(__name__) # Flask object api = Api(app) app.config['S...
AbhishekMaity001/Python-Code-Snippets
Simple REST API-Flask/app.py
app.py
py
2,862
python
en
code
1
github-code
6
[ { "api_name": "os.getenv", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", ...
26767050889
import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html import pandas as pd # create dash app app = dash.Dash(__name__, external_stylesheets= [dbc.themes.BOOTSTRAP], meta_tags = [{'name':'viewport', 'content':'width=device-width, init...
eolaks/IoT_Dashbaord
add_dbc_component.py
add_dbc_component.py
py
2,034
python
en
code
0
github-code
6
[ { "api_name": "dash.Dash", "line_number": 8, "usage_type": "call" }, { "api_name": "dash_bootstrap_components.themes", "line_number": 8, "usage_type": "attribute" }, { "api_name": "dash_bootstrap_components.Container", "line_number": 11, "usage_type": "call" }, { ...
27453907487
# substract values from list # from first element # with reduce() function -> import from functools list1 = [738,89,21,65,90,23,56,9] from functools import reduce def substract(a,b): return a-b a = reduce(substract,list1) print(a) # without using reduce function: list1 = [738,89,21,65,90,23,56,9] def substra...
sanika005/python_practise_examples
Interview Programs/program_10.py
program_10.py
py
486
python
en
code
0
github-code
6
[ { "api_name": "functools.reduce", "line_number": 9, "usage_type": "call" } ]
2696855567
import pandas as pd from typing import List from trava.logger import TravaLogger from trava.metric import Metric from trava.model_results import ModelResult from trava.results_handler import ResultsHandler from trava.trava_tracker import Tracker class PandasDfHandler(ResultsHandler): """ Returns all the metr...
ityutin/trava
trava/ext/results_handlers/pandas_df.py
pandas_df.py
py
1,200
python
en
code
2
github-code
6
[ { "api_name": "trava.results_handler.ResultsHandler", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 16, "usage_type": "name" }, { "api_name": "trava.model_results.ModelResult", "line_number": 16, "usage_type": "name" }, { "...
20516416318
import os import json import time import argparse import logging from decimal import Decimal from collections import defaultdict import pandas as pd from tqdm import tqdm os.environ.setdefault("DJANGO_SETTINGS_MODULE", "recsys.settings") import django django.setup() from django.db.models import Count f...
dintzeler/recsys
evaluator/coverage.py
coverage.py
py
2,610
python
en
code
0
github-code
6
[ { "api_name": "os.environ.setdefault", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.setup", "line_number": 14, "usage_type": "call" }, { "api_name": "recommender.models...
9276501531
import asyncio import websockets import logging import functools from contextlib import suppress from .display import Display, AsyncPrompt import json logger = logging.getLogger(f'{__name__}.client') class Client: def __init__(self, path: str, port: int, ssl, handle: str, loop): self.url = f'wss://{path}...
riorz/wss_chat
chatroom/client.py
client.py
py
2,418
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "display.Display", "line_number": 18, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 20, "usage_type": "call" }, { "api_name": "display.AsyncPromp...