id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
3246221 | """
WSGI config for FasterRunner project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... | StarcoderdataPython |
33982 | <reponame>hasanisci/gym-dubins-ac<filename>gym-dubins-airplane/gym_dubins_airplane/envs/config.py
import math
class Config:
G = 9.8
EPISODES = 1000
# input dim
window_width = 800 # pixels
window_height = 800 # pixels
window_z = 800 # pixels
diagonal = 800 # this one is u... | StarcoderdataPython |
4800557 | <gh_stars>0
import django_filters
from .models import *
class CourseOrgFilter(django_filters.rest_framework.FilterSet):
class Meta:
model = CourseOrg
fields = ['click_nums','fav_nums','city',]
| StarcoderdataPython |
62611 | <filename>fluid_multirouter.py
"""Routes multiple fluid channels simultaneously."""
import copy
import numpy as np
import lpa_fluid_router as flpa
import random
import lpa_math
import priority_queue as pq
random.seed(1)
class MPA(object):
"""BFS Python implementation."""
def __init__(self, desired_routes, v... | StarcoderdataPython |
143989 | <gh_stars>0
import json
import requests
data = json.dumps({'name':'Aditya'})
res = requests.post('http://127.0.0.1:10001/api', data)
print(res.text)
| StarcoderdataPython |
3288597 | <gh_stars>0
s = input()
if len(s) >= 4:
if s[:4] == "YAKI":
print("Yes")
else:
print("No")
else:
print("No")
| StarcoderdataPython |
18463 | <reponame>bittikettu/JTimer<gh_stars>0
import json
class kilpailija:
def __init__(self,etunimi,sukunimi,puhelinnumero,seura,kilpasarja,bibnumber):
self.etunimi = etunimi
self.sukunimi = sukunimi
self.puhelinnumero = puhelinnumero
self.seura = seura
self.kilpasarja = ki... | StarcoderdataPython |
4830052 | <reponame>yiunsr/suerp
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.ext.asyncio import create_async_engine
from sqlalchemy.orm import sessionmaker
from typing import Any, Dict, List, NoReturn, Optional, Tuple, Type, TypeVar
from fastapi import Request
from . import get_config
config = get_config()
... | StarcoderdataPython |
1799064 | <reponame>rgurevych/python_training_mantis
import string
import random
import re
class ProjectHelper:
def __init__(self, app):
self.app = app
projects_cache = None
def open_projects_page(self):
wd = self.app.wd
if not wd.current_url.endswith("/manage_proj_page.php"):
... | StarcoderdataPython |
3377644 | <reponame>TharlesClaysson/Python-Basico
'''Crie uma função que some dois números e apresente o resultado.
Não use passagen de parâmetro, mas retorne o resultado para então
apresentar'''
def soma():
n1 = float(input('Informe um valor '))
n2 =float(input('Informe outro valor '))
r = n1+n2
return r
def ma... | StarcoderdataPython |
3387203 | import unittest
import pickle
import numpy as np
import mockredis
from mock import patch
from datasketch.lsh import MinHashLSH
from datasketch.minhash import MinHash
from datasketch.weighted_minhash import WeightedMinHashGenerator
def fake_redis(**kwargs):
redis = mockredis.mock_redis_client(**kwargs)
redis.c... | StarcoderdataPython |
51920 | def timeConversion(s):
ampm = s[-2:]
hr = s[:2]
if ampm == 'AM':
return s[:-2] if hr != '12' else '00' + s[2:-2]
return s[:-2] if hr == '12' else str(int(s[:2]) + 12) + s[2:-2]
if __name__ == '__main__':
s1 = '07:05:45PM'
assert timeConversion(s1) == '19:05:45'
s2 = '07:05:45AM'
... | StarcoderdataPython |
85592 | <reponame>tsarnowski/jira-python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
"""
This module implements the Resource classes that translate JSON from JIRA REST resources
into usable objects.
"""
import re
import sys
import logging
import random
import pprint
im... | StarcoderdataPython |
3352938 | # -*- coding: utf-8 -*-
"""A module to fetch stats about security groups."""
from artifact.client import securitygroup
def get_security_groups():
"""Get data about security groups."""
data = securitygroup.get_security_groups()
security_groups = data.get("SecurityGroups")
return security_groups
| StarcoderdataPython |
1737857 | <gh_stars>0
# Autogenerated file. ANY CHANGES WILL BE OVERWRITTEN
from to_python.core.types import FunctionType, \
FunctionArgument, \
FunctionArgumentValues, \
FunctionReturnTypes, \
FunctionSignature, \
FunctionDoc, \
FunctionData, \
CompoundFunctionData
DUMP_PARTIAL = [
CompoundFunct... | StarcoderdataPython |
3397943 | import pandas as pd
import glob
import matplotlib.pyplot as plt
import seaborn as sns
plt.rcParams["figure.dpi"] = 150
# MP2.5
df_mp25 = pd.DataFrame()
for i, file_name in enumerate(sorted(list(glob.glob('../data/*_mp25.csv')), reverse=True)):
temp = pd.read_csv(file_name, usecols=['date', 'name', 'val'])
tem... | StarcoderdataPython |
1612338 | """
A visual class containing multiple axes.
"""
import numpy as np
from vispy.visuals import CompoundVisual, LineVisual, TextVisual
class HyperAxisVisual(CompoundVisual):
def __init__(self, pos, color="black", labels=None):
self.pos = np.zeros((pos.shape[0]*2, 3))
for i in range(pos.shape[0]):
... | StarcoderdataPython |
2927 | """Code for checking and inferring types."""
import collections
import logging
import re
import subprocess
from typing import Any, Dict, Union
from pytype import abstract
from pytype import abstract_utils
from pytype import convert_structural
from pytype import debug
from pytype import function
from pytype import met... | StarcoderdataPython |
50178 | <gh_stars>0
#!usr/bin/env python
# -*- coding: utf-8 -*-
import platform, random, time, logging, logging.handlers
from pymongo import MongoClient
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# 记录程序运行的日志文件设定
logfile = './log/log_util.log'
logfile_size = 5... | StarcoderdataPython |
3342906 | <filename>botair/apps.py
from django.apps import AppConfig
class BotairConfig(AppConfig):
name = 'botair'
| StarcoderdataPython |
1646178 | '''Usage:
import simple
h.run()
simple.show()
Sets up 5 models using default parameters in the .mod files
2 versions of 2003/2004 parameterization: freestanding (3a); in section (3b)
3 versions of 2007/2008 parameterization: freestanding (7a); in section (7b); in sec using wrapper class (7bw)
can graph u, v for any m... | StarcoderdataPython |
34327 | """A module for defining Sensor types.
Classes:
Sensor -- Base Sensor class, all unknown types default to this.
MotionSensor -- Subclass of Sensor, for HC-SR501 type PIR sensors.
ReedSwitch -- Subclass of Sensor, for basic door/window reed switches.
Functions:
build_sensor -- Build & return a ... | StarcoderdataPython |
1700684 | from dataclasses import dataclass
import pytest
from dataslots import DataslotsDescriptor, dataslots, DataDescriptor
class PositiveIntegerDS(DataslotsDescriptor):
def __get__(self, instance, owner):
return self.get_value(instance)
def __set__(self, instance, value):
if value < 0:
... | StarcoderdataPython |
3272080 | <gh_stars>1-10
import math
import tensorflow as tf
from ad import conn
def weights_var(n1, n2, k):
"""
Returns a TensorFlow variable for weights.
https://www.tensorflow.org/api_docs/python/tf/truncated_normal
"""
assert k == 1
# TODO: Use
# tf.truncated_normal([n1, n2, k], stddev=1.0 / ... | StarcoderdataPython |
1612477 | """Helper functions for the Taylor-Green vortices application."""
import numpy
def taylor_green_vortex(x, y, t, nu):
"""Return the solution of the Taylor-Green vortex at given time.
Parameters
----------
x : numpy.ndarray
Gridline locations in the x direction as a 1D array of floats.
y :... | StarcoderdataPython |
1645734 | <filename>code/sentencizer.py
from spacy.lang.en import English
from spacy.pipeline.sentencizer import Sentencizer
import numpy as np
class Sent(Sentencizer):
pass
def predict(self, docs):
"""Apply the pipe to a batch of docs, without modifying them.
docs (Iterable[Doc]): The documents t... | StarcoderdataPython |
3336959 | <reponame>ruthra-kumar/accounting
# Copyright (c) 2021, ruthra and contributors
# For license information, please see license.txt
import frappe
from frappe.utils.nestedset import NestedSet
class Accounts(NestedSet):
pass
| StarcoderdataPython |
59224 | import os
import sys
import json
import datetime
import numpy as np
import skimage.draw
from mrcnn.visualize import display_images
import mrcnn.model as modellib
from mrcnn.model import log
from config.fashion_config import FashionConfig
from config.dataset import FashionDataset
# Path to trained weights file
COCO_W... | StarcoderdataPython |
154857 | <reponame>CookiePPP/wavegrad
# Copyright 2020 LMNT, Inc. All Rights Reserved.
#
# 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 req... | StarcoderdataPython |
24128 | <reponame>aheadley/pynemap
#!/usr/bin/python
import numpy
class Color(object):
lower_bound = 0
upper_bound = 255
def __init__(self, r, g, b, a):
self.r = r
self.g = g
self.b = b
self.a = a
def __str__(self):
return '(%s, %s, %s, %s)' % (self.r, self.g, self.b, self.a)
def composite_pixels(src, dest):
... | StarcoderdataPython |
1716438 | <filename>week1/1.10 if/step05.py
def get_sleep_status(min_hours, max_hours, sleep_hours):
status = ''
if min_hours <= sleep_hours <= max_hours:
status = 'Это нормально'
elif sleep_hours < min_hours:
status = 'Недосып'
elif sleep_hours > max_hours:
status = 'Пересып'
return... | StarcoderdataPython |
1618827 | from torch.optim import Adam, SGD, AdamW
import torch
from torch.optim.lr_scheduler import OneCycleLR
import numpy as np
import os
import time
from torch.utils.data import DataLoader
from dataset.vocab import Vocab
from dataset.add_noise import SynthesizeData
from params import *
from models.seq2seq import Seq2Seq
from... | StarcoderdataPython |
167543 | <gh_stars>10-100
"""pytest tests for mytoyota.client.MyT"""
import asyncio
import json
import os.path
import re
from typing import Optional, Union
import pytest # pylint: disable=import-error
from mytoyota.client import MyT
from mytoyota.exceptions import (
ToyotaInternalError,
ToyotaInvalidUsername,
To... | StarcoderdataPython |
154383 | """
@file
@brief This extension contains various functionalities to help unittesting.
"""
import os
import sys
import glob
import re
import unittest
import warnings
from io import StringIO
from .utils_tests_stringio import StringIOAndFile
from .default_filter_warning import default_filter_warning
from ..filehelper.sync... | StarcoderdataPython |
1602024 | <reponame>carolinaferraz/itc172<filename>py-env/techreviewproj/techapp/views.py
from django.shortcuts import render,get_object_or_404
from .models import ProductType, Product, Review
from .forms import ProductForm, ReviewForm
from django.contrib.auth.decorators import login_required
# Create your views here.
def inde... | StarcoderdataPython |
1624694 | #!/usr/bin/env python3
import json
import logging
import random
import datetime
from dateutil.parser import parse
import asyncio
import discord
import tbapy
from discord.ext import commands
from orator import Model, DatabaseManager, Schema, SoftDeletes
from orator.orm import has_many, belongs_to
# Set up automatic m... | StarcoderdataPython |
1667966 | def match(command, settings):
return ('permission denied' in command.stderr.lower()
or 'EACCES' in command.stderr)
def get_new_command(command, settings):
return 'sudo {}'.format(command.script)
| StarcoderdataPython |
4812028 | import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, DataLoader
# from sklearn.preprocessing import StandardScaler
from utils.tools import StandardScaler
from utils.timefeatures import time_features
import warnings
warnings.filterwarnings('ignore')
class Dataset_ETT_ho... | StarcoderdataPython |
141574 | <gh_stars>0
"""Verify that minimum type coverage is reached."""
from pathlib import Path
import argparse
import sys
def main(argv=sys.argv) -> None: # pragma: no cover
"""Run type coverage check."""
parser = argparse.ArgumentParser(
usage=("python type_coverage.py coverage=80 file=typecov/linecount... | StarcoderdataPython |
1748234 | import os.path
import json
import re
import numpy as np
from nltk import word_tokenize
from .audio_tools import Sound
def _path(relpath):
"""
Returns an absolute path for the given path (which is relative to the root directory ml_subtitle_align)
"""
parent = os.path.join(os.path.dirname(__file__), "..")
return os... | StarcoderdataPython |
3352041 | # Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import absolute... | StarcoderdataPython |
1617174 | # Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | StarcoderdataPython |
3356000 | <reponame>chiffa/BioFlow<gh_stars>1-10
"""
Possible backends for the sample storage
""" | StarcoderdataPython |
3205124 | <reponame>kylejbrown17/AirSim-NeurIPS2019-Drone-Racing<gh_stars>0
from baseline_racer import BaselineRacer
from utils import to_airsim_vector, to_airsim_vectors
import airsimneurips as airsim
import threading
import argparse
import numpy as np
import time
# Use non interactive matplotlib backend
# import matplotlib
# m... | StarcoderdataPython |
3260173 | <reponame>giuseppechecchia/miinto-api-wrapper
import requests
import json
import hashlib
import hmac
import time
from datetime import datetime
from datetime import timedelta
from random import seed
from random import randint
from random import random
from urllib.parse import urlparse
class MiintoApi:
def __in... | StarcoderdataPython |
3312374 | __all__ = ['get_statsd_client']
import statsd
import carpy
statsd_client_singleton = None
class StatsDConfigError(AttributeError):
pass
def _init_statsd_client():
statsd_host = carpy.config.get('STATSD_HOST')
if not statsd_host:
raise StatsDConfigError('Missing STATSD_HOST config')
statsd_port = carpy.co... | StarcoderdataPython |
41108 | <filename>etc/ChokudaiSpeedrun002/f.py<gh_stars>1-10
N = int(input())
A, B = (
zip(*(map(int, input().split()) for _ in range(N))) if N else
((), ())
)
ans = len({(min(a, b), max(a, b)) for a, b in zip(A, B)})
print(ans)
| StarcoderdataPython |
155277 | <filename>scripts/addons/leomoon-lightstudio/light_operators.py
import bpy
from bpy.props import BoolProperty, PointerProperty, FloatProperty, CollectionProperty, IntProperty, StringProperty
from . light_profiles import ListItem, update_list_index
from . common import *
import os
from . import operators
_ = os.sep
fr... | StarcoderdataPython |
1719740 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from thecut.publishing.querysets import PublishableResourceQuerySet
class MenuItemQuerySet(PublishableResourceQuerySet):
"""Customised :py:class:`~django.db.models.db.query.QuerySet` for
:py:class:`~thecut.menus.models.MenuItem` ... | StarcoderdataPython |
3213854 | <filename>python/testData/override/importsForTypeAnnotations3_import.py
class Param:
pass
class Return:
pass
class Foo:
def func(self, arg: Param) -> Return:
pass
| StarcoderdataPython |
1769457 | # Copyright (c) Megvii, Inc. and its affiliates.
configs = {
# ------------ Basic Configuration ------------
"batch_size": 64,
"input_size": [112, 112],
# ------------ Training Configuration ------------
"learning_rate": 0.1 / 8,
"momentum": 0.9,
"weight_decay": 5e-4,
# ------------ IO ... | StarcoderdataPython |
1148 | description = 'PGAA setup with XYZOmega sample table'
group = 'basic'
sysconfig = dict(
datasinks = ['mcasink', 'chnsink', 'csvsink', 'livesink']
)
includes = [
'system',
'reactor',
'nl4b',
'pressure',
'sampletable',
'pilz',
'detector',
'collimation',
]
devices = dict(
mcasin... | StarcoderdataPython |
3290500 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2004-2010 <NAME> <<EMAIL>>
# All Rights Reserved.
# Simplified BSD License (see LICENSE.txt for full text)
"""\
Test File generator.
This tool generates a hex file, of given size, ending on address
0xffff if no start address is given.
USAGE: generate.py... | StarcoderdataPython |
3264279 | a = 6
a += 7 | StarcoderdataPython |
3378114 | <reponame>fangzhouwang/-CADisCMOSExplorer<gh_stars>0
import unittest
from ArkLibPy.ArkDBMySQL import *
from Resistive_defect import ResistiveDefect
class ResistiveDefectTestCase(unittest.TestCase):
def setUp(self):
self.db_ = ArkDBMySQL(db_config_file='/Users/Ark/.db_configs/db_config_local_cadis.txt')
... | StarcoderdataPython |
4802323 | <filename>python/add_next_file.py
import os
if __name__ == '__main__':
c_lecture_order = [
5, 6, 19, 21, 7, 8, 9, 10, 12, 14, 16, 17, 18, 20, 23, 24, 25, 26, 27, 28,
30, 31, 29, 32, 33, 43, 55, 60, 71, 83, 87, 88, 89, 98, 100, 99, 103, 117,
123, 125, 129, 130
]
cpp_lecture_order = [
134, ... | StarcoderdataPython |
1768813 | from __future__ import absolute_import
import responses
import pytest
from sentry.auth.exceptions import IdentityNotValid
from sentry.models import Identity
from sentry.utils import json
from .testutils import GitLabTestCase
class GitlabRefreshAuthTest(GitLabTestCase):
get_user_should_succeed = True
def set... | StarcoderdataPython |
1723711 | from .abs_state import AbsState
class Waiting(AbsState):
def check(self):
m = self._model
m.logger.info('Checking for new round')
if (m.napi.check_new_round()
or m.test):
m.logger.info('New round available')
self._model.state = self._model.getting_data
... | StarcoderdataPython |
1620176 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-06 15:03
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | StarcoderdataPython |
1792526 | from talon import Module
mod = Module()
@mod.action_class
class Actions:
def action1():
"""prints hi"""
print('hi')
def action2(name: str, number: int):
"""prints a name and number"""
print(name, number)
# in a .talon file now you can user.action1() or user.action2("name", 5)
| StarcoderdataPython |
3235867 | # encoding': UTF-8
class Algo01:
# 128 numbers
my_list = [14, 7, 35, 48, 7, 27, 53, 97, 89, 11, 47, 86, 26, 58, 53, 36, 47, 17, 15, 54, 59, 80, 71, 55, 25, 30, 12,
63, 84, 88, 95, 54, 38, 96, 96, 83, 93, 100, 26, 24, 87, 88, 81, 26, 48, 96, 59, 65, 68, 9, 43, 38, 77,
97, 5, 36, ... | StarcoderdataPython |
125825 | # Various functions and methods for preprocessing/metric measurement/plotting etc...
import numpy as np
import matplotlib.pyplot as plt
########################################################################################################################
# Metrics ###################################################... | StarcoderdataPython |
1739036 | import uuid
import torch
import argparse
import matplotlib
import numpy as np
import pandas as pd
matplotlib.use('Agg')
import seaborn as sns
from pathlib import Path
import matplotlib.pyplot as plt
from external_libs.hessian_eigenthings import compute_hessian_eigenthings
TRIAL_ID = uuid.uuid4().hex.upper()[0:6]
EXPE... | StarcoderdataPython |
1656925 | from brainslug.database import AsyncTinyDB
from brainslug.remote import Remote
#: Global application state
AGENT_INFO = AsyncTinyDB()
def get_resources(loop, store, spec):
resources = dict()
for name, query in spec.items():
found = store.search(query)
if found:
# TODO: Implement ... | StarcoderdataPython |
1716878 | # Generated by Django 4.0.4 on 2022-05-27 11:56
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Callback',
fields=[
('id', models.BigAutoFi... | StarcoderdataPython |
45367 | <filename>src/spaceone/inventory/error/custom.py
from spaceone.core.error import ERROR_BASE
class ERROR_REPOSITORY_BACKEND(ERROR_BASE):
status_code = 'INTERNAL'
message = 'Repository backend has problem. ({host})'
class ERROR_DRIVER(ERROR_BASE):
status_code = 'INTERNAL'
message = '{message}'
class... | StarcoderdataPython |
3294318 | '''
Андрей честно выполнил домашнее задание и учитель озвучил ему оценку. В качестве оценки учитель назвал Андрею одно из слов: "Отлично", "Хорошо", "Удовлетворительно" или "Неудовлетворительно". Помогите Андрею понять, какая цифра появится в его дневнике.
Формат входных данных
Строка, содержащая оценку Андрея в слов... | StarcoderdataPython |
1658382 | <reponame>prayogateguh/diramadan
import logging
from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import UserCreationForm as DjangoUserCreationForm
from django.contrib.auth.forms import UsernameField
from django.core.mail import send_mail
from . import models
logger... | StarcoderdataPython |
40255 | import setuptools
setuptools.setup(
name="image-quality-assessment",
version="0.0.1",
author="gdp",
author_email="<EMAIL>",
description="TBD",
long_description_content_type="text/markdown",
url="https://github.com/getyourguide/image-quality-assessment",
packages=setuptools.find_package... | StarcoderdataPython |
187140 | <reponame>knuu/competitive-programming
a = [int(x) for x in input().split()]
aset = set()
for i in range(5):
for j in range(i+1, 5):
for k in range(j+1, 5):
aset.add(a[i] + a[j] + a[k])
print(sorted(aset, reverse=True)[2])
| StarcoderdataPython |
53588 | __version__ = "0.6.2"
default_app_config = 'rest_registration.apps.RestRegistrationConfig'
| StarcoderdataPython |
39849 | <reponame>MasterKale/py_webauthn<filename>webauthn/helpers/parse_client_data_json.py
import json
from json.decoder import JSONDecodeError
from .base64url_to_bytes import base64url_to_bytes
from .exceptions import InvalidClientDataJSONStructure
from .structs import CollectedClientData, TokenBinding
def parse_client_d... | StarcoderdataPython |
3240410 | epochs=20
autoencoder.fit(x_train, x_train,
epochs=20,
shuffle=True,
validation_data=(x_test, x_test)) | StarcoderdataPython |
1702389 | import sys
import numpy as np
from plyfile import PlyData
from matplotlib import pyplot as plt
from tomasi_kanade import TomasiKanade
from visualization import plot3d, plot_result
import rigid_motion
def read_object(filename):
"""Read a 3D object from a PLY file"""
ply = PlyData.read(filename)
vertex... | StarcoderdataPython |
177613 | # Generated by Django 2.1 on 2019-07-12 00:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0009_document_color'),
]
operations = [
migrations.AlterField(
model_name='document',
name='color',
... | StarcoderdataPython |
103103 | <reponame>hanasuke/eclcli
from eclcli.common import command, utils
class ListServer(command.Lister):
def get_parser(self, prog_name):
parser = super(ListServer, self).get_parser(prog_name)
parser.add_argument(
"--detail",
help="Detailed view of server list",
a... | StarcoderdataPython |
3374698 | <gh_stars>0
# coding: utf-8
# In[ ]:
import numpy as np
# In[ ]:
#
# def accumulation_dt60_for48h(df):
# #### connect two days together to calculate the accumulation within 48hours #########
# acc48 = []
# for i in range(0,(np.asarray(df).shape[1]-1)):
# df1 = np.asarray(df)[:,i]
# df2 = ... | StarcoderdataPython |
1659897 | '''
Menus in the IM window.
'''
import traceback
import wx
from common import pref
import gui.toolbox
from gui import clipboard
# Create all the menu items for each button in the capabilities bar.
buttons = [('info', _('Buddy Info')),
('im', _('Send IM')),
('files', _('Send File')),... | StarcoderdataPython |
90497 | from sympy import *
from algebreb.expresiones.polinomios import Polinomio
class UnOperando():
def __init__(self, op1):
self.oper = ''
self.op1 = op1
self.res = self.operacion()
self.respuestas = []
self.pasos = {}
self.enunciado = ''
def set_op1(self, op1):
... | StarcoderdataPython |
1619481 | <reponame>alvinchchen/cyclonedx-buildroot
# This file is part of CycloneDX Python module.
#
# 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
#
... | StarcoderdataPython |
1683117 | <gh_stars>0
from flask import Blueprint, Response, request, jsonify, current_app
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from .db import engine
import bcrypt
import jwt
import sys
# Create blueprint to register routes
bp = Blueprint('auth', __name__, url_prefix='/auth'... | StarcoderdataPython |
8199 | <reponame>revbucket/LipSDP
import argparse
import numpy as np
import matlab.engine
from scipy.io import savemat
import os
from time import time
def main(args):
start_time = time()
eng = matlab.engine.start_matlab()
eng.addpath(os.path.join(file_dir, 'matlab_engine'))
eng.addpath(os.path.join(file_dir,... | StarcoderdataPython |
89230 | <reponame>hdmillerdr/stackdio<filename>stackdio/api/volumes/migrations/0004_0_8_0_migrations.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-08 18:19
from __future__ import unicode_literals
import django.db.models.deletion
import django_extensions.db.fields
from django.db import migrati... | StarcoderdataPython |
1636250 | #!/usr/bin/env python
from __future__ import absolute_import
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('sharpclaw', parent_package, top_path)
config.add_extension('sharpclaw1',
['ClawParams.f90','... | StarcoderdataPython |
1775551 | from jinja2 import Environment, FileSystemLoader, Template
from hamlish_jinja import HamlishExtension
class EngineHaml(object):
def __init__(self, template_dirs, extensions=None):
self.template_dirs = template_dirs
env_params = dict(
loader=FileSystemLoader(template_dirs),
... | StarcoderdataPython |
60008 | """ Tuple"""
names = ("rogers","Joan", "Doreen", "Liz", "Peter" )
print(names)
string_tuple = " ".join(str(name) for name in names)
print(string_tuple) | StarcoderdataPython |
123598 | """Some examples of simple plots."""
import matplotlib.pyplot as plt
from tailored import get_data
db = get_data()
## A simple heatmap of the sea surface temperature
db.load(time=0)
fig, ax = plt.subplots()
im = db.imshow(ax, 'SST', time_idx=0)
im.add_colorbar()
im.set_labels()
## We loop over time to create... | StarcoderdataPython |
1699033 | <gh_stars>0
import pandas as pd
import numpy as np
import random
import csv
import pprint
import datamake
#df_collist =[['第二段階指定1科類', '第二段階指定1枠数', '指定1残席', '指定1底点', '指定1点数', '指定1学籍番号'], ['第二段階指定2科類', '第二段階指定2枠数', '指定2残席', '指定2底点', '指定2点数', '指定2学籍番号'], ['第二段階指定3科類', '第二段階指定3枠数', '指定3残席', '指定3底点', '指定3点数', '指定3学籍番号'], [... | StarcoderdataPython |
3337559 | <gh_stars>0
from client.util.HTMLUtil import HTMLUtil
from client.util.html.tooling.ButtonElement import ButtonElement
class ButtonBuilder:
def __init__(self, text='', button_id='', attrs=None):
if attrs is None:
attrs = {}
self._button = ButtonElement(text=text, button_id=button_id)
... | StarcoderdataPython |
1795258 | <reponame>dewloosh/dewloosh-geom
# -*- coding: utf-8 -*-
import numpy as np
from numpy import ndarray
from numba import njit, prange
__cache = True
@njit(nogil=True, parallel=True, cache=__cache)
def extrude_T3_TET4(points: ndarray, triangles: ndarray,
h: float=1.0, zres: int=1):
nT = triang... | StarcoderdataPython |
1754091 | <reponame>Domengradisek/Analiza_podatkov
import re
with open('Podatki_o_igralcih.html', encoding='utf-8') as f:
vsebina = f.read()
vzorec = (
r'<tr data-playerid="(?P<id>\d*?)">' # zajamemo ID igralca
r'<td><figure class="player"><a href=".*?" '
r'title="(?P<ime_in_priiimek>.*?) FIFA 21" class="link-p... | StarcoderdataPython |
3374207 | <reponame>olcostafilipe/cracking_the_coding<filename>chapter02/question_04.py
"""
Question 04: Partition
Write code to partition a linked list around a value x, such that all nodes less
than x come before all nodes greater than or equal to x. If x is contained
within the list, the values of x only need to be after the... | StarcoderdataPython |
3252462 | import abc
import warnings
import gym
import numpy as np
from scipy.spatial.ckdtree import cKDTree
from gym_guppy.guppies import Agent, Guppy, GlobalTargetRobot
from gym_guppy.tools import Feedback
from gym_guppy.tools.math import is_point_left, normalize, rotation
class AdaptiveAgent(GlobalTargetRobot):
def ac... | StarcoderdataPython |
1626459 | <filename>resource/dataset/LIVE.py
dataset_name = 'LIVE'
yuv_fmt = 'yuv420p'
width = 1920
height = 1080
ref_dir = '/Volumes/External hard driveByron/老婆/LIVE/ref'
dis_dir = '/Volumes/External hard driveByron/老婆/LIVE/dis'
obj_dir = '/Volumes/External hard driveByron/老婆/LIVE/obj'
ref_videos = [
{'content_id': 0,
'con... | StarcoderdataPython |
1694480 | from flask_restx import Namespace
api_v2 = Namespace('Scholix Version 3.0 ', title='Scholexplorer API 2.0', description="scholexplorer API version 2.0")
| StarcoderdataPython |
3245846 | from typing import List
import numpy as np
import pandas as pd
from feature_engine.outliers import Winsorizer, OutlierTrimmer
# --------------------------------------
# ±3σを最大値/最小値として外れた値を修正
# --------------------------------------
def censor_outliers(
df: pd.DataFrame,
num_col_names: List
) -> None:
... | StarcoderdataPython |
187694 | <gh_stars>0
from computerwords.library import Library
from .basics import add_basics
from .html import add_html
from .links import add_links
from .table_of_contents import add_table_of_contents
stdlib = Library()
add_basics(stdlib)
add_html(stdlib)
add_links(stdlib)
add_table_of_contents(stdlib)
| StarcoderdataPython |
4816367 | <reponame>sondregronas/GeForceStream-HA
"""Sensor platform for Moonlight."""
from homeassistant.helpers.entity import Entity
from .const import (
DOMAIN,
DOMAIN_DATA,
CONF_NAME,
CONF_HOST,
CONF_ICON,
CONF_ICON_ACTIVE,
)
async def async_setup_platform(
hass, config, async_add_entities, discovery_inf... | StarcoderdataPython |
3290242 | <reponame>nuo010/pyefun
import wx
from .wxControl import *
组件名称 = "选择夹"
组件创建代码 = """wx.选择夹(self.容器, size=({宽度}, {高度}), pos=({左边}, {顶边}), style=wx.NB_FIXEDWIDTH)"""
界面设计器使用占位符创建 = True
class 选择夹(wx.Notebook, 公用方法):
pass
| StarcoderdataPython |
1970 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.