id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
6475224 | <filename>setup.py
import sys
from setuptools import setup
VERSION = '0.0.1'
DESCRIPTION = 'WRITE SOMETHING INTELLIGENT HERE!'
CLASSIFIERS = ['Development status :: 3 - Alpha',
'Intended Audience :: Ay250 grader',
'Topic :: Software Development :: Libraries :: Python Modules',
... | StarcoderdataPython |
3213904 | <reponame>tencentmusic/fab
# 如果安装torndb,记得要替换/usr/local/lib/python3.6/dist-packages文件夹下的torndb.py文件,内容同utils/torndb-python3.py
import queue,threading,torndb
# mysql异步线程池
class MysqlConnPool(object):
def __init__(self, host, database, user, pwd, max_conns=30):
self.idle_conn = queue.Queue()
self.... | StarcoderdataPython |
160790 | <filename>env/Lib/site-packages/plotly/validators/layout/smith/imaginaryaxis/__init__.py
import sys
if sys.version_info < (3, 7):
from ._visible import VisibleValidator
from ._tickwidth import TickwidthValidator
from ._tickvalssrc import TickvalssrcValidator
from ._tickvals import TickvalsValidator
... | StarcoderdataPython |
1611984 | def is_valid(number):
min_number = 2
max_number = 10
results = [x for x in range(min_number, max_number + 1) if number % x == 0]
return True if results else False
n = int(input())
m = int(input())
result = [x for x in range(n, m + 1) if is_valid(x)]
print(result) | StarcoderdataPython |
1884286 | #!/usr/bin/env python3
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2021 Regents of the University of California
# All rights reserved.
#
"""
This type of setup script should be placed in the setup_scripts directory in
the trunk
"""
import os
TECHNOLOGY = "sky130"
os.environ["MGC_TMPDIR"] = "/tmp... | StarcoderdataPython |
11280326 | import mysql.connector
cnx = mysql.connector.connect(user='testing', password='<PASSWORD>',
host='192.168.2.102',
database='testing')
cursor = cnx.cursor()
add_statistike = ("INSERT INTO meteo_uslovi ( temperatura_1, temperatura_2, pritisak, vlaznost_vazduha... | StarcoderdataPython |
8045682 | class InfrastructureEntity:
def __init__(self):
self.sinks = list()
self.states = list()
self.visualizations = list()
self.hourly_days = None
self.warning_zone = None
def load_state(self, state: dict):
self.sinks = state['sinks']
self.states = state['sta... | StarcoderdataPython |
6585104 | <filename>creational-patterns/abstract_factory.py<gh_stars>0
"""
https://sourcemaking.com/design_patterns/abstract_factory
https://medium.com/datadriveninvestor/usage-of-singleton-pattern-in-multithreaded-applications-ec0cc4c8805e
"""
from abc import ABC, abstractmethod
class Tv(ABC):
pass
class Phone(ABC):
... | StarcoderdataPython |
151151 | <reponame>Philoso-Fish/CARLA<filename>carla/__init__.py<gh_stars>0
# flake8: noqa
from .evaluation import distances
| StarcoderdataPython |
238815 | <reponame>NGoetz/TorchPS
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="torchps",
version="1.0.1",
author="<NAME>",
author_email="<EMAIL>",
description="Phase Space Sampling with PyTorch",
long_description=long_de... | StarcoderdataPython |
11277513 | #!/usr/bin/env python
from os.path import exists
from setuptools import setup
setup(name='castra',
version='0.1.8',
description='On-disk partitioned store',
url='http://github.com/blaze/Castra/',
maintainer='<NAME>',
maintainer_email='<EMAIL>',
license='BSD',
keywords='',
... | StarcoderdataPython |
126587 | <reponame>barnabemonnot/eth2.0-specs
from eth2spec.phase0 import spec as spec_phase0
from eth2spec.altair import spec as spec_altair
from eth2spec.phase1 import spec as spec_phase1
from eth2spec.test.context import PHASE0, PHASE1, ALTAIR
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators
s... | StarcoderdataPython |
11240393 | from morph2vec.api import Morph2Vec
__version__ = '1.0.0'
| StarcoderdataPython |
4989334 | import warnings
import plac
import spacy
import srsly
from wasabi import msg
from spacy_crfsuite.crf_extractor import CRFExtractor
from spacy_crfsuite.tokenizer import SpacyTokenizer
from spacy_crfsuite.train import gold_example_to_crf_tokens
from spacy_crfsuite.utils import read_file
warnings.simplefilter(action="i... | StarcoderdataPython |
143087 | <filename>gpaw/setup/customize-mahti.py
"""User provided customizations.
Here one changes the default arguments for compiling _gpaw.so (serial)
and gpaw-python (parallel).
Here are all the lists that can be modified:
* libraries
* library_dirs
* include_dirs
* extra_link_args
* extra_compile_args
* runtime_library_d... | StarcoderdataPython |
5061040 | series = {
'row': lambda cell: tuple(board[cell[0]][col] for col in range(cell[1],min(7,cell[1]+4))),
'col': lambda cell: tuple(board[row][cell[1]] for row in range(cell[0],min(6,cell[0]+4))),
'primary_diagonal': lambda cell: tuple(board[cell[0]+i][cell[1]+i] for i in (0,1,2,3) if cell[0]+i < 6 and cell[1]+... | StarcoderdataPython |
6694549 | """Support for loading picture from Neato."""
from datetime import timedelta
import logging
from homeassistant.components.camera import Camera
from . import NEATO_LOGIN, NEATO_MAP_DATA, NEATO_ROBOTS
_LOGGER = logging.getLogger(__name__)
SCAN_INTERVAL = timedelta(minutes=10)
def setup_platform(hass, config, add_en... | StarcoderdataPython |
4928479 | from petisco.legacy import LogMessage
from petisco.legacy.logger.interface_logger import ILogger
class FakeLogger(ILogger):
def __init__(self):
self.logging_messages = []
def log(self, logging_level, log_message: LogMessage):
self.logging_messages.append((logging_level, log_message.to_dict())... | StarcoderdataPython |
6699303 | # -*- coding: utf-8 -*-
"""
Test ramlient.core module
"""
import types
import pytest
from ramlient.core import Node, ParameterizedNode
from ramlient.errors import UnsupportedResourceMethodError, UnsupportedQueryParameter
@pytest.mark.parametrize('example_client', [
'simple'
], indirect=['example_client'])... | StarcoderdataPython |
11385709 | import re
from itertools import count
from .tools import process_path
_conversions = {'atomicint': 'counter',
'str': 'text',
'bool': 'boolean',
'decimal': 'decimal',
'float': 'float',
'int': 'int',
'tuple': 'tuple',
... | StarcoderdataPython |
3426654 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | StarcoderdataPython |
1685775 | from kokoropy.controller import Crud_Controller
from ..models._all import Third_Party_Authenticator
class Third_Party_Authenticator_Controller(Crud_Controller):
__model__ = Third_Party_Authenticator
Third_Party_Authenticator_Controller.publish_route() | StarcoderdataPython |
272511 | <reponame>daijingjing/tornado_web_base
# -*- encoding: utf-8 -*-
from modules.index.IndexHandler import IndexHandler
urls = [
(r'/index', IndexHandler),
]
| StarcoderdataPython |
113170 | <reponame>andrade-stats/DisjunctSupportSpikeAndSlab
import numpy
from SpikeAndSlabNonContinuous_ModelSearch_Proposed import SpikeAndSlabProposedModelSearch as SpikeAndSlabProposedModelSearch_NONCONT
import shared.idcHelper as idcHelper
MAX_INCREASE_IN_ERROR = 0.05
def select(maxIncreaseInError, allResultsForEachDelta... | StarcoderdataPython |
1874889 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | StarcoderdataPython |
1697131 | <reponame>pamjesus/RotorHazard<gh_stars>1-10
'''
RotorHazard event manager
'''
import gevent
from monotonic import monotonic
class EventManager:
processEventObj = gevent.event.Event()
events = {}
eventOrder = {}
eventThreads = {}
def __init__(self):
pass
def on(self, event, name, ha... | StarcoderdataPython |
12803521 | import re
import struct
import ctypes
import itertools
def tokenize(string):
string_ = string
#print 'tokenizing: %s' % string
result = []
# pick off opcode
opcode = re.match(r'^(\w+)', string).group(1)
result.append(['OPC', opcode])
string = string[len(opcode):]
# pick off the rest
while string:
eat = 0
... | StarcoderdataPython |
377121 | <reponame>vectorcrumb/3D-face-tracker
import cv2
print(cv2.__version__)
if cv2.__version__ is '2.4.10':
print("Install working!")
exit(0)
| StarcoderdataPython |
1629849 | <reponame>shaochangbin/chromium-crosswalk
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from benchmarks import silk_flags
from measurements import rasterize_and_record_micro
from telemetry import test
... | StarcoderdataPython |
12809591 | <reponame>misialq/qiime2<gh_stars>100-1000
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----... | StarcoderdataPython |
3232716 | from setuptools import find_packages
from setuptools import setup
package_name = 'rclnodejs_pkg_creation_tool'
setup(
name=package_name,
version='0.0.1',
packages=find_packages(exclude=['test', 'scripts']),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + pa... | StarcoderdataPython |
4936556 | <reponame>WeihaoTan/gym_cooking_env<gh_stars>0
import gym
import numpy as np
from gym import spaces
from env.items import Tomato, Lettuce, Plate, Knife, Delivery, Agent, Food
from env.render.game import Game
DIRECTION = [(0,1), (1,0), (0,-1), (-1,0)]
ITEMNAME = ["space", "counter", "agent", "tomato", "lettuce", "plat... | StarcoderdataPython |
8053411 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\interactions\jog_interaction.py
# Compiled at: 2020-07-22 05:56:20
# Size of source mod 2**32: 16676... | StarcoderdataPython |
4937575 | class TestClass:
def reverse_string(self, str):
result = ""
i = len(str) - 1
while i >= 0:
result += str[i]
i -= 1
return result
def test_method(self):
print self.reverse_string("print value")
return "return value"
try:
TestClass(... | StarcoderdataPython |
3437712 | <gh_stars>10-100
from discord.ext import commands
class Gateway(commands.Cog):
def __init__(self, bot):
self.bot = bot
db = self.bot.db()
self.collection = db["gateway"]
def setup(bot):
bot.add_cog(Gateway(bot))
| StarcoderdataPython |
11269792 | <gh_stars>10-100
import time, datetime
from apscheduler.schedulers.blocking import BlockingScheduler
from src.sensors.sensors1_text import sonde1
from src.sensors.sensors2_piechart import sonde2
from src.sensors.sensors3_linechart import sonde3
from src.sensors.sensors4_cumulativeflow import sonde4
from src.sensors.sen... | StarcoderdataPython |
9632601 | <reponame>ardin/simple-django-login-and-register
BBBB BBBB
gettext(u'Your username is:')
| StarcoderdataPython |
1625953 | import torch
import torch.nn.functional as F
from torch import nn
class PyramidPooling(nn.Module):
"""
Reference:
<NAME>, et al. *"Pyramid scene parsing network."*
"""
def __init__(self, in_channels, norm_layer, up_kwargs):
super(PyramidPooling, self).__init__()
self.pool1 = n... | StarcoderdataPython |
1874130 | # Also, there's a timeout error which is managed by subprocess module.
class TIRCrashError(Exception):
pass
class IncorrectResult(Exception):
pass
class PerfDegradation(Exception):
pass
class RuntimeFailure(Exception):
pass
# Timeout...
class MaybeDeadLoop(Exception):
pass
| StarcoderdataPython |
9791092 | <reponame>Ridhii/SyncdSim
#!/usr/bin/env python
import os
import sys
sys.path.append(os.path.join(os.environ["CONTECH_HOME"], "scripts"))
import util
import subprocess
import shutil
import time
import datetime
import glob
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matp... | StarcoderdataPython |
6618784 | VERSION = (1, 0, 13)
| StarcoderdataPython |
8151378 |
import bisect
import cPickle as pickle
import re
from application.notification import IObserver, NotificationCenter
from application.python import Null
from application.python.types import Singleton
from datetime import date
from sipsimple.account import BonjourAccount
from sipsimple.threading import run_in_thread
fr... | StarcoderdataPython |
3237583 | from colorama import Fore, init
init(autoreset=True)
def validaNumero(numero):
numero_real = input(numero)
while True:
if numero_real.isnumeric():
return int(numero_real)
break
else:
print(Fore.RED + 'ERRO! Digite um número válido!')
... | StarcoderdataPython |
8124402 | <filename>studies/event/gw151226_ias_points_no_m1m2_reweighting/plot_caches.py
from deep_gw_pe_followup.restricted_prior import RestrictedPrior
import matplotlib.pyplot as plt
from deep_gw_pe_followup import get_mpl_style
from deep_gw_pe_followup.plotting.hist2d import make_colormap_to_white, plot_heatmap
import os
fro... | StarcoderdataPython |
1751482 | #!/usr/bin/env python
import argparse
import base64
import json
import logging
import subprocess
import os
import grp
import pwd
import time
def mkdirs(path):
subprocess.check_call(["mkdir", "-p", path])
def subprocess_retry(supplier, retries, process_cmd):
if retries < 0:
logging.fatal("All retries... | StarcoderdataPython |
3379805 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import sys
import six
from pyopenapi.migration.base import ApiBase
from pyopenapi import utils, consts
def get_test_data_folder(version='1.2', which=''):
"""
"""
import pyopenapi.tests.data
version = 'v' + version.replace('.', '... | StarcoderdataPython |
6463028 | <filename>setup.py
from setuptools import setup
VERSION = '0.0.0'
setup(
name='django-cerebral-forms',
version=VERSION,
packages=['cerebral'],
install_requires=[],
description='Progressive forms for intelligent websites',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
)
| StarcoderdataPython |
11321024 | from src.models.resnet_simclr import ResNetSimCLR
from src.models.scatnet_simclr import ScatSimCLR
from src.models.logistic_regression import LogisticRegression
| StarcoderdataPython |
4971284 | from datetime import timedelta
import grpc
from google.protobuf import empty_pb2
from psycopg2.extras import DateTimeTZRange
from sqlalchemy.sql import and_, func, or_, update
from couchers import errors
from couchers.db import can_moderate_node, get_parent_node_at_location, session_scope
from couchers.models import ... | StarcoderdataPython |
4938896 | #!/usr/bin/env python3
"""
# Processing Status
## Initial
The initial processing_status when the container first runs is:
{
processing_status = ProcessingStatus.PENDING
upload_status = UploadStatus.WAITING
upload_progress = 0
upload_message = ""
validation_status = ValidationStatus
validation_... | StarcoderdataPython |
8057081 | <filename>weasyl/report.py<gh_stars>0
import arrow
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.orm import aliased, contains_eager, joinedload
import sqlalchemy as sa
import web
from libweasyl.models.content import Report, ReportComment
from libweasyl.models.users import Login
from libweasyl import... | StarcoderdataPython |
4873193 | class Vector:
head: Vector = None
tail: Vector = None
val: int = 0
def create(self: Vector, val: int) -> Vector:
self.val = val
return self
def append(self: Vector, val: int) -> Vector:
newObj: Vector = Vector()
newObj.val = val
if (self.head is Non... | StarcoderdataPython |
1881949 | <filename>sahara/service/volumes.py
# Copyright (c) 2013 Mirantis Inc.
#
# 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.0
#
# Unless required by... | StarcoderdataPython |
1643010 | from mysql import *
from mysql.connector import pooling
import sys
class Conexion:
_DATABASE = 'bqifo1pz07m1cxqswphy'
_USERNAME = 'uqqvf5c2n9ccrnrv'
_PASSWORD = '<PASSWORD>'
_DB_PORT = '21374'
_HOST = 'bqifo1pz07m1cxqswphy-mysql.services.clever-cloud.com'
_MAX_CON = 5
_pool = None
@cl... | StarcoderdataPython |
1987071 | <filename>Website/main.py
from flask import Flask, render_template, request, redirect,send_file, g
import requests
import csv
import pandas as pd
selcted_side = 0
chosen_product_1 = {}
chosen_product_2 = {}
app = Flask("Comparison Website")
@app.route('/')
def home():
term = request.form.get("term")
return rend... | StarcoderdataPython |
73601 | <filename>pyutils/iolib/video.py
import os, re
import numpy as np
from pyutils.cmd import runSystemCMD
import skimage.io as sio
OPENCV = 0
IMAGEIO = 1
FFMPEG = 2
BACKENDS = {'opencv': OPENCV, 'imageio': IMAGEIO, 'ffmpeg': FFMPEG}
def getFFprobeMeta(fn):
cmd = 'ffprobe -hide_banner -loglevel panic ' + fn + ' -sho... | StarcoderdataPython |
345186 | <filename>exp/train_search.py
'''
@author: <NAME>
@contact: <EMAIL>
@github: github.com/mrluin
'''
import os
import torch
import glob
from models.gumbel_super_network import GumbelAutoDeepLab
from run_manager import RunConfig
from nas_manager import ArchSearchConfig, ArchSearchRunManager
from configs.train_search_con... | StarcoderdataPython |
8110052 | from django.db import models
# Create your models here.
class Images(models.Model):
'''
model to handle images
'''
image_link = models.ImageField(upload_to='images/')
title = models.CharField(max_length=80)
description = models.TextField()
category = models.ForeignKey('Categories', on_delet... | StarcoderdataPython |
5050204 | #/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Red Hat, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | StarcoderdataPython |
9616820 | <reponame>meyt/linkable-py
import re
from linkable.tld_list import tld_list
from linkable import emoji
_flags = re.UNICODE | re.IGNORECASE
# Extracted from: https://data.iana.org/TLD/tlds-alpha-by-domain.txt
tld_list = tld_list.split('\n')
tld_list = tuple(map(
lambda i: i[4:].encode().decode('punycode') if i.st... | StarcoderdataPython |
11283604 | <reponame>charlesblakemore/opt_lev_analysis
import numpy as np
import bead_util as bu
import matplotlib.pyplot as plt
import os
import scipy.signal as sig
import scipy
import glob
from scipy.optimize import curve_fit
data_dir1 = "/data/20180529/imaging_tests/p0/xprofile"
def spatial_bin(xvec, yvec, bin_size = .13):
... | StarcoderdataPython |
1674218 | import unittest
from wasmtime import *
class TestTrap(unittest.TestCase):
def test_new(self):
store = Store()
trap = Trap(store, 'x')
self.assertEqual(trap.message(), u'x')
def test_errors(self):
store = Store()
with self.assertRaises(TypeError):
Trap(1, '... | StarcoderdataPython |
11215301 | <reponame>acidburn0zzz/llvm-project<gh_stars>100-1000
# encoding: utf-8
"""
Test lldb date formatter subsystem.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
from ObjCDataFormatterTestCase import ObjCDataFormatterTestCase
import dat... | StarcoderdataPython |
390523 | import pytest
import numpy as np
import numpy.linalg
import theano
from numpy import inf
from numpy.testing import assert_array_almost_equal
from theano import tensor, function
from theano.tensor.basic import _allclose
from theano import config
from theano.tensor.nlinalg import (
MatrixInverse,
matrix_invers... | StarcoderdataPython |
80654 | <gh_stars>0
""" Welcome The User To Masonite """
from masonite.request import Request
from masonite.view import View
from events import Event
from app.League import League
from masonite import Broadcast
class WelcomeController:
""" Controller For Welcoming The User """
def __init__(self, view: View, request:... | StarcoderdataPython |
4932746 | # coding=utf-8
# @Time : 2020/12/2 18:49
# @Auto : zzf-jeff
from abc import ABCMeta, abstractmethod
class BaseEncodeConverter(metaclass=ABCMeta):
def __init__(self,
max_text_length,
character_dict_path=None,
character_type='ch',
... | StarcoderdataPython |
3363237 | """Profiles"""
import os
import random
import sqlite3
from datetime import datetime
import scrapy
from scrapy.http import Request
from scrapy.selector import Selector
from scrapy_jsonschema.item import JsonSchemaItem
from ..items import ParliamentPipeline
parties_dictionary = {
"ПП ГЕРБ": "GERP",
"БСП за БЪ... | StarcoderdataPython |
6700009 | from mgear.core import pyqt
from mgear.vendor.Qt import QtCore, QtWidgets, QtGui
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(297, 300)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
size... | StarcoderdataPython |
4829230 | # -*- coding: UTF-8 -*-
import clr
clr.AddReferenceByPartialName("PresentationCore")
clr.AddReferenceByPartialName("PresentationFramework")
clr.AddReferenceByPartialName("WindowsBase")
from System import *
from System.Windows import *
from System.Windows.Controls import *
from System.Windows.Media.Imaging import ... | StarcoderdataPython |
9636971 | <reponame>isaiah/jy3k<gh_stars>1-10
def f(x):
class Foo():
@classmethod
def x(cls):
print(__class__)
print(cls)
@staticmethod
def y(x):
print(x)
print(__class__)
def bar(self):
print(x)
print(__class__)... | StarcoderdataPython |
9658886 | #!/usr/bin/env python
#
# Copyright (c) 2011 <NAME>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR D... | StarcoderdataPython |
5005177 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-05 09:16
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('presentation', '0001_initial'),
]
operations ... | StarcoderdataPython |
1873544 | <filename>cvrf/forms.py
from django import forms
class AcknowledgmentType_form(forms.Form):
Name = forms.MultipleChoiceField(NameType_model.objects.all())
Organization = forms.MultipleChoiceField(OrganizationType_model.objects.all())
Description = forms.MultipleChoiceField(DescriptionType2_model.objects.a... | StarcoderdataPython |
3378501 | <reponame>xiuhanq/pt-qiandao
from loguru import logger
import yaml
import os
import requests
class Notify(object):
# def __init__(self):
def get_notify_url(self):
# 获取当前脚本所在文件夹路径
current_path = os.path.abspath(".")
# 获取yaml配置文件路径
yamlPath = os.path.join(current_path, "config.yam... | StarcoderdataPython |
371478 | <filename>rllib/util/input_transformations.py<gh_stars>0
"""Input transformations for spot."""
from abc import ABC, abstractmethod
class AbstractTransform(ABC):
"""Abstract Transformation definition."""
extra_dim: int
@abstractmethod
def __call__(self, state):
"""Apply transformation."""
... | StarcoderdataPython |
9635186 | <reponame>esehara/skiski<filename>skiski/ski.py<gh_stars>0
from skiski.base import V
from skiski.helper import Typename
class VirtualCurry:
def __b__(self, x):
return self.dot(x)
class I(metaclass=Typename("I")):
"""
the identity operator
(lambda x: x)(5) => 5
>>> I(5).w()
5
""... | StarcoderdataPython |
5170329 | #@+leo-ver=5-thin
#@+node:edream.110203113231.741: * @file ../plugins/add_directives.py
"""Allows users to define new @direcives."""
from leo.core import leoGlobals as g
directives = ("markup",) # A tuple with one string.
#@+others
#@+node:ekr.20070725103420: ** init
def init():
"""Return True if the plugin has... | StarcoderdataPython |
1836759 | <gh_stars>1-10
#!/usr/bin/env python
"""Day 15 of advent of code"""
def generate_next_number(previous, factor, multiple):
"""Generates next number in sequence"""
while True:
value = (previous * factor) % 2147483647
if value % multiple == 0:
return value
previous = value
d... | StarcoderdataPython |
1879403 | #!/usr/bin/env python3
# coding=utf-8
import signal
from converter_lib import Converter
class SignalConverter(Converter):
NAME = "signal"
NUMBER_RANGE = range(1, 65)
@staticmethod
def number2code(number):
return signal.Signals(int(number)).name
@staticmethod
def code2number(code):
... | StarcoderdataPython |
1814453 | from typing import Union, List, Dict
from toolz import get_in
from roadmaps.models import RoadmapNode
from roadmaps.services.progress import ProgressCalculator
from roadmaps.types import TreeNode
class TreeWithProgressTransformer:
@classmethod
def transform(cls, node: Dict[str, Union[str, List[TreeNode]]])... | StarcoderdataPython |
356418 | # -*- coding: utf-8 -*-
'''
Execution module for `ciscoconfparse <http://www.pennington.net/py/ciscoconfparse/index.html>`_
.. versionadded:: 2019.2.0
This module can be used for basic configuration parsing, audit or validation
for a variety of network platforms having Cisco IOS style configuration (one
space indenta... | StarcoderdataPython |
5193631 | import os
import json
from glob import glob
from utils import get_code, SexpCache, set_paths, extract_code, dst_filename
from serapi import SerAPI
from time import time
import sexpdata
from proof_tree import ProofTree
from extract_proof import goal_is_prop, check_topology
import pdb
def close_proof(sexp_cache, serap... | StarcoderdataPython |
9602026 | __author__ = 'Folaefolc'
"""
Code par Folaefolc
Licence MIT
"""
from constantes import DEBUG_LEVEL, ree, POL_ANTIALISING
def println(*args, sep=" ", end="\r\n"):
if DEBUG_LEVEL >= 1:
print(*args, sep=sep, end=end)
def onscreen_debug(ecran, font, *debug_infos, **kwargs):
if DEBUG_LEVEL >= 2:
... | StarcoderdataPython |
12836936 | <reponame>f4str/neural-networks-sandbox
from .elasticnet_regression import ElasticNetRegression
from .lasso_regression import LassoRegression
from .linear_regression import LinearRegression
from .logistic_regression import LogisticRegression
from .ridge_regression import RidgeRegression
__all__ = [
'ElasticNetRegr... | StarcoderdataPython |
8071572 | <filename>sources/thedailybeast.py
from sources import RSSSource
class Source(RSSSource):
name = 'The Daily Beast'
url = 'https://www.thedailybeast.com/'
feeds = [
('https://feeds.thedailybeast.com/rss/politics', 'politics'),
('https://feeds.thedailybeast.com/rss/us-news', 'us'),
('... | StarcoderdataPython |
3510333 | <reponame>meysam81/SampleCRUD
from http import HTTPStatus
from operator import itemgetter
class TestGetAll:
URL = '/api/v1/books'
def test_other_methods_not_allowed(self, app):
expected_status = HTTPStatus.METHOD_NOT_ALLOWED
for method in ('patch', 'put', 'delete', 'options'):
fu... | StarcoderdataPython |
1724817 | import sys
import logging
import winreg, itertools, glob
from datetime import datetime
import re
from copy import deepcopy
from PyQt5.QtCore import QVariant, pyqtProperty, pyqtSlot, pyqtSignal, QObject
from playhouse.shortcuts import model_to_dict, dict_to_model
from PyQt5.QtQml import QJSValue
from py.common.FramLis... | StarcoderdataPython |
4991864 | """Visualize various data collected from given query session."""
import pdb
import os
import time
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
def save_data(
data: list, labels: list, num_runs: int... | StarcoderdataPython |
4957123 | from scripts.make_test_data import main as make_test_data
from scripts.set_version import main as set_version
| StarcoderdataPython |
5171931 | <gh_stars>1-10
import base64
import csv
import glob
import os
import subprocess
import requests
from typing import List, Any, Optional
from pathlib import Path
def say(text, debug=False):
if debug or True:
print(text)
process = subprocess.Popen(
['say', '-v', 'Samantha', text],
... | StarcoderdataPython |
4934891 | # -*- coding: utf-8 -*-
"""
File name: quad_mdl.py
Author: <NAME>
Created: June 2019
Description: A fault model of a multi-rotor drone.
"""
import numpy as np
from fmdtools.modeldef import *
#Define specialized flows
class Direc(Flow):
def __init__(self):
self.traj=[0,0,0]
super().__init__({'x': se... | StarcoderdataPython |
6648201 | # Generated by Django 3.1.3 on 2020-11-29 20:04
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0021_auto_20201129_1954'),
]
operations = [
migrations.AddField(
model_name='hotel',
name='h... | StarcoderdataPython |
4983436 | <gh_stars>0
from common import *
from trezor.crypto import bip32, bip39
from trezor.utils import HashWriter
from apps.wallet.sign_tx.addresses import validate_full_path, validate_path_for_bitcoin_public_key
from apps.common.paths import HARDENED
from apps.common import coins
from apps.wallet.sign_tx.addresses import *... | StarcoderdataPython |
6425428 | from django.shortcuts import render, redirect
from firstapp.models import Article, Comment, Ticket, UserProfile
from firstapp.forms import CommentForm
from django.core.paginator import Paginator
from django.core.paginator import EmptyPage
from django.core.paginator import PageNotAnInteger
from django.core.exceptions ... | StarcoderdataPython |
4951353 | <reponame>kalaspuff/newshades-api<filename>app/tests/services/test_crud_service.py
from datetime import datetime
import arrow
import pytest
from pymongo.database import Database
from app.models.server import Server, ServerMember
from app.models.user import User
from app.schemas.servers import ServerCreateSchema
from ... | StarcoderdataPython |
16912 | import tkinter as tk
from tkinter import ttk
win = tk.Tk()
win.title("Python GUI")
win.resizable(False, False)
win.configure(background = "grey94")
a_label = ttk.Label(win, text = "Gib Deinen Namen ein:")
a_label.grid(column = 0, row = 0)
a_label.grid_configure(padx = 8, pady = 8)
def clickMe():
action.configure... | StarcoderdataPython |
3427478 | # !/usr/bin/env python
# coding=UTF-8
"""
@Author: <NAME>
@LastEditors: <NAME>
@Description:
@Date: 2021-08-31
@LastEditTime: 2021-11-11
CSV文件日志
"""
import os
import time
import csv
from typing import NoReturn, List, Optional, Any
import pandas as pd
from .base import AttackLogger
from ..attacked_text import Attack... | StarcoderdataPython |
4820737 | try:
import webbrowser, os
import numpy as np
import calendar
import fTools as ft
import cInputOutput as cio
except:
print("ERROR: Could not load numpy.")
def make_flow_duration():
# requires csv file with
# col1 = dates
# col2 = mean daily discharge
station_nam... | StarcoderdataPython |
11234343 | <reponame>best-of-acrv/fcos<gh_stars>1-10
import argparse
import os
import re
import sys
import textwrap
from .fcos import Fcos
from .helpers import config_by_name
class ShowNewlines(argparse.ArgumentDefaultsHelpFormatter,
argparse.RawDescriptionHelpFormatter):
def _fill_text(self, text, widt... | StarcoderdataPython |
9619173 | from django_mailer.tests.commands import TestCommands
from django_mailer.tests.engine import LockTest #COULD DROP THIS TEST
from django_mailer.tests.backend import TestBackend | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.