id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
3526244
<reponame>Rostwik/real_estate_agency-master<gh_stars>0 # Generated by Django 2.2.24 on 2022-03-18 10:39 from django.db import migrations, models import phonenumber_field.modelfields class Migration(migrations.Migration): dependencies = [ ('property', '0009_auto_20220206_2022'), ] operations = [...
StarcoderdataPython
1822446
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html # Based on Copyright (C) 2016 <NAME> <<EMAIL>> """Lda Sequence model, inspired by `<NAME>, <NAME>: "Dynamic Topic Models" <https://mimno.infosci.cornell.edu/info6150/readings/dynami...
StarcoderdataPython
4868492
from argparse import ArgumentParser from chemprop.parsing import update_checkpoint_args from chemprop.sklearn_predict import predict_sklearn if __name__ == '__main__': parser = ArgumentParser() parser.add_argument('--test_path', type=str, required=True, help='Path to CSV file containi...
StarcoderdataPython
1777421
<gh_stars>0 # -*- coding:utf8 -*- # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def partition(self, head, x): """ :type head: ListNode :type x: int :...
StarcoderdataPython
6505641
import bs4 import dataclasses import typing @dataclasses.dataclass class Tag(): name: str def _scrape_tag(soup: bs4.BeautifulSoup) -> typing.List[Tag]: elements = soup.find(class_='tag').find_all('a')[:-1] return [Tag(e.text) for e in elements]
StarcoderdataPython
1762370
<reponame>anliven/Reading-Code-Learning-Python # -*- coding: utf-8 -*- import tkinter root = tkinter.Tk() root.wm_title("Tkinter04 Demo") label1 = tkinter.Label(root, text=u"账号:").grid(row=0, sticky="w") label2 = tkinter.Label(root, text=u"密码:").grid(row=1, sticky="w") label3 = tkinter.Label(root, text=u"") ...
StarcoderdataPython
1636301
# -*- coding:utf-8 -*- """ Weibo Api """ from django.urls import path from weibo.views.weibo import ( WeiboCreateAPIView, WeiboListAPIView, WeiboDetailApiView ) urlpatterns = [ # 前缀:/api/v1/weibo/weibo/ path("create", WeiboCreateAPIView.as_view(), name="create"), path("list", WeiboListAPIView...
StarcoderdataPython
243605
<gh_stars>0 #!/usr/bin/env python3 # Copyright 2021 The Pigweed Authors # # 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...
StarcoderdataPython
105776
import numpy as np import keras import json from tqdm import tqdm import cv2 import random import matplotlib.pyplot as plt from keras.applications.vgg16 import preprocess_input from keras.preprocessing import image as keras_image import pickle def augment_patch(patch, augmentation): if augmentation=='H-Flip': ...
StarcoderdataPython
3269145
"""empty message Revision ID: a89df01c20eb Revises: Create Date: 2019-03-01 18:52:32.627154 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a89df01c20eb' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
StarcoderdataPython
202620
""" pysteps.cascade.interface ========================= Interface for the cascade module. .. autosummary:: :toctree: ../generated/ get_method """ from pysteps.cascade import decomposition, bandpass_filters _cascade_methods = dict() _cascade_methods['fft'] = (decomposition.decomposition_fft, decomposition.r...
StarcoderdataPython
3599918
#!/usr/bin/env python ''' This software was written by <NAME> <<EMAIL>> based on the Windows Connect Now - NET spec and code in wpa_supplicant. Consider this beerware. Prost! ''' import time, threading, hmac, hashlib, sys, optparse, random from struct import pack, unpack from Crypto.Cipher import AES from sc...
StarcoderdataPython
11295768
class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self, value): self.head = Node(value) def append(self, value): cur = self.head while cur.next is not None: cur = cur.next cur.next = Node(valu...
StarcoderdataPython
3511448
<filename>minimum_example/to_h5.py import json import os import sys import h5py import pyedflib import tqdm print("\n Converting EDF and annotations to standard H5 file") download_directory = sys.argv[1] h5_directory = sys.argv[2] if not os.path.isdir(h5_directory): os.makedirs(h5_directory) records = [ x.sp...
StarcoderdataPython
3242391
<reponame>C6SUMMER/allinclusive-kodi-pi """ SALTS XBMC Addon Copyright (C) 2014 tknorris 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 Software Foundation, either version 3 of the License, or (a...
StarcoderdataPython
335074
<reponame>TheWITProject/MentorApp<filename>userProfile/migrations/0008_remove_profile_location.py # Generated by Django 2.2.10 on 2020-04-13 23:53 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('userProfile', '0007_profile_location_q'), ] operations = ...
StarcoderdataPython
4849699
import glob import os from eth_utils import to_tuple from ruamel.yaml import YAML from yaml_test_execution import execute_ssz_test_case, execute_tree_hash_test_case YAML_BASE_DIR = os.path.abspath(os.path.join(__file__, "../../eth2.0-tests/")) SSZ_TEST_FILES = glob.glob( os.path.join(YAML_BASE_DIR, "ssz", "**/*.y...
StarcoderdataPython
12819283
<reponame>cm107/common_utils from functools import wraps import sys import traceback def bypass_error_in_classmethod(print_func=print): def inner(method): @wraps(method) def wrapper(self, *args, **kwargs): try: method(self, *args, **kwargs) except: ...
StarcoderdataPython
9546
<reponame>nuagenetworks/nuage-tempest-plugin # Copyright 2017 NOKIA # All Rights Reserved. from netaddr import IPNetwork import testtools from tempest.common import waiters from tempest.lib import exceptions from tempest.scenario import manager from tempest.test import decorators from nuage_tempest_plugin.lib.test.n...
StarcoderdataPython
11324931
from sympy import isprime, prime solution = [1001100000110, 1001100000100, 1001100000100, 1001100000000, 1001101100010, 1001101100111, 1001101001100, 1001101001111, 1001100000111, 1001101000101, 1001101101000, 1001100000011, 1001101011001, 1001101110011, 1001101101000, 1001101110101, 1001101011110, 1001101011001, 1001...
StarcoderdataPython
1807276
"""bubblepopApi URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cla...
StarcoderdataPython
9625674
<gh_stars>1-10 from typing import Tuple import numpy as np import cv2 CAMERA_Z_OFFSET = 1.4 CAMERA_FORWARD_OFFSET = 2.0 PIXELS_PER_METER = 5 PIXEL_OFFSET = 10 # CAMERA_FORWARD_OFFSET * PIXELS_PER_METER # For the world map as used by the teacher (and visualization) BIRDVIEW_OFFSET = (-80.0, 160.0) BIRDVIEW_IMAGE_SI...
StarcoderdataPython
380157
try: import networkx as nx except Exception as e: pass try: import graph_tool as gt from graph_tool import topology except Exception as e: pass class Graph: ''' CLass for managing variety of graphing problems. We use networkx and graph_tool, the latter of which is the default method, a...
StarcoderdataPython
1741878
# Copyright 2015 <NAME>, S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import controllers
StarcoderdataPython
1995723
<reponame>Crunch-io/crunchbot<filename>tests/unit/test_config_mod.py<gh_stars>1-10 from unittest import mock import pmxbot.config_ @mock.patch('pmxbot.config', {}) def test_config_append(): """ += should append an item to a list """ pmxbot.config['foo'] = [] text = 'foo += {"a": 3, "b": foo}' pmxbot.config_.co...
StarcoderdataPython
4992693
<gh_stars>0 """ Exercício Python #101 - Funções para votação Crie um programa que tenha uma função chamada voto() que vai receber como parâmetro o ano de nascimento de uma pessoa, retornando um valor literal indicando se uma pessoa tem voto NEGADO, OPCIONAL e OBRIGATÓRIO nas eleições. """ from pattern i...
StarcoderdataPython
1788810
import numpy as np import pandas as pd import pytest from sklearn.datasets import load_boston, load_breast_cancer from vivid.env import Settings @pytest.fixture(scope='function', autouse=True) def stop_logging(): before = Settings.LOG_LEVEL Settings.LOG_LEVEL = 'WARNING' yield Settings.LOG_LEVEL = be...
StarcoderdataPython
1926322
<filename>Computer networks/socket/thread/timeout_utils.py # <NAME> - Data - versione import signal, os, sys import time #sleep import optparse parser = optparse.OptionParser() parser.add_option('-t', '--timeout', dest="timeout", default=2, ) parser.add_option('-s', '--sleeptime', dest="sleeptime", default=0....
StarcoderdataPython
6598250
# sensory PFC ylim = (-0.258832775674365, 1.9837228160819715) ax = selectivity_plot(['Oscar', 'Gonzo'], 'PresentedStimulus', 'ConcatFactor', ['PreDist', 'Gating', 'PostDist'], ['PreDist', 'Gating', 'PostDist'], ['PFC'], ylim_arg=ylim, selective_across=True, title='Information...
StarcoderdataPython
8150875
#!/usr/bin/env python3 # Copyright 2019 Brocade Communications Systems LLC. 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 also obtain a copy of the License at # http://www.apache.org/licenses/LICENS...
StarcoderdataPython
160197
import numpy as np import matplotlib.pyplot as plt import pandas as pd import math import warnings warnings.filterwarnings(action='once') data = None; matData = None; def initData(csvName): data = pd.read_csv(csvName) matData = pd.DataFrame(columns=['Name','Diameter','Length','Reduced Diamter','Area','Reduce...
StarcoderdataPython
4949815
<gh_stars>0 #Dynamic Compression Ration calculator import math as m borein=input("Cylinder Bore in mm? ") strokein=input("Stroke in mm? ") ccvolin=input("Combustion chamber volumein CCs? ") bore=float(borein) stroke=float(strokein) ccvol=float(ccvolin) #Converting mm to cm, volume(draw) in CCs bore=bore/10 st...
StarcoderdataPython
5035581
from django.http import HttpResponse from django.views.generic import View class BaseView(View): def get(self, *args, **kwargs): return HttpResponse("app 3")
StarcoderdataPython
6500023
# coding: utf8 # Author: <NAME> (~wy) # Date: 2017 # Big Numbers def problem48(): acc = 0 for i in range(1,1001): acc += i ** i acc = acc % 10 ** 10 return acc print(problem48())
StarcoderdataPython
1819360
import tornado import tornado.websocket from tornado.web import RequestHandler class HelloWorld(RequestHandler): """Print 'Hello, world!' as the response body.""" def get(self): """Handle a GET request for saying Hello World!.""" self.write("Hello, world!") class WSHandler(tornado.websocket.W...
StarcoderdataPython
9779893
#!/usr/bin/env python3 # Copyright (c) 2003-2012 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # """ Stripped down version of: https://github.com/CoreSecurity/impacket/blob/pyt...
StarcoderdataPython
6482146
# -*- coding: utf-8 -*- import wx class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "Radio Demo", wx.DefaultPosition, (300, 300)) panel = wx.Panel(self) # 单选框 wx.RadioButton(panel, -1, "AAA", (60, 10), style=wx.RB_GROUP) # RB_GROUP表示一个组的开始 ...
StarcoderdataPython
1803118
<gh_stars>1-10 from setuptools import setup with open('requirements.txt') as f: required = f.read().splitlines() setup(name='python-spectacles', version='1.4.2', description='Description', author=u'<NAME>', license='MIT', packages=['spectacles'], install_requires=[ 's...
StarcoderdataPython
6478957
from typing import Set from xml.etree import ElementTree from linty_fresh.problem import TestProblem def parse(contents: str, **kwargs) -> Set[TestProblem]: result = set() try: root = ElementTree.fromstring(contents) except ElementTree.ParseError: return result for test in root.findal...
StarcoderdataPython
1844224
<filename>interspeechmi/src/interspeechmi/data_handling/constants.py import os from interspeechmi.constants import DATA_DIR ANNO_MI_DATA_DIR = os.path.join(DATA_DIR, "anno_mi") ANNO_MI_PREPROCESSED_DATA_DIR = os.path.join(ANNO_MI_DATA_DIR, "preprocessed") for data_dir in [ ANNO_MI_DATA_DIR, ANNO_MI_PREPROCES...
StarcoderdataPython
8088026
<gh_stars>10-100 # This module is used as a placeholder for the registration of test models. # It is intentionally empty; individual tests create and register models # that will appear to Django as if they are in this module. from __future__ import unicode_literals from django.db import models class BaseTestModel(mo...
StarcoderdataPython
1716518
## Note that Metadata Translation tools must run in 32-bit Python. import sys, os, os.path, arcpy from GeMS_utilityFunctions import * from xml.dom.minidom import * import codecs debug = False versionString = 'GeMS_FGDC1_Arc10.py, version of 5 October 2021' rawurl = 'https://raw.githubusercontent.com/usgs/...
StarcoderdataPython
1925397
#!/usr/bin/env python import sys import sqlite3 import numpy as np import matplotlib.pyplot as plt BINSIZE = 10 def _main(args): if len(args) != 3: print ("usage: mgap_txn_start_motif_count.py <mgap_motif_db> <xls> <window>") sys.exit(1) con = sqlite3.connect(args[0]) con.row_factor...
StarcoderdataPython
8017931
<gh_stars>0 import cv2 import numpy as np def draw_mask(img, image_bg, bbox, labels): global mask global masked_img alpha = 0.95 mask=[] masked_img_final=[] #print('bboxt: ' + str(type(bbox)) + '\n') bbox=np.array(bbox) #img = np.array(img) print('bbox: '...
StarcoderdataPython
6408510
import torch import torch.nn as nn import torch.nn.functional as F from . import metric_utils class DiceLoss(): ''' http://campar.in.tum.de/pub/milletari2016Vnet/milletari2016Vnet.pdf https://github.com/faustomilletari/VNet/blob/master/pyLayer.py https://github.com/pytorch/pytorch/issues/1249 '''...
StarcoderdataPython
4983589
#!/usr/bin/env python # -*- encoding: utf-8 -*- # @Version : Python 3.6 import os import pdb import json import argparse import warnings from collections import OrderedDict from functools import total_ordering from itertools import combinations import torch import torch.nn.functional as F import numpy as np from skle...
StarcoderdataPython
6564242
import warnings class IncorrectGeometryTypeException(Exception): """ The input json file must be a multipoint geometry type, in case the file do not accomplish with the geometry type then the application throw this exception. """ def __init__(self, message): super(IncorrectGeometryTypeExc...
StarcoderdataPython
6442562
import unittest import rocksdb class TestFilterPolicy(rocksdb.interfaces.FilterPolicy): def create_filter(self, keys): return b'nix' def key_may_match(self, key, fil): return True def name(self): return b'testfilter' class TestMergeOperator(rocksdb.interfaces.MergeOperator): ...
StarcoderdataPython
3539161
"""memcached client, based on mixpanel's memcache_client library Usage example:: import aiomcache mc = aiomcache.Client("127.0.0.1", 11211, timeout=1, connect_timeout=5) yield from mc.set("some_key", "Some value") value = yield from mc.get("some_key") yield from mc.delete("another_key") """ from ...
StarcoderdataPython
3328029
from django.urls import path from . import views urlpatterns = [ path('inject-works', views.inject_works), path('request-scope-works', views.request_scope_works), path('request-is-injectable', views.request_is_injectable), ]
StarcoderdataPython
6531439
# StreetSpace # See full license in LICENSE.txt from setuptools import setup # provide a long description using reStructuredText long_description = """ **StreetSpace** is a package under development for measuring and analysing streetscapes and street networks. """ # list of classifiers from the PyPI classifiers trov...
StarcoderdataPython
12855727
def leiaInt(msg): while True: try: i = int(input(msg)) except (ValueError, TypeError): print('\033[1;3;31mERRO: Por favor, digite um número inteiro válido.\033[0;0;0m') continue except (KeyboardInterrupt): print('\n\033[1;3;33mUsuário preferiu ...
StarcoderdataPython
1887563
<filename>hello.py<gh_stars>0 #!/usr/bin/env python3 import os, json # printing environment variables print(os.environ) # printing as json json_object = json.dumps(dict(os.environ), indent = 1) print(json_object) # print(os.environ["QUERY_STRING"]) # Print query strings if any # print(os.environ["BROWSER"]) # Pri...
StarcoderdataPython
5032036
from abc import ABC, abstractclassmethod from ghubunix.models.config import Config class Authenticator(ABC): """Abstract class for Authenticators""" @abstractclassmethod def authenticate(self): """Perform authentication""" pass @abstractclassmethod def store_token(self): ...
StarcoderdataPython
1914981
""" Module for I/O in arclines """ from __future__ import (print_function, absolute_import, division, unicode_literals) import numpy as np import os import datetime import pdb from astropy.table import Table, Column, vstack from astropy.io import fits from linetools import utils as ltu import arclines # For path fr...
StarcoderdataPython
97696
#!/usr/bin/env python import sys, json from functools import reduce inputFile = sys.argv[1] outputFile = sys.argv[2] with open(inputFile, 'r') as f: data = f.read() config = json.loads(data) def copy_without(xs, key): ys = xs.copy() ys.pop(key) return ys def merge_filtered(result, xs, pred): f...
StarcoderdataPython
269214
<filename>floodsystem/analysis.py<gh_stars>0 import matplotlib import numpy as np import matplotlib.pyplot as plt def polyfit(dates , levels, p): time_shift=1 date_num=matplotlib.dates.date2num(dates) y=levels d0=2 shifted_dates = date_num-date_num[0] p_coeff=np.polyfit(shifted_dates,y...
StarcoderdataPython
3369082
<gh_stars>1-10 from rasa_sdk.events import ConversationPaused from covidflow.actions.action_goodbye import ActionGoodbye from .action_test_helper import ActionTestCase class ActionGoodbyeTest(ActionTestCase): def setUp(self): super().setUp() self.action = ActionGoodbye() def test_goodbye(se...
StarcoderdataPython
3395072
<reponame>robinandeer/puzzle # -*- coding: utf-8 -*- from sqlalchemy import (Column, ForeignKey, Integer, String, UniqueConstraint, Text) from sqlalchemy.orm import relationship from .models import BASE class Suspect(BASE): """Represent a list of suspect variants.""" __tablename__ =...
StarcoderdataPython
3261613
<reponame>MatthewRobertDunn/PyVaders from entities.entity import Entity import pymunk from entities.physics_trait import PhysicsTrait from entities.takesdamage_trait import TakesDamageTrait class DestructibleTerrain(PhysicsTrait, TakesDamageTrait): def create_physics_body(self, position): self.physic...
StarcoderdataPython
11280215
try: # Django 1.6 from django.conf.urls import patterns, url except: from django.conf.urls.defaults import patterns, url from semanticeditor.views import * urlpatterns = patterns('', url(r'retrieve_styles/', retrieve_styles, name="semantic.retrieve_styles"), url(r'retrieve_commands/', retrieve_comm...
StarcoderdataPython
66781
from datetime import date from typing import Dict from pyspark.sql import SparkSession, Column, DataFrame # noinspection PyUnresolvedReferences from pyspark.sql.functions import lit from pyspark.sql.functions import coalesce, to_date from spark_auto_mapper.automappers.automapper import AutoMapper from spark_auto_mapp...
StarcoderdataPython
3219517
<gh_stars>1-10 #!/usr/bin/python # based on joint_state_publisher by <NAME>!! import roslib; # roslib.load_manifest('tf_camera_gui') import rospy import wx import tf from math import pi from threading import Thread RANGE = 10000 class TfPublisher(): def __init__(self): self.parent_frame = rospy.get_para...
StarcoderdataPython
9682633
import os import yaml import tarfile import urllib.request from urllib.parse import urlparse from pathlib import Path from tqdm import tqdm from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor from ctcdecode import CTCBeamDecoder class DownloadProgressBar(tqdm): def update_to(self, b=1, bsize=1, tsize=Non...
StarcoderdataPython
8043381
<filename>tests/extmath_test.py # encoding: utf-8 from __future__ import division, print_function import numpy as np import pytest as pt from mpnum import _testing as mptest from mpnum import factory, utils from mpnum.utils import extmath as em from numpy.testing import (assert_allclose, assert_array_almost_equal, ...
StarcoderdataPython
3312353
import tensorflow as tf import configuration import numpy as np from LSTM_model import LSTM_model def main(): config = configuration.ModelConfig(data_filename="input_seqs_eval") train(config) def train(config): with tf.Graph().as_default(): model = LSTM_model(config) inputs_seqs_batch, outputs_batch = ...
StarcoderdataPython
6463840
# 2. # Используя расщепление матрицы Стилтьеса, отвечающее её неполной факторизации по методу ILU(k), # реализовать стационарный итерационный процесс и исследовать скорость его сходимости # # стр. 65 - Основные стационарные итерационные процессы # стр. 75 - ускорение сходимости стационарных итерационных процессов # ...
StarcoderdataPython
3453135
<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- import sqlite3 import json def connect(db = "tr5nr.sqlite"): """ connects to SQLite database :param db: database file :return: connection object or None """ conn = None try: conn = sqlite3.connect(db) except sqlite3.Erro...
StarcoderdataPython
8162119
from abc import ABC from typing import Type from elpis.engines.common.objects.interface import Interface from elpis.engines.common.objects.model import Model from elpis.engines.common.objects.transcription import Transcription from elpis.engines.espnet.objects.model import EspnetModel from elpis.engines.kaldi.objects....
StarcoderdataPython
8124043
import numpy as np import torch import torch.optim as optim import torch.nn.functional as F from agents.common.utils import * from agents.common.buffers import * from agents.common.networks import * class Agent(object): """An implementation of the Deep Q-Network (DQN), Double DQN agents.""" def __init__(self,...
StarcoderdataPython
3238145
<filename>test/test_biplot.py<gh_stars>1-10 import unittest import numpy as np import pandas as pd from biofes.biplot import * from biofes import biplot from scipy import stats class test_functions(unittest.TestCase): def test_standardize(self): A = np.random.uniform(-300,300,size=(300,30)) A_st = ...
StarcoderdataPython
3481584
from django.urls import reverse_lazy from django.views.generic import ( ListView, DetailView, CreateView, TemplateView, UpdateView, DeleteView, ) from .models import ( ActivosFijos, ) # Create your views here. #<=====CRUD ActivosFijos======> class SuccessAddActivoFijo(TemplateView): ...
StarcoderdataPython
1719723
# -*- coding: utf-8 -*- """ Created on Tue Aug 21 13:03:42 2018 @author: <NAME> """ import numpy as np import matplotlib.pyplot as plt from IPython.display import SVG, display #Import Keras objects from keras.models import Model from keras.layers import Input, Flatten, Reshape, Softmax from keras.layers import Dens...
StarcoderdataPython
9784175
from PyQt5.QtWidgets import (QMainWindow, QWidget, QHBoxLayout, QVBoxLayout, QGridLayout, QLabel, QScrollArea) from PyQt5.QtGui import (QPixmap, QImage) from PyQt5.QtCore import Qt from bs4 import BeautifulSoup import requests import urllib.request from urllib.request import Request impor...
StarcoderdataPython
3219271
from .athletes import AthleteViewSet from .competitions import CompetitionViewSet from .lifts import LiftViewSet from .sessions import SessionViewSet
StarcoderdataPython
1657309
for i in range(0,10): print(i," saga")
StarcoderdataPython
8183266
# Copyright 2021 The IREE Authors # # Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """Constants that are inlined into RTL modules.""" # TypeCode constants. These are mirrored from the B...
StarcoderdataPython
5110109
from math import * my_num = 3 print(160 * 4.9) print(10 % 3) print(abs(my_num)) # absolute number print(pow(10, 4)) # ridicare la putere print(max(1, 3, 4, 5, 5, 6, 7, 8, )) # grabbing the biggest number min - the opposite (floor) print(round(4.5233)) # rotunjire ceil(another function) print(ce...
StarcoderdataPython
153016
<gh_stars>100-1000 """ Main click group for the CLI. Needs to be isolated for entry-point loading. """ import logging from pkg_resources import iter_entry_points import sys import click from click_plugins import with_plugins from cligj import verbose_opt, quiet_opt import fiona from fiona import __version__ as fio...
StarcoderdataPython
11263890
import pytest from azure.media.analyticsedge import * class TestGraphBuildSerialize(): def test_build_graph_serialize(self): graph_topology_name = "graphTopology1" graph_properties = MediaGraphTopologyProperties() graph_properties.description = "Continuous video recording to an Azure Media ...
StarcoderdataPython
9743629
from .trace_decorator import trace from .trace import Trace
StarcoderdataPython
240638
<filename>voice2vec/data/__init__.py from .spectograms import get_spectrogram from .voices_data import VoicesData
StarcoderdataPython
374334
<filename>CAV.py # <NAME>|| AUM NAMAH SHIVAAYA|| # Connected Autonomous Vehicle (CAV) model class file import numpy as np import config from utils import dist, contiguous, objStr from numpy.random import poisson from threading import Thread class CAV: iter = None # iteration number ID, timestamp = None, 0 # micr...
StarcoderdataPython
6569632
import tensorflow as tf from logging import getLogger logger = getLogger(__name__) class MNISTModel(tf.keras.Model): def __init__(self): super(MNISTModel, self).__init__() self.flatten = tf.keras.layers.Flatten() self.d1 = tf.keras.layers.Dense(128, activation="relu") self.d2 = t...
StarcoderdataPython
1845254
<filename>modules/dbnd/src/dbnd/_core/task/utils_task.py<gh_stars>100-1000 from dbnd._core.task.task import Task class UtilityTask(Task): pass class DeployTask(UtilityTask): pass
StarcoderdataPython
11372169
from question_model import Question from data import question_data from quiz_brain import QuizBrain question_bank = [] for q in question_data: question = Question(q["question"],q["correct_answer"]) question_bank.append(question) quiz = QuizBrain(question_bank) while(quiz.still_has_questions()): quiz.nextQuestion()...
StarcoderdataPython
3206412
import math import time t1 = time.time() size = 2000 sizet = size*size s = [0]*sizet for k in range(1,56): s[k-1] = (100003-200003*k+300007*k*k*k)%1000000-500000 for k in range(56,4000001): s[k-1] = (s[k-1-24]+s[k-1-55]+1000000)%1000000-500000 #print(s[10-1],s[100-1]) ''' # test case s = [-2,5,3,2,9,-...
StarcoderdataPython
8184494
<reponame>shangpf1/python_study import unittest import HTMLReport class CnodeTest(unittest.TestCase): # 访问数据库可以用此方法 @classmethod def setUpClass(self): print('this is setupclass') # 打开浏览器时用此方法 def setUp(self): print('this is setup') def test_01register(self): print('****test_...
StarcoderdataPython
4824210
<gh_stars>1-10 import sys import threading import warnings from collections import Counter, OrderedDict, defaultdict from functools import partial from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured from django.utils import lru_cache from .config import AppConfig class Apps(object): """...
StarcoderdataPython
6496869
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ ========================== SBPy Activity: Dust Module ========================== All things dust coma related. Functions --------- phase_HalleyMarcus - Halley-Marcus composite dust phase function. Classes ------- Afrho - Coma dust quantity of A'...
StarcoderdataPython
5095926
<filename>main.py from PIL import Image from enum import Enum import argparse class TileSizeIndex(Enum): X = 0 Y = 1 class ColorChannelIndexForPIL(Enum): RED = 0 GREEN = 1 BLUE = 2 ALPHA = 3 class ColorChannelBitOffset(Enum): ARGB8888_ALPHA = 24 ARGB8888_RED = 16 ARGB8888_GREEN = 8 ARGB8888_BLUE = 0 ...
StarcoderdataPython
5002055
""" Filename: workout_data.py Purpose: Loads the workout data into the database from a csv file Authors: <NAME> Group: Wholesome as Heck Programmers (WaHP) Last modified: 11/13/21 """ from db_manager import db_mgr import csv # Boolean to delete data from the workouts table # Useful for debugging and ini...
StarcoderdataPython
217588
import os from unittest import TestCase import pytest from web3 import Web3 from web3.middleware import geth_poa_middleware class MockTestCase(TestCase): @pytest.fixture(autouse=True) def __inject_fixtures(self, mocker): self.mocker = mocker def get_mainnet_provider(): return _get_web3_provide...
StarcoderdataPython
9602011
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2019-09-03 11:01 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Focus...
StarcoderdataPython
8118516
<gh_stars>100-1000 def DFS(graph, v): color = [-1] * v parent = [-1] * v time = 0 for i in range(v): if(color[i] == -1): DFSvisit(graph, v, i, color, parent, time) print(color) print(parent) def DFSvisit(graph, v, s, color, parent, time): color[s] = 0 time += 1 f...
StarcoderdataPython
8085760
<reponame>juancalheiros/voronoi-diagrams import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Voronoi, voronoi_plot_2d, Delaunay def display_voronoi(points_x, points_y, COLOR_POINT): plt.plot(points_x, points_y,'o', color=COLOR_POINT) def display_delaunay(points_x, points_y, points_indice...
StarcoderdataPython
278020
import sys import time import typing as tp from unittest import TestCase import hypothesis as hp from hypothesis import strategies as st import pypeln as pl MAX_EXAMPLES = 10 T = tp.TypeVar("T") class TestEach(TestCase): @hp.given(nums=st.lists(st.integers())) @hp.settings(max_examples=MAX_EXAMPLES) de...
StarcoderdataPython
5175711
<filename>openGaussBase/testcase/SQL/DDL/tablespace/Opengauss_Function_DDL_Tablespace_Case0024.py<gh_stars>0 """ Copyright (c) 2022 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan ...
StarcoderdataPython
1743175
<gh_stars>1-10 # -*- coding: utf-8 -*- from logging import Handler class DBLogHandler(Handler, object): def __init__(self): super(DBLogHandler, self).__init__() def emit(self, record): from .models import DBLogEntry as _LogEntry entry = _LogEntry() entry.level = ...
StarcoderdataPython
8005473
<filename>homeserver/voice_control/google_speech.py #!/usr/bin/env python # Copyright 2016 Google 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://w...
StarcoderdataPython