id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
1775226 | <filename>Jan2019/DataTypesDemo/TuplesDemo.py
# ----------------------------------
class DataTypesDemo:
Instances = 0
def __init__(self, tupleObject):
self.tupleObject = tupleObject
DataTypesDemo.Instances += 1
def displayDetails(self):
print("----- DataTypesDemo Details -----")
... | StarcoderdataPython |
3357046 | <gh_stars>1-10
import torch
import cv2
import numpy as np
from core.inference import Inference
from core.yolo_v4 import YOLOv4
from configuration import Config
from utils.visualization import draw_boxes_on_image
def detect_one_picture(model, picture_dir, device):
inference = Inference(picture_dir, device)
wi... | StarcoderdataPython |
3268728 | # -*- coding:utf-8 -*-
"""
File Name: model.py
Description: model definition
Author: steven.yi
date: 2019/04/17
"""
from keras.models import Model
from keras.layers import Conv2D, MaxPooling2D, Input, Concatenate, Dropout
def MCNN(input_shape=None):
inputs = Input(shape=input_sha... | StarcoderdataPython |
1653183 | import logging
from programy.clients.clients import BotClient
class ConsoleBotClient(BotClient):
def __init__(self):
BotClient.__init__(self)
self.clientid = "Console"
def set_environment(self):
self.bot.brain.predicates.pairs.append(["env", "Console"])
def run(self):
if... | StarcoderdataPython |
3208868 | # class that is used to get the audiostream from Loomo
# for further use, the input gets played via connected speakers
# requires setup of the microphone with pulseaudio, so that the output get's redirected to it
# recommended to connect something to the aux output of the device, otherwise loopback input will be create... | StarcoderdataPython |
3238468 | def __read_lst(dat):
"""
lst形式のデータ(文字列)の内容を読み込む
"""
dat_list = dat.split('\t')
index = int(dat_list[0])
header_size = int(dat_list[1])
assert header_size == 2, 'header_sizeは2を想定:'+str(header_size)
label_width = int(dat_list[2])
assert label_width == 5, 'label_widthは5を想定: '+str(labe... | StarcoderdataPython |
64602 | # users/forms.py
# Django modules
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
class RegisterForm(UserCreationForm):
username = forms.CharField(max_length=50)
email = forms.EmailField(max_length=50)
password1 = forms.CharField(... | StarcoderdataPython |
37705 | <gh_stars>0
"""
This tutorial shows how to download and render neurons from the MouseLight project
using the MouseLightAPI class.
You can also download data manually from the neuronbrowser website and render them by
passing the downloaded files to `scene.add_neurons`.
"""
import brainrender
brainrende... | StarcoderdataPython |
1728186 | from flask import Blueprint, render_template
error = Blueprint("error", __name__)
@error.app_errorhandler(403)
def error_403(error):
return render_template("error/404.html"), 403
@error.app_errorhandler(404)
def error_404(error):
return render_template("error/404.html"), 404
@error.app_errorhandler(500)
... | StarcoderdataPython |
1605162 | <reponame>CrispyHarder/deep-weight-prior<gh_stars>0
import os
import torch
from models.tvae.grouper import Chi_Squared_from_Gaussian_2d
import torchvision
class TVAE(torch.nn.Module):
def __init__(self, z_encoder, u_encoder, decoder, grouper):
super(TVAE, self).__init__()
self.z_encoder = z... | StarcoderdataPython |
176877 | <reponame>rendinam/crds
"""This module defines replacement functionality for the CDBS "certify" program
used to check parameter values in .fits reference files. It verifies that FITS
files define required parameters and that they have legal values.
"""
from crds.core import log, utils
from . import core as core_valid... | StarcoderdataPython |
4810146 | <filename>fpga/test_separable_conv2d.py<gh_stars>0
import tensorflow as tf
import sys
sys.path.append('../../../src')
import processMif as mif
#in_x=np.reshape(np.array(x).transpose(),[1,size,size,1])
img1 = tf.constant(value=[[[[1],[2],[3],[4]],[[1],[2],[3],[4]],[[1],[2],[3],[4]],[[1],[2],[3],[4]]]],dtype=tf.float32... | StarcoderdataPython |
3274856 | from __future__ import print_function
from subprocess import Popen, PIPE
import os
import sys
import shlex
def run_cmd(cmd, verbose=False):
if verbose:
print("Executing :",cmd)
p = Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE)
o,e = p.communicate()
return o,e
if sys.platform == "darwin":
... | StarcoderdataPython |
1617527 | <filename>mtnlpmodel/__init__.py
__version__ = "0.9.1"
# for custom keras object auto discover
from seq2annotation import tf_contrib
import mtnlpmodel | StarcoderdataPython |
52700 | <reponame>chenjian158978/chenjian.github.io
# -*- coding:utf8 -*-
"""
@author: <EMAIL>
@date: Tue, May 23 2017
@time: 19:05:20 GMT+8
"""
import matplotlib.pyplot as plt
import numpy as np
# 都转换成列向量
X = np.array([[0, 1, 2, 4]]).T
Y = np.array([[0, 1, 2, 4]]).T
# 三个不同的theta_1值
theta1 = np.array([[0, 0]]).T
theta2 = ... | StarcoderdataPython |
127321 | <reponame>michielkauwatjoe/Meta
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# https://github.com/michielkauwatjoe/Meta
class CubicBezier:
def __init__(self, bezierId=None, points=None, parent=None, isClosed=False):
u"""
Stores points of the cubic Bézier curve.
"""
self.bezierId... | StarcoderdataPython |
1605590 | <gh_stars>0
from .corrcal import *
| StarcoderdataPython |
3334086 | from lexical.greibach_converter import greibach_converter
from lexical.alpha_to_var import alpha_to_var
from lexical.useless_variable_terminator import useless_variable_terminator
from lexical.unitary_rule_terminator import unitary_rule_terminator
from lexical.lambda_terminator import lambda_terminator
from structure.t... | StarcoderdataPython |
187740 | <filename>tests/utils/test_compare.py
import pytest
from copy import deepcopy
from varg.utils.compare import Comparison
def test_basic(truth_set_path, vcf_record, compare_fields):
# Given an two cyvcf2 records, vcf keys to be compared and a sample to sample
# index map
record_1 = vcf_record(truth_set_pa... | StarcoderdataPython |
48405 | from django.shortcuts import render, redirect
from django.views import View
from django import http
import re
from .models import User
from django.contrib.auth import login
from meiduo_mall.utils.response_code import RETCODE
class RegisterView(View):
"""用户注册"""
def get(self, request):
return render... | StarcoderdataPython |
3289943 | <reponame>aditya-agrawal-30502/vformer
class BaseTrainer: # pragma: no cover
pass
| StarcoderdataPython |
84218 | <reponame>yc19890920/Learn
#!/usr/bin/python
#coding=utf8
__author__ = 'leo'
| StarcoderdataPython |
3276188 | <reponame>sbraz/txamqp
#
# 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
# ... | StarcoderdataPython |
1797336 | <reponame>Random1992/irspack
import warnings
from typing import List, Type
from ..optimizers.base_optimizer import BaseOptimizer, BaseOptimizerWithEarlyStopping
from ..parameter_tuning import (
CategoricalSuggestion,
IntegerSuggestion,
LogUniformSuggestion,
Suggestion,
UniformSuggestion,
)
from ..r... | StarcoderdataPython |
3379364 | from django.db import models
import datetime as dt
from django.contrib.auth.models import User, AbstractUser
from django.core.validators import MaxValueValidator,MinValueValidator
from django.db.models.signals import post_save
from django.db.models import Q
class School(models.Model):
user = models.OneToOneFiel... | StarcoderdataPython |
1631129 | <filename>DataStructuresInPython/queue/Queue.py
'''
Created on Jun 4, 2018
@author: nishant.sethi
'''
class Queue:
def __init__(self):
self.queue = list()
# Insert method to add element
def addtoq(self,dataval):
if dataval not in self.queue:
self.queue.insert(0,da... | StarcoderdataPython |
121898 | <reponame>semanticinsight/yetl-framework
from abc import ABC, abstractmethod
class DataSet(ABC):
pass
| StarcoderdataPython |
177928 | import datetime
import random
import statistics
from typing import Dict, List, Any, Union, Set, Tuple
import sys
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from app import db
from werkzeug.security import generate_password_hash, check_password_hash
from time import time
from flask import cur... | StarcoderdataPython |
4830216 | import unittest
import os
from test.aiml_tests.client import TestClient
from programy.config.sections.brain.file import BrainFileConfiguration
class BasicTestClient(TestClient):
def __init__(self):
TestClient.__init__(self)
def load_configuration(self, arguments):
super(BasicTestClient, self)... | StarcoderdataPython |
3308993 | <reponame>tylerbenson/integrations-core
# (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
from datadog_checks.utils.common import get_docker_hostname
HERE = os.path.dirname(os.path.abspath(__file__))
# Networking
HOST = get_docker_hostname()
PORT = '... | StarcoderdataPython |
1787556 | <filename>utils/logging.py
import logging
import os
import sys
def init_logger(log_path, log_file, print_log=True, level=logging.INFO):
if not os.path.isdir(log_path):
os.makedirs(log_path)
fileHandler = logging.FileHandler("{0}/{1}.log".format(log_path, log_file))
handlers = [fileHandler]
... | StarcoderdataPython |
74022 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import numpy.linalg as la
bear_black = (0.141, 0.11, 0.11)
bear_white = (0.89, 0.856, 0.856)
magenta = (0xfc / 255, 0x75 / 255, 0xdb / 255) # Brighter magenta
orange = (218 / 255, 171 / 255, 115 / 255)
green = (175 / 255, 219 ... | StarcoderdataPython |
194378 | from symcollab.theories.listing import Listing
from symcollab.theories.nat import Nat
# Empty list is of length 0
result = Listing.simplify(
Listing.length(Listing.nil)
)
print("length(nil) is", result, flush=True)
assert result == Nat.zero
# Tail of three element is
result = Listing.simplify(
Listing.cons(Na... | StarcoderdataPython |
1750168 | # -*- coding: utf-8 -*-
"""
:copyright: (c) 2015-2017 by <NAME>
:license: CC0 1.0 Universal, see LICENSE for more details.
"""
from tenki import create_app
class TestConfig:
def test_dev_config(self):
"""Test if the development config loads correctly
"""
app = create_app('tenki.settings.D... | StarcoderdataPython |
3239545 | <gh_stars>10-100
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent.parent))
import datetime
from robotidy.version import __version__
project = 'Robotidy'
copyright = f'{datetime.datetime.now().year}, <NAME>'
author = '<NAME>'
release = __version__
version = __version__
master_doc =... | StarcoderdataPython |
3212660 | <reponame>wzy9607/Anno1800CalculatorDataParser
# coding:utf-8
import bs4
from data_parser.template import ProductFilter
def parse_product_filters(tags: bs4.Tag, assets_map: dict) -> list:
product_filters = []
for tag in tags:
if tag.Template.string == "ItemFilter":
continue
... | StarcoderdataPython |
4800204 | class BinaryTreeNode:
def __init__(self, value, left=None, right=None):
self.value = value
self.left = left
self.right = right
def insertleft(self, left):
self.left = left
def insertright(self, right):
self.right = right
def preOrder(self):
yield self.value
if self.left is not None:
yield from s... | StarcoderdataPython |
1743705 | # 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.
def memoize(fn):
'''Decorates |fn| to memoize.
'''
memory = {}
def impl(*args, **optargs):
full_args = args + tuple(optargs.iteritems())
if f... | StarcoderdataPython |
1744696 | <filename>neodroidagent/utilities/exploration/sampling/random_process/random_process.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from abc import ABC
__author__ = "<NAME>"
__all__ = ["RandomProcess"]
class RandomProcess(ABC):
def __init__(self, **kwargs):
pass
def reset(self):
raise Not... | StarcoderdataPython |
74326 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-17 13:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('munigeo', '0003_add_modified_time_to_address_and_street'),
('stories'... | StarcoderdataPython |
3346933 | <filename>zvt/recorders/baostock/quotes/bao_china_stock_kdata_recorder.py
# -*- coding: utf-8 -*-
import argparse
import pandas as pd
from zvt import init_log, zvt_config
from zvt.api.data_type import Region, Provider, EntityType
from zvt.api.quote import get_kdata, get_kdata_schema
from zvt.domain import Stock, Stoc... | StarcoderdataPython |
3224953 | from math import cos, sin
n, w = map(int, input().split())
sushi = [tuple(map(int, input().split())) for _ in range(n)]
def solve(t, sushi):
for x, y, r, v, a in sushi:
| StarcoderdataPython |
1756276 | import asyncio
import logging
from aiogram import Bot, types
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import Dispatcher
from aiogram.utils import exceptions, executor
from aiogram.utils.markdown import text
import config
from medicines import Medicines
loop = asyncio.get_e... | StarcoderdataPython |
170962 | import asyncio
import time
from collections import defaultdict
from models.proxy import Proxy
class Saver(object):
RESULT_SAVE_NUM = 100
pattern_lock_map = defaultdict(asyncio.Lock)
success_count = 0
total_count = 0
def __init__(self, redis):
self.redis = redis
async def _save(self,... | StarcoderdataPython |
3436 | <reponame>andreakropp/datarobot-user-models
#!/usr/bin/env python
# coding: utf-8
# pylint: disable-all
from __future__ import absolute_import
from sklearn.preprocessing import LabelEncoder
from pathlib import Path
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.optim as optim
cl... | StarcoderdataPython |
3256012 | <reponame>ChriPiv/stinespring-algo-paper
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or deriv... | StarcoderdataPython |
1770736 | <reponame>peihaowang/nerf-pytorch
import os, sys
import math, random, time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import imageio
import lpips
import utils.ssim as ssim_utils
lpips_alex = lpips.LPIPS(net='alex') # best forward scores
lpips_vgg = lpips.LPIPS(net='vgg') ... | StarcoderdataPython |
4801593 | import time
import pytest
import gevent
from eth_utils import int_to_big_endian, keccak
from raidex.raidex_node.offer_book import OfferDeprecated, OfferBook, OfferType, OfferView
from raidex.raidex_node.listener_tasks import OfferBookTask, SwapCompletedTask, OfferTakenTask
from raidex.utils import timestamp
from raid... | StarcoderdataPython |
1742885 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
sys.path.append('utils')
import json
import numpy as np
from .utils.box import *
from .utils.draw import *
from .utils.infrastructure import *
from .utils.detbox import *
def save_results(re... | StarcoderdataPython |
3255349 | from setuptools import setup
setup(
name='d3rlpy-addons',
version='0.1',
packages=[
'd3rlpy_addons',
'd3rlpy_addons.fitters',
'd3rlpy_addons.wrappers',
"d3rlpy_addons.models"
],
url='',
license='MIT',
author='<NAME>.',
author_email='<EMAIL>',
descript... | StarcoderdataPython |
1732394 | import numpy as np
from . import tools
class IntervalTestData(object):
functions = [tools.f]
first_derivs = [tools.fd]
domains = [(1,2),(0,2),(-1,0),(-.2*np.pi,.2*np.e),(-1,1)]
integrals = [
[ 0.032346217980525, 0.030893429600387, -0.014887469493652,
-0.033389463703032, -0.016340257... | StarcoderdataPython |
3379169 | <filename>app_view_data/apps.py
from django.apps import AppConfig
class AppViewDataConfig(AppConfig):
name = 'app_view_data'
| StarcoderdataPython |
4822600 | # Nuix Worker side script for Virus Total lookup
# v1.0
# updated 2021-01-28
import urllib2
import json
import time
# APIKEY must be set. Get one from Virus Total
# Please note Virus Total's requirements for the Public API below
####
# The Public API is limited to 500 requests per day and a rate of 4 requests per min... | StarcoderdataPython |
176878 | from titrationFitter.titrationFitter import Component, System, Titration, loadModel | StarcoderdataPython |
3308691 | <reponame>SpeagleYao/IP_Final_Project<gh_stars>0
from img_aug import data_generator
from models import *
from loss import *
import numpy as np
import cv2
import torch
model = CENet_My()
model.load_state_dict(torch.load('./pth/CENet_My.pth'))
model.eval()
criterion = DiceLoss()
g_val = data_generator('./data/img_val.n... | StarcoderdataPython |
1741322 | <filename>examples/neighborhood-2.py
from streamsvg import Drawing
s = Drawing()
s.addNode("a")
s.addNode("b")
s.addNode("c")
s.addNode("d")
s.addLink("a", "b", 0, 4,color="#BBBBBB",width=2)
s.addLink("a", "b", 6, 9,color="#BBBBBB",width=2)
s.addLink("a", "c", 2, 5, height=0.4,width=3)
s.addLink("b", "c", 1, 8,width... | StarcoderdataPython |
1624607 | <reponame>ketsu8/prettycode
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from widgets.codeedit import QCodeEdit
from windows.settings import PreferencesWindow
from windows.projects import ProjectCreationWindow
from resources import __resourcesDirectory__
from settings impor... | StarcoderdataPython |
1625181 | class basicdspalgorithm:
# parameterized constructor
def __init__(self):
self.first = 0
self.second= 0
def conv(self,x,h):
self.first=x
self.second=h
N=len(self.first)+len(self.second)-1
x1=[0]*N
h1=[0]*N
m=len(self.firs... | StarcoderdataPython |
78330 | # Altere o Programa 7.2, o jogo da forca
# Utilize um arquivo em que uma palavra seja gravada a cada linha
# Use um editor de textos para gerar o arquivo
# Ao iniciar o programa, utilize esse arquivo para carregar (ler) a lista de palavras
# Experimente também perguntar o nome do jogador e gerar um arquivo com o número... | StarcoderdataPython |
1658403 | <gh_stars>10-100
# coding: utf-8
import setuptools
setuptools.setup(
name='cloudkeeper',
packages=setuptools.find_packages(),
install_requires=[
'requests',
'websocket-client',
],
)
| StarcoderdataPython |
1714722 | from .dynpaper import main as dpmain
from sys import argv
def main():
dpmain(argv)
| StarcoderdataPython |
3229007 | <gh_stars>0
'''
Capsules for Object Segmentation (SegCaps)
Original Paper by <NAME> and <NAME> (https://arxiv.org/abs/1804.04241)
Code written by: <NAME>
If you use significant portions of this code or the ideas from our paper, please cite it :)
If you have any questions, please email me at <EMAIL>.
This file is used ... | StarcoderdataPython |
47538 | class Solution:
def numJewelsInStones(self, J: str, S: str) -> int:
#map = {}
#for i in range(len(J)):
# map[J[i]] = 0
count = 0
for i in range(len(S)):
if str([S[i]][0]) in J: count +=1
return count
J = "aAB"
S = "aAAbbbb"
print(Solution().numJewelsI... | StarcoderdataPython |
1627012 |
import os
import redis
rdb = redis.StrictRedis(host = os.getenv('REDISTOGO_URL', 'redis'))
from bson.json_util import dumps
from utils.logger import log
class ConfigCls(object) :
def __init__(self) :
self.keys = {}
def __getattr__(self, attr) :
old_val = rdb.get(f'config-{attr}')
if old_val :
return old_... | StarcoderdataPython |
52842 | <reponame>youqad/oxford-hack-2020<gh_stars>0
from dataclasses import dataclass
import torch
import numpy as np
import pyro
import matplotlib.pyplot as plt
from pyro.infer import MCMC, NUTS
# import pyro.infer
# import pyro.optim
from pyro.distributions import Normal
# def model(data):
# """
# Explanation
# ... | StarcoderdataPython |
3324148 | from gpiozero import OutputDevice
from time import sleep
import sentry_sdk
# TODO: Add code comments to make it easier for a user to add additional pumps
sentry_sdk.init("https://40a7906637fe4943a09f8682e6235b43@sentry.io/1492001")
# Assign the pump based on what pin the Raspberry Pi is using
pump1 = OutputDevice(4... | StarcoderdataPython |
4837911 | from setuptools import setup
setup(
name='oboe',
version='0.2',
description='Converts an Obsidian vault into HTML',
url='https://github.com/kmaasrud/oboe',
author='kmaasrud',
author_email='<EMAIL>',
license='MIT',
packages=['oboe'],
install_requires=[
'markdown2',
'regex... | StarcoderdataPython |
183975 | from graphene_django import DjangoObjectType
from graphene_django.forms.mutation import DjangoModelFormMutation
from graphene_django import DjangoListField
from graphql_jwt.decorators import login_required
from .models import *
from .forms import MemberCreationForm
import graphene
############################... | StarcoderdataPython |
1703991 | # Generated by Django 3.1 on 2021-02-03 21:39
from django.db import migrations, models
from django.utils.text import slugify
import websites.models
COURSE_STARTER_SLUG = "course"
COURSE_STARTER_REPO_URL = "https://github.com/mitodl/ocw-course-hugo-starter"
COURSE_STARTER_REPO_NAME = "OCW Course Hugo Starter"
STARTE... | StarcoderdataPython |
1698507 | MOCK_USERS = [{"email": "<EMAIL>", "salt": "8Fb23mMNHD5Zb8pr2qWA3PE9bH0=", "hashed":
"1736f83698df3f8153c1fbd6ce2840f8aace4f200771a46672635374073cc876cf0aa6a31f780e576578f791b5555b50df46303f0c3a7f2d21f91aa1429ac22e"}]
class MockDBHelper:
def get_user(self, email):
user = [x for x in MOCK_U... | StarcoderdataPython |
60462 | """
Faça um programa que pergunte a hora para o usuário e, se baseando no horário descrito, exiba a saudação apropriada.
"""
hora = input("Que horas são aí? ")
if hora.isnumeric():
hora = int(hora)
else:
print("Por favor, digite somente números.")
if hora < 0 or hora > 23:
print("Horário inválido")
elif h... | StarcoderdataPython |
1669581 | from abc import ABC, abstractmethod
from aiogram import Bot
class AbstractTelegramAPI(ABC):
@abstractmethod
async def send_message(self, to_chat_id: int, text: str):
raise NotImplementedError
@abstractmethod
async def forward_message(
self, from_chat_id: int, to_chat_id: int, message... | StarcoderdataPython |
1660926 | <reponame>madvid/42_Gomoku
from metrics import *
def test_row1():
g = np.array([
[1, 0, 0],
[1, 0, 0],
[1, 1, 0]
])
assert measure_row(g, 1) == [Row(2, Position(2,0), 1, g)]
def test_row2():
g = np.array([
[1, 0, 0],
[1, 0, 0],
[1, 1, 1]
])
... | StarcoderdataPython |
3244990 | <filename>problems/test_0169_boyer_moore_vote.py
import unittest
class Solution:
def majorityElement(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
major = count = 0
for num in nums:
if num == major:
count += 1
elif c... | StarcoderdataPython |
111968 | <filename>exquiro/tests/test_ea_activity_diagram_parser.py
import unittest
from exquiro.parsers.enterprise_architect.ea_activity_diagram_parser import EAActivityDiagramParser
from exquiro.models.activity_diagram.activity_diagram_model import ActivityDiagramModel
from exquiro.models.activity_diagram.activity_relation im... | StarcoderdataPython |
110549 | <reponame>runzezhang/Data-Structure-and-Algorithm-Notebook
# Description
# Count how many nodes in a linked list.
# Example
# Example 1:
# Input: 1->3->5->null
# Output: 3
# Explanation:
# return the length of the list.
# Example 2:
# Input: null
# Output: 0
# Explanation:
# return the length of list.
... | StarcoderdataPython |
3206262 | import dns.resolver
import json
import known_tlds
def get_a(domain, server=None):
try:
if server:
my_resolver = dns.resolver.Resolver()
my_resolver.nameservers = [server]
answers = my_resolver.resolve(domain, 'A')
else:
answers = dns.resolver.resolve... | StarcoderdataPython |
3227248 | <reponame>akutkin/SACA<gh_stars>0
import math
#from model import Model
import glob
import numpy as np
import scipy as sp
from utils import is_sorted
# FIXME: For ``average_freq=True`` got shitty results
class LnLikelihood(object):
def __init__(self, uvdata, model, average_freq=True, amp_only=False,
... | StarcoderdataPython |
3303055 | <reponame>marcelabbc07/TrabalhosPython
import sys
sys.path.append('')
from model.endereco import Endereco
from dao.endereco_dao import EnderecoDao
class EnderecoController:
dao=EnderecoDao()
def listar_todos(self):
return self.dao.listar_todos
def buscar_id(self,id):
return self.dao.busca... | StarcoderdataPython |
1625266 | <gh_stars>0
import datetime, itertools
from django.views.generic import ListView
from django.shortcuts import get_object_or_404, render
from .models import ProductCategory, Vendor, Product
from .forms import OrderForm
def get_current_time_and_hour():
'''Returns a dictionary containing current_time and current_ho... | StarcoderdataPython |
4810327 | <filename>mini/migrations/0002_auto_20210729_1316.py
# Generated by Django 3.2.5 on 2021-07-29 13:16
from django.db import migrations, models
import mini.validators
class Migration(migrations.Migration):
dependencies = [
('mini', '0001_initial'),
]
operations = [
migrations.AlterModelOp... | StarcoderdataPython |
3268267 | <gh_stars>10-100
#!/usr/bin/env python
###############################################################################
# Copyright (c) 2009-2014, <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Sof... | StarcoderdataPython |
188401 | <reponame>nziokaivy/instagram
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import Profile, Comments, Image
from django import forms
class UserCreateForm(UserCreationForm):
email = forms.EmailField(required=True)
class ... | StarcoderdataPython |
3289977 | <reponame>VirtualL/home-assistant
"""Support for Rflink Cover devices."""
import logging
import voluptuous as vol
from homeassistant.components.cover import PLATFORM_SCHEMA, CoverDevice
from homeassistant.const import CONF_NAME, STATE_OPEN
import homeassistant.helpers.config_validation as cv
from homeassistant.helper... | StarcoderdataPython |
188714 | # Copyright (c) 2020 Graphcore Ltd. All rights reserved
import datetime
import sys
from popgen import registry, transform
# emit_handlers(namespace, aten, handlers, f=sys.stdout)
#
# Emits the C++ handlers for one operator.
# Parameters:
# namespace - namespace the operator is in
# aten - name of the operator
# ... | StarcoderdataPython |
123294 | #!/usr/bin/python3.7
from std_msgs.msg import String
import opensim as osim
from basic_example.srv import *
import rospy
import sys
import os
# ----------------------------------------------------------------------
# Load the musculoskeletal model from a file.
# --------------------------------------------------------... | StarcoderdataPython |
3309494 | import abc
class PayloadFormatter(metaclass=abc.ABCMeta):
@staticmethod
@abc.abstractmethod
def generate(instance):
pass
| StarcoderdataPython |
3281081 | <reponame>isabella232/onefuzz<gh_stars>1-10
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from enum import Enum
from typing import List
class OS(Enum):
windows = "windows"
linux = "linux"
class DashboardEvent(Enum):
heartbeat = "heartbeat"
new_file... | StarcoderdataPython |
4825644 | <filename>rpython/translator/platform/openbsd.py
"""Support for OpenBSD."""
import os
from rpython.translator.platform.bsd import BSD
class OpenBSD(BSD):
DEFAULT_CC = "cc"
name = "openbsd"
link_flags = os.environ.get("LDFLAGS", "").split() + ['-pthread']
cflags = ['-O3', '-pthread', '-fomit-frame-po... | StarcoderdataPython |
92026 | import json
import os
import re
import subprocess
from functools import cached_property
import requests
import yaml
# Changelog types
PULL_REQUEST = 'pull_request'
COMMIT = 'commit_message'
class ChangelogCIBase:
"""Base Class for Changelog CI"""
github_api_url = 'https://api.github.com'
def __init__... | StarcoderdataPython |
1678984 | import os.path as path
import logging
import sqlite3
import pickle
from collections import deque
from ipaddress import ip_address
from threading import Lock
from time import time, sleep
from urllib.parse import urlparse
from tracker import Tracker
max_input_length = 20000
submitted_trackers = deque(maxlen=10000)
if p... | StarcoderdataPython |
4211 | <reponame>Aditya239233/MDP
import matplotlib.pyplot as plt
import numpy as np
import math
from algorithm.planner.utils.car_utils import Car_C
PI = np.pi
class Arrow:
def __init__(self, x, y, theta, L, c):
angle = np.deg2rad(30)
d = 0.3 * L
w = 2
x_start = x
y_start = y
... | StarcoderdataPython |
1637972 | # Copyright 2020 The Bazel Authors. 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 required by applicable la... | StarcoderdataPython |
139116 | <filename>openmdao/devtools/docs_experiment/experimental_source/core/experimental_driver.py
"""Define a base class for all Drivers in OpenMDAO."""
from collections import OrderedDict
import warnings
import numpy as np
from openmdao.recorders.recording_manager import RecordingManager
from openmdao.recorders.recording_... | StarcoderdataPython |
3280172 | from . import angles
from . import waveforms
from . import harmonics
from . import qnms
from . import utils
from . import gwmemory
from .gwmemory import time_domain_memory, frequency_domain_memory
name = "gwmemory"
| StarcoderdataPython |
1604383 | # Copyright 1999-2018 Alibaba Group Holding 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | StarcoderdataPython |
108142 | # -*- coding: utf-8 -*-
__author__ = 'raek'
__updated__ = 'kmu'
import requests
# import datetime
# import getdangers as gd
# import makelogs as md
# import types
def get_warnings_as_json(region_ids, start_date, end_date, lang_key=1, simple=False, recursive_count=5):
"""Selects warnings and returns the json stru... | StarcoderdataPython |
3285125 | <gh_stars>1-10
##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribut... | StarcoderdataPython |
3240548 | <gh_stars>1-10
#!/usr/bin/env python
import sys
import json
import yaml # need to 'pip install pyyaml' for this to work; 'brew install libyaml && sudo python -m easy_install pyyaml' on Mac
print(yaml.dump(yaml.load(json.dumps(json.loads(open(sys.argv[1]).read()))), default_flow_style=False))
| StarcoderdataPython |
13744 | from zzcore import StdAns, mysakuya
import requests
class Ans(StdAns):
def GETMSG(self):
msg=''
try:
msg += xs()
except:
msg += '可能是机器人笑死了!'
return msg
def xs():
url = "http://api-x.aya1.xyz:6/"
text = requests.get(url=url).text
return text
| StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.