id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
105988 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import nowdate, add_months
from erpnext.shopping_cart.cart import _get_cart_quotation, update_cart, get_... | StarcoderdataPython |
128231 | <reponame>gitjot/python-for-lccs
# Event: LCCS Python Fundamental Skills Workshop
# Date: Dec 2018
# Author: <NAME>, PDST
# eMail: <EMAIL>
# Purpose: Dictionary Programming Exercises 7.1
# Q1(e) solution
car = dict( {
'reg': "131 CN 6439",
'make': "Audi",
'model' : "A6",
'year' : 2013,
... | StarcoderdataPython |
1688648 | #!/usr/bin/env python
import requests
import json
proxy = {
"http": "http://localhost:8888",
"https": "http://localhost:8888",
}
with requests.Session() as s:
result = s.get("http://127.0.0.1:8080/WebGoat/login.mvc", proxies=proxy)
result2 = s.post("http://127.0.0.1:8080/WebGoat/j_spring_security_check",... | StarcoderdataPython |
61606 | <filename>backend/app/alembic/versions/13eac0b0e923_vid_col_len_add_sid_to_track_call.py
"""vid col len, add sid to track_call
Revision ID: 13eac0b0e923
Revises: <KEY>
Create Date: 2021-07-14 16:22:27.645299
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifie... | StarcoderdataPython |
111953 | """Constants for the of_topology NApp."""
# Ether type
LLDP_ETHERTYPE = 0x88cc
| StarcoderdataPython |
1786249 | <gh_stars>1-10
from __future__ import absolute_import
import math
import numpy as np
from scipy import ndimage as ndi
from skimage.measure._regionprops import _RegionProperties
import cc3d
import tqdm
_supported_metrics = [
'area',
'bbox_area',
'convex_area',
'filled_area']
def _labeling(object_labe... | StarcoderdataPython |
1786568 | <gh_stars>1-10
# -*- coding: UTF-8 -*-
'''
Copyright (c) 2015, <NAME> <patrick at iotek.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. The author is informed of the use of his/her code. T... | StarcoderdataPython |
4813899 | <filename>habitat_baselines/rl/ppo/policy.py<gh_stars>1-10
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import abc
import math
import numpy as np
import torch
import ... | StarcoderdataPython |
3389456 | <reponame>seth586/lndmanage
from lndmanage.lib.listchannels import ListChannels
from lndmanage.lib.node import LndNode
from lndmanage import settings
import logging.config
logging.config.dictConfig(settings.logger_config)
if __name__ == '__main__':
node = LndNode()
listchannels = ListChannels(node)
node.p... | StarcoderdataPython |
3372091 | <reponame>kmt/falcon
import json
import logging
import falcon
class StorageEngine:
pass
class StorageError(Exception):
pass
def token_is_valid(token, user_id):
return True # Suuuuuure it's valid...
def auth(req, resp, params):
# Alternatively, do this in middleware
token = req.get_header('... | StarcoderdataPython |
3374830 | <reponame>mcqueen256/Flask-RESTful-Auth
import sys
import pathlib
from setuptools import setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
__title__ = 'Flask-RESTful-Auth'
__description__ = 'Customizable REST... | StarcoderdataPython |
1700133 | from pydantic import BaseModel,EmailStr,Field, validator
from typing import Optional
import re
class UserSchemaIn(BaseModel):
ten_nguoi_dung :str = Field(...)
mat_khau :str = Field(...)
ten_day_du :str = Field(...)
so_dien_thoai :str = Field(...)
email :EmailStr = Field(...)
anh_dai_dien :str ... | StarcoderdataPython |
3305360 | import numpy as np
import ds_format as ds
from alcf import misc
from alcf.lidars import META
WAVELENGTH = 1064 # nm
CALIBRATION_COEFF = 0.34
SURFACE_LIDAR = True
SC_LR = 18.2 # sr. Stratocumulus lidar ratio (O'Connor et al., 2004).
MAX_RANGE = 15400 # m
VARS = {
'backscatter': ['beta_raw'],
'time': ['time'],
'time... | StarcoderdataPython |
3290094 | from apps import ZeroApp
from ui import Menu
from ui.overlays import SpinnerOverlay
class MainMenu(ZeroApp):
menu_name = "Main Menu"
def on_start(self):
self.m = Menu([], self.i, self.o)
self.overlay = SpinnerOverlay()
def test_func(x):
self.overlay.set_state(self.m, not self.overlay.get_state(self.m))
... | StarcoderdataPython |
3219705 | """
Script to reproduce the few-shot view reconstruction results in:
"Meta-Learning Probabilistic Inference For Prediction"
https://arxiv.org/pdf/1805.09921.pdf
The following command lines will reproduce the published results within error-bars:
python train_view_reconstruction.py
python evaluate_view_reconstruction.p... | StarcoderdataPython |
4837363 | <gh_stars>1-10
#!/usr/bin/python3
def common_elements(set_1, set_2):
return set([x for x in set_1 if x in set_2])
| StarcoderdataPython |
1680246 | <filename>sshscan.py
#!/usr/bin/env python
# sshscan.py 0.9 - Horizontal SSH scanner
# phxbandit
#
# sshscan.py is a horizontal SSH scanner that scans large
# swaths of IPv4 space for a single SSH user and pass. It
# uses iplist.txt as the input of IP addresses in the form
# of X.X.X.X, X.X.X.X/XX, X.X.X.X-X.X.X.X, or... | StarcoderdataPython |
1607378 | from viznet import *
import matplotlib.pyplot as plt
def draw_caizi_nn(ax, num_node_visible, num_node_hidden):
'''CaiZi R-Theta Network'''
# brush
conv = NodeBrush('nn.convolution', ax)
input = NodeBrush('nn.input', ax)
hidden = NodeBrush('nn.hidden', ax)
output = NodeBrush('nn.output', ax)
... | StarcoderdataPython |
138953 | import sys
import os
from daemon import runner
## EnvironmentEmulationRunner
#
# The extension of python-daemon.runner for additional actions
class EnvironmentEmulationRunner(runner.DaemonRunner):
## constructor
# @param The daemon application
def __init__(self, app):
runner.DaemonRunner.__init__(s... | StarcoderdataPython |
4831178 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# american fuzzy lop++ - grammar mutator
# --------------------------------------
#
# Written by <NAME>
#
# Copyright 2020 AFLplusplus Project. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | StarcoderdataPython |
3339750 | <filename>Atm1.py
'''
Function Name : ATM(), Deposit()
Description : Accept Amount From User & Perform Deposit, Withdraw With Sincronization
Function Date : 14 Mar 2021
Function Author : <NAME>
Input : Int
Output : Int
'''
# with sincronization the program is not termi... | StarcoderdataPython |
35044 | <gh_stars>0
class Solution(object):
def shortestToChar(self, S, C):
"""
:type S: str
:type C: str
:rtype: List[int]
"""
pl = []
ret = [0] * len(S)
for i in range(0, len(S)):
if S[i] == C:
pl.append(i)
for... | StarcoderdataPython |
1724692 | from __future__ import division
from __future__ import unicode_literals
from builtins import str
import sqlalchemy
import sqlalchemy.ext.declarative
import sqlalchemy.orm
import datetime
import json
Base = sqlalchemy.ext.declarative.declarative_base()
def dump_item_to_list(item):
data = []
for column in item... | StarcoderdataPython |
1636204 | <gh_stars>1-10
#!/usr/bin/env python
from svf_generator import *
def make_test(name, duration = 500000, path = '', data_file = ''):
"Make a dictionary describing the test. Duration is in us"
if data_file != '':
dfile = data_file
else:
dfile = "%s%s.mem" % (path, name)
return { 'code': "%s%s_code.mem" % (pa... | StarcoderdataPython |
3268704 | <reponame>DazEB2/SimplePyScripts
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import ctypes
FindWindow = ctypes.windll.user32.FindWindowW
hwnd = FindWindow('Shell_TrayWnd', None)
print(hwnd)
| StarcoderdataPython |
3232501 | <filename>light_famd/mfa.py
"""Multiple Factor Analysis (MFA)"""
import numpy as np
import pandas as pd
from sklearn import utils
from .import util
from . import mca
from . import pca
from sklearn.utils.validation import check_is_fitted
class MFA(pca.PCA):
def __init__(self, groups=None, normalize=True, n_compo... | StarcoderdataPython |
1699027 | <reponame>vidma/kensu-py<filename>kensu/gluonts/model/deepar.py
from kensu.gluonts.ksu_utils.dataset_helpers import make_dataset_reliable
import gluonts.model.deepar as dp
from gluonts.dataset.common import ListDataset
from kensu.gluonts.mx.model.predictor import RepresentableBlockPredictor
class DeepAREstimator(dp.D... | StarcoderdataPython |
1688227 | <filename>data/ner/streamlit_app.py
import streamlit as st
st.set_page_config(
layout="centered", # Can be "centered" or "wide". In the future also "dashboard", etc.
initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
page_title='Detect tumor characteristics', # String or None. Strings... | StarcoderdataPython |
3351124 | <filename>trinity/protocol/common/monitors.py
import asyncio
from contextlib import contextmanager
from typing import (
AsyncIterator,
Iterator,
Set,
)
from cancel_token import CancelToken
from eth_utils import ValidationError
from p2p.exceptions import NoConnectedPeers
from p2p.peer import BasePeer, Peer... | StarcoderdataPython |
23255 | """Test app.routes.build."""
import responses
mock_product_data = {
"bucket_name": "lsst-the-docs",
"doc_repo": "https://github.com/lsst-sqre/test-059.git",
"domain": "test-059.lsst.io",
"fastly_domain": "n.global-ssl.fastly.net",
"published_url": "https://test-059.lsst.io",
"root_domain": "l... | StarcoderdataPython |
1797055 | import re
def getVisibleLength(text):
# remove ansi escape sequences (coloring!) before getting the length
ansi_escape = re.compile(r'(?:\x1b[^m]*m|\x0f)', re.UNICODE)
return len(ansi_escape.sub('', text).decode('utf-8'))
class Columnar(object):
pos = 0
"""The internal cursor"""
headers = []... | StarcoderdataPython |
1164 | # Copyright 2016-present CERN – European Organization for Nuclear Research
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | StarcoderdataPython |
1733476 | <gh_stars>1-10
import asyncio
from pathlib import Path
from conjureup import controllers, events
from conjureup.app_config import app
from conjureup.ui.views.interstitial import InterstitialView
from . import common
class BootstrapController(common.BaseBootstrapController):
def __init__(self):
self.boot... | StarcoderdataPython |
1667081 | <filename>latex_service/render_release.py
from pdf_renderer import PDFRenderer
class RenderRelease(object):
def __init__(self, statistics, histograms):
self.statistics = statistics
self.histograms = histograms
self.renderer = PDFRenderer(self.statistics, self.histograms)
self.rend... | StarcoderdataPython |
48831 | from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters import Command
from aiogram.types import Message, CallbackQuery
from sqlalchemy.exc import NoResultFound
from loader import dp, logger_guru
from utils.database_manage.sql.sql_commands import DB_USERS
from utils.keyboards.admins_tools_kb import t... | StarcoderdataPython |
26481 | from django.utils.translation import ugettext_lazy as _
SHIPPING_STANDARD = 'Standard'
SHIPPING_EXPEDITED = 'Expedited'
SHIPPING_PRIORITY = 'Priority'
SHIPPING_SPEED_CATEGORIES = (
(SHIPPING_STANDARD, _("Standard")),
(SHIPPING_EXPEDITED, _("Expedited")),
(SHIPPING_PRIORITY, _("Priority")),
)
METHOD_CONS... | StarcoderdataPython |
1679597 | from django.test.utils import override_settings
from unittest.mock import patch
from configuration.cache import get_configuration
from qcat.tests import TestCase
@patch('configuration.cache.cache')
class GetConfigurationQueryFilterTest(TestCase):
@override_settings(USE_CACHING=True)
def test_returns_cache_i... | StarcoderdataPython |
49990 | """ Collection of Active Learning Scorers """
# Copyright (c) 2020. Lightly AG and its affiliates.
# All Rights Reserved
from lightly.active_learning.scorers.scorer import Scorer
from lightly.active_learning.scorers.classification import ScorerClassification
from lightly.active_learning.scorers.detection import Score... | StarcoderdataPython |
3319595 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Date : Apr-17-20 02:45
# @Author : <NAME> (<EMAIL>)
# @Link : http://example.org
import os
import json
import pandas as pd
import numpy as np
import torch
from torch import nn, optim
from torch.autograd import Variable
import torch.nn.functional... | StarcoderdataPython |
93010 | # -*- coding: utf-8 -*-
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
import pytest
from goodplay.ansible_support import is_test_playbook_file
class CollectOnlyTestPlaybooks(object):
def pytest_ignore_collect(self, path, config):
# do not ignore direc... | StarcoderdataPython |
21345 | import re
def str2bool(my_str):
"""returns a reasonable boolean from a string so that "False" will result in False"""
if my_str is None:
return False
elif isinstance(my_str, str) and my_str.lower() == "false":
return False
elif isinstance(my_str, str) and my_str.lower() == "off":
... | StarcoderdataPython |
1603112 | <gh_stars>0
#Computational analysis of FRET rates between Chlorophylls
#import packages
import pandas as pd
import numpy as np
#load coordinates of Chlorophylls
#data-set should be like below in *.csv file.
#Molecule Label Element X Y Z
#example)
#CLA A 405 NB 244.604 280.744 222.325
#CLA ... | StarcoderdataPython |
1759980 | # Utilities for manipulating word data structures
#
# Copyright (c) 2018-2020 <NAME>. See file LICENSE and https://ylonen.org
import re
from .config import WiktionaryConfig
from wikitextprocessor import ALL_LANGUAGES, Wtp
# Keys in ``data`` that can only have string values (a list of them)
str_keys = ("tags", "gloss... | StarcoderdataPython |
81407 | import os
import textwrap
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
required_conan_version = ">=1.36.0"
class TensorflowLiteConan(ConanFile):
name = "tensorflow-lite"
license = "Apache-2.0"
homepage = "https://www.tensorflow.org/lite/guide"
url = ... | StarcoderdataPython |
3313571 | import numpy as np
###############################################################################
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
m.weight.data.normal_(0.0, 0.01)
m.bias.data.normal_(0.0, 0.01)
elif classname.find('BatchNor... | StarcoderdataPython |
156022 | <filename>oslo/transformers/tasks/data_causal_lm.py<gh_stars>100-1000
from typing import Dict, List, Optional
from datasets.arrow_dataset import Batch
from oslo.transformers.tasks.data_base import BaseProcessor
try:
from transformers.data.data_collator import _torch_collate_batch
except ImportError:
print("Y... | StarcoderdataPython |
3328276 | import riff
import struct
import sys
from mpeg4 import is_iframe
class Stream(object):
def __init__(self, num, stream_type):
self.num = int(num)
self.type = stream_type
self.chunks = []
def add_frame(self, chunk):
self.chunks.append(chunk)
def __getitem__(self, index):
return self.chunks._... | StarcoderdataPython |
1670095 | r"""
http://github.com/in4lio/yupp/
__ __ _____ _____
/\ \ /\ \ /\ _ \ _ \
\ \ \_\/ \_\/ \_\ \ \_\ \
\ \__ /\____/\ __/\ __/
\/_/\_\/___/\ \_\/\ \_\/
\/_/ \/_/ \/_/
yup.py -- shell of yupp preprocessor
"""
from __future__ import absolute_import
from __future__ import division
from __fu... | StarcoderdataPython |
161334 | <gh_stars>0
#!/usr/bin/env python
""" """
# Script information for the file.
__author__ = "<NAME> (<EMAIL>)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) 2007 <NAME>"
__license__ = ""
# Subversion informations for the file.
__svnRevision__ = "$Revision: 2146 $"
__svnDate__ = "$Date: 2011-01-03 07:32:... | StarcoderdataPython |
1699785 | from crash_generator import configuration
from crash_generator.motion_control.boundary_following import BoundaryFollower
from crash_generator.robot.robot import Robot
class ConstantMotion(object):
def __init__(self, robot: Robot, linear_vel, angular_vel, exit_condition):
self._robot = robot
self.... | StarcoderdataPython |
3286284 | <filename>tests/dictserver.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# ... | StarcoderdataPython |
1707180 | <reponame>UncleEngineer/PythonNetworkGame101
import threading
import time
def toothbrush(name):
for i in range(10):
print("{} toothbrushing {}".format(name,i))
time.sleep(1)
def shower(name):
for i in range(15):
print("{} showering {}".format(name,i))
time.sleep(1)
task1 = threading.Thread(tar... | StarcoderdataPython |
53669 | <gh_stars>1-10
from collections import deque
import numpy as np
import cv2
import imutils
def convertor(blue, green, red):
color = np.uint8([[[blue, green, red]]])
hsv_color = cv2.cvtColor(color, cv2.COLOR_BGR2HSV)
hue = hsv_color[0][0][0]
lower_range = np.array([str(hue-10), 100, ... | StarcoderdataPython |
171176 | <reponame>cbn-alpin/gefiproj-api
# Python libraries
from flask import render_template, jsonify
from flask_cors import CORS
# External libraries
from flask_migrate import Migrate
from src.api import create_api, db
from src.api.amounts.resources import resources as amounts_ressources
from src.api.expenses.resources imp... | StarcoderdataPython |
1759409 | <reponame>mahdikhaligh/store
from django.db import models
from datetime import datetime
class Contact(models.Model):
fullname = models.CharField(max_length=150)
email = models.EmailField()
subject = models.CharField(max_length=150)
text = models.TextField()
time = models.DateTimeField(auto_now_add... | StarcoderdataPython |
1686439 | from Core.App import App
from Core.Ui import *
import sys
import gc
class TwitchLink:
def run(self):
app = QtWidgets.QApplication(sys.argv)
Translator.load()
while True:
exitCode = App.start(Ui.MainWindow())
DB.save()
gc.collect()
if exitCod... | StarcoderdataPython |
3201673 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | StarcoderdataPython |
3380998 | <filename>tests/recipe_parsers/test_parser.py
# Copyright (c) 2021 The Toltec Contributors
# SPDX-License-Identifier: MIT
import os
import re
from os import path
import unittest
from tempfile import TemporaryDirectory
from datetime import datetime, timezone
from toltec import parse_recipe
from toltec.bash import Scrip... | StarcoderdataPython |
1721561 | <reponame>mramospe/minkit<gh_stars>0
########################################
# MIT License
#
# Copyright (c) 2020 <NAME>
########################################
'''
API for minimizers.
'''
from . import evaluators
from . import fcns
from . import minuit_api
from . import nlopt_api
from . import scipy_api
from ..base ... | StarcoderdataPython |
1692353 | <filename>Python 1/NIM.py<gh_stars>0
"""Desenvolva um jogo NIM, em que o computador sempre saia vitorioso"""
def partida():
n = int(input("Digite o numero de peças: "))
m = int(input("Digite o maximo de peças a ser retirada: "))
if n % (m + 1) == 0:
print("Você começa!")
jogador = True
... | StarcoderdataPython |
3305009 | <gh_stars>1-10
import discord
from discord.ext import commands
import random
import time
import asyncio
from discord.ext.commands.cooldowns import BucketType
class Minesweeper(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.sending = False
async def bomb_placer(self, size:int, min... | StarcoderdataPython |
1610260 |
# class Father:
# fatherpara = 100
#
# def __init__(self):
#
# print('调用父类构造函数')
# def fatherfun1(self):
# print('调用父类构造函数')
# def fatherfun2(self, para):
# Father.fatherpara = para
# #self.fatherpara = para
# def getpara(self):
# print('the para is %d'%self.... | StarcoderdataPython |
16348 | <reponame>JC2295/FCC_Tutorial_Projects
print("One")
print("Two")
print("Three")
| StarcoderdataPython |
3280103 | <reponame>rfocosi/raspi-safe-shutdown
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
import os
GPIO.setmode(GPIO.BCM)
GPIO.setup(27, GPIO.IN)
while True:
if (GPIO.input(27)):
os.system("poweroff")
break
time.sleep(1)
| StarcoderdataPython |
1658147 | """
Problem:
Given a string, find the palindrome that can be made by inserting the fewest number of
characters as possible anywhere in the word. If there is more than one palindrome of
minimum length that can be made, return the lexicographically earliest one (the first
one alphabetically).
For example, given the str... | StarcoderdataPython |
1632537 | # -*- coding: utf-8 -*-
""" library to take autodiff and execute a computation graph """
from __future__ import absolute_import
import numpy as np
from .Node import Op
from .. import ndarray
from ..stream import *
from ..logger import Logger
from .._base import get_array_memory
from .Variable import PlaceholderOp
from ... | StarcoderdataPython |
3395278 | <filename>pyleecan/Functions/get_logger.py
from logging import getLogger
from ..loggers import DEFAULT_LOG_NAME
def get_logger(obj):
"""Get the object logger or its parent's one
Parameters
----------
obj :
A pyleecan object
Returns
-------
logger : logging.Logger
Pyleecan... | StarcoderdataPython |
1623274 | <reponame>Algorithmic-Alignment-Lab/openTAMP-legacy
import numpy as np
import os
import pybullet as P
import sys
import time
from opentamp.envs import BaxterMJCEnv
import main
from core.parsing import parse_domain_config, parse_problem_config
from core.util_classes.robots import Baxter
from core.util_classes.openrave... | StarcoderdataPython |
1783281 | <reponame>qrsforever/workspace
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import price
import numpy
import thinkplot
import thinkbayes
def CH6_2(price1, price2):
"""
两组展览品的价格分布
"""
thinkplot.Clf()
thinkplot.PrePlot(num=2)
# 因为price变量值没有重复的, 所以PMF绘图是看不出什么的.
# price1_pmf = thinkbayes.MakePm... | StarcoderdataPython |
3226438 | <filename>MainInventory.py
import tkinter as tk
import tkinter.ttk as ttk
import utility
class MainInventory:
def __init__(self, main_frame, db):
self.tab = ttk.Frame(main_frame)
self.col = "id"
self.ascending = False
self.db = db
self.search = ""
self.tab.bind("... | StarcoderdataPython |
1657818 | <gh_stars>1-10
# Copyright 2001 by <NAME>. All rights reserved.
"""BioPython Pathway support module.
Bio.Pathway.Rep is a collection of general data abstractions used in the
implementation of the Bio.Pathway module. These abstractions are not intended
for direct use, but if they fit your needs there's no reason t... | StarcoderdataPython |
56381 | <reponame>IVRL/Dunit
from .drit import DRITObjectDetection
from .unit import UNITObjectDetection
from .faster_rcnn import FasterRCNNObjectDetection
| StarcoderdataPython |
3384534 | data = (
'ggyeols', # 0x00
'ggyeolt', # 0x01
'ggyeolp', # 0x02
'ggyeolh', # 0x03
'ggyeom', # 0x04
'ggyeob', # 0x05
'ggyeobs', # 0x06
'ggyeos', # 0x07
'ggyeoss', # 0x08
'ggyeong', # 0x09
'ggyeoj', # 0x0a
'ggyeoc', # 0x0b
'ggyeok', # 0x0c
'ggyeot', # 0x0d
'ggyeop',... | StarcoderdataPython |
1629718 | from tkinter import *
from puzzle import *
from random import randint
from threading import Thread
import copy
N, M = 100, 10
def V(t):
s, e = 0, 0.
for i in range(len(t)):
for j in range(len(t[0])):
if t[i][j] != 0 :
s, e = s + t[i][j], e + 1
return s/e
"""
def V(t):
... | StarcoderdataPython |
1793969 | # from rest_framework import serializers
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.generics import CreateAPIView
# from rest_framework.permissions import IsAuthenticated
from rest_framewor... | StarcoderdataPython |
98984 | from django.contrib import admin
from django.conf.urls.static import static, settings
from django.urls import path, include
handler404 = 'database.views.page_not_found'
handler500 = 'database.views.server_error'
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('database.urls')),
path('', ... | StarcoderdataPython |
4824429 | __authors__ = ["<NAME>", "<NAME>", "<NAME>"]
__copyright__ = "Copyright 2021, <NAME>"
__email__ = "<EMAIL>"
__license__ = "MIT"
import os
import sys
import shutil
from os.path import join
import tempfile
import hashlib
import urllib
import pytest
import glob
import subprocess
from snakemake import snakemake
from snak... | StarcoderdataPython |
4824716 | <gh_stars>0
"""
This module is a personalization of the forms proposed by Django.
They are to be used for account creation and authentication.
Classes:
LoginForm
UserRegistrationForm
Exceptions:
NIL
Functions:
NIL
"""
from django import forms
from django.contrib.a... | StarcoderdataPython |
4842317 | from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import os
import nn_utils.network_utils as network_utils
import gen_utils.seed_generator as seed_generator
import gen_utils.sequence_generator as sequence_generator
from data_utils.parse_files import *
import config.nn_confi... | StarcoderdataPython |
1683880 | """
Class object for FilesystemFile
Documentation: https://system-bridge.timmo.dev
"""
from __future__ import annotations
from ..base import BridgeBase
class FilesystemFile(BridgeBase):
@property
def name(self) -> str:
return self.attributes.get("name")
@property
def created(self) -> str | N... | StarcoderdataPython |
1770363 | <reponame>LouisCastricato/eeqa
import json
import collections
input_file = "./data/ace-event/processed-data/description_queries_new.csv"
output_file = "./data/ace-event/processed-data/all_args"
out_f = open(output_file, "w")
arg_dict = collections.OrderedDict()
with open(input_file, "r") as f:
for line in f:
... | StarcoderdataPython |
132552 | <filename>code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/roles/tests/test_role_add.py
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
# This software is released ... | StarcoderdataPython |
1697923 | <reponame>leleact/pytest
#! /usr/bin/env python
#! -*- coding: utf-8 -*-
import logging
import unittest
import sys
import requests
from lxml import html, etree
from io import StringIO
logging.basicConfig(level=logging.DEBUG,
format="%(asctime)s - %(levelname)s - %(message)s",
h... | StarcoderdataPython |
3295947 | <gh_stars>10-100
# Copyright (c) Facebook, Inc. and its affiliates.
from transformers import (
AutoConfig,
AutoModelForQuestionAnswering,
AutoTokenizer,
QuestionAnsweringPipeline,
)
from dynalab.handler.base_handler import BaseDynaHandler
from dynalab.tasks.task_io import TaskIO
class Handler(BaseDy... | StarcoderdataPython |
3344072 | from __future__ import print_function
#File Import
import pcapReader
import communicationDetailsFetch
import torTrafficHandle
import maliciousTrafficIdentifier
import deviceDetailsFetch
import networkx as nx
#import matplotlib.pyplot as plt
from graphviz import Digraph
import threading
import os
class plotLan:
... | StarcoderdataPython |
3368177 | <filename>synapse/push/httppusher.py<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | StarcoderdataPython |
4809357 | def Template(haveblitz, have40lines, haveleague, havestats, havebadges):
rank = ""
stats = ""
blitz = ""
_40Lines = ""
badges = ""
if not haveblitz and not have40lines and not haveleague and not havestats:
return "没有查找到关于 {username} 的数据,请手动前往 https://ch.tetr.io/u/{_id} 进行查看"
if havel... | StarcoderdataPython |
14926 | <filename>docs/_docs/bash/az3166_patch_binary.py
# ----------------------------------------------------------------------------
# Copyright (C) Microsoft. All rights reserved.
# Licensed under the MIT license.
# ----------------------------------------------------------------------------
import os
import binascii
im... | StarcoderdataPython |
1733958 | <filename>gistools/stats.py
# -*- coding: utf-8 -*-
""" Statistic toolset for geographic objects
More detailed description.
"""
# __all__ = []
# __version__ = '0.1'
from math import sqrt as msqrt
import numpy as np
from gistools.layer import GeoLayer
from gistools.exceptions import ZonalStatisticsError
from gistoo... | StarcoderdataPython |
1748941 | <gh_stars>0
import logging
from pathlib import Path
import matplotlib.pyplot as plt
import motmetrics
import pandas as pd
from vvc import config
from vvc.detector import object_detection
from vvc.format import vvc_format
from vvc.tracker.iou_tracker import IOUTracker
from vvc.tracker.opencv_tracker import OpenCVTrack... | StarcoderdataPython |
3348918 | # Copyright: <NAME> <<EMAIL>>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import time
import traceback
import gc
from aqt.qt import *
import aqt
from anki import Collection
from anki.sync import Syncer, RemoteServer, FullSyncer, MediaSyncer, \
RemoteMediaServer
from anki.hooks i... | StarcoderdataPython |
58051 | """
Test grades.py
"""
# Standard library imports
from unittest.mock import patch
# Third-party library imports
import pytest
class TestDataIsRetrievedCorrectly:
@staticmethod
def test_count_finished_modules(local_grades):
with patch.dict(
local_grades.data,
{
... | StarcoderdataPython |
3232462 | default_website = "http://brosseau.ovh"
#ldap_server = "ldap://192.168.1.49"
#ldap_dn = "uid={0},cn=users,dc=brosseau"
ldap_server = "ldap://localhost"
ldap_dn = "cn={0},dc=example,dc=org"
log_path = "/tmp/cso.log"
""" ADMIN """
login_url = "/login?apps=admin&next=/admin/login"
| StarcoderdataPython |
1758987 | <reponame>rheinwerk-verlag/planning-poker
# Generated by Django 3.0.3 on 2021-04-27 06:36
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency... | StarcoderdataPython |
1679295 | <gh_stars>1-10
import argparse
def parse_args():
parser = argparse.ArgumentParser(
description="Get notebook training args")
parser.add_argument("--input-notebook", required=True)
parser.add_argument("--project-id", required=False)
parser.add_argument("--output-notebook", required=False)
parser.add_... | StarcoderdataPython |
23716 | <gh_stars>1-10
import sys
from itertools import chain
def fast_count_segments(starts, ends, points):
cnt = [0] * len(points)
start_points = zip(starts, ['l'] * len(starts), range(len(starts)))
end_points = zip(ends, ['r'] * len(ends), range(len(ends)))
point_points = zip(points, ['p'] * len(points), ra... | StarcoderdataPython |
3325497 | <gh_stars>0
#!/usr/bin/python
import subprocess
import os
import numpy as np
from scipy.signal import savgol_filter
from nibabel import load, save, Nifti1Image
from nilearn import image
from nilearn.input_data import NiftiMasker
from joblib import Parallel, delayed
from fg_constants import *
def confounds(num, subj... | StarcoderdataPython |
3286362 | import re
from collections import defaultdict
recipes = {}
pair_counts = defaultdict(int)
template = input()
for a, b in zip(template[:-1], template[1:]):
pair_counts[a+b] += 1
input() # fuck you gabriel
while recipe := input():
[(adjacent, newchar)] = re.findall("([A-Z]+) -> ([A-Z])", recipe)
recipes[... | StarcoderdataPython |
1759370 | #!/usr/bin/env python
__version__ = '0.0.1'
__author__ = '<NAME>'
__email__ = '<EMAIL>'
#Write your code below this line 👇
# to run the code paste in https://reeborg.ca/reeborg.html
def jump():
move()
turn_left()
move()
turn_left()
turn_left()
turn_left()
move()
turn_left()
tur... | StarcoderdataPython |
1720581 | <reponame>thejose5/rl-project
from keras import backend as K
from keras.engine.topology import Layer
from keras.layers import merge
from keras import initializers
import numpy as np
class RunningMeanStd(Layer):
def __init__(self, **kwargs):
super(RunningMeanStd, self).__init__(**kwargs)
def build(se... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.