id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
3212207
<reponame>Ravillatypov/sanic-macrobase<gh_stars>0 from enum import Enum class SanicHookNames(Enum): before_server_start = 'before_server_start' after_server_start = 'after_server_start' before_server_stop = 'before_server_stop' after_server_stop = 'after_server_stop'
StarcoderdataPython
133499
#!/usr/bin/env python3 """Test running an enrichment using any annotation file format.""" from __future__ import print_function __copyright__ = "Copyright (C) 2010-2019, <NAME>, <NAME>. All rights reserved." import os import itertools from goatools.base import get_godag from goatools.associations import dnld_annofil...
StarcoderdataPython
3228534
<filename>views/zdnst_ldap.py from flask import Flask, g, request, session, redirect, url_for ,current_app ,abort from flask_simpleldap import LDAP from functools import wraps from ldap import filter as pyldap_filter from ldap import LDAPError as pyldap_LDAPError from ldap import SCOPE_SUBTREE as pyldap_SCOPE_SUBTREE ...
StarcoderdataPython
1691439
from __future__ import annotations import typing as tp from racketinterpreter.classes import data as d from racketinterpreter.classes import errors as err from racketinterpreter.predefined._base import BuiltInProc if tp.TYPE_CHECKING: from racketinterpreter.classes import ast from racketinterpreter.processes i...
StarcoderdataPython
1602903
# -*- coding: utf-8 -*- """ Test module for Amount Value object """ __author__ = '<NAME>' __email__ = '<EMAIL>' from decimal import Decimal import pytest as pt from source.util import TrackingError from source.domain import Value, Amount class TestAmount: """ Test cases for the Amount Value object ...
StarcoderdataPython
1729423
import pytest import random import torch from torch.optim import Adam import numpy as np import gym import torch_testing as tt from rlil.approximation import VNetwork, FeatureNetwork from rlil.environments import State, Action, GymEnvironment from rlil.memory import ExperienceReplayBuffer, GaeWrapper from rlil.presets....
StarcoderdataPython
3330477
<filename>tests/conftest.py<gh_stars>10-100 # Copyright 2015 <NAME> <<EMAIL>> # # 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
1734085
from pytorch_lightning.metrics.metric import Metric from pytorch_lightning.metrics.classification import ( Accuracy, Precision, Recall, Fbeta ) from pytorch_lightning.metrics.regression import ( MeanSquaredError, MeanAbsoluteError, MeanSquaredLogError, ExplainedVariance, )
StarcoderdataPython
59874
<reponame>kenblikylee/pitu from .photo import Photo def gray(photo, params, show=False): _photo = Photo(photo).gray() _photo.save('gray-' + photo) if show: _photo.show()
StarcoderdataPython
3207221
<reponame>woutdenolf/spectrocrunch # -*- coding: utf-8 -*- import unittest import numpy as np from .. import qxrf from ...utils import units from ...patch import jsonpickle class test_qxrf(unittest.TestCase): def geometryinstance(self): energy = 10 geometryinstance = qxrf.factory("sxm1", simplec...
StarcoderdataPython
4828914
<reponame>DharaniAnche/python-programs<gh_stars>1-10 import base64 x = "Python" y = x.encode('ascii') base64_bytes = base64.b64encode(y) base64_message = base64_bytes.decode('ascii') print(base64_message)
StarcoderdataPython
9099
<reponame>nlkhagva/saleor import graphene from ...unurshop.ushop import models from ..core.mutations import BaseBulkMutation, ModelBulkDeleteMutation class UshopBulkDelete(ModelBulkDeleteMutation): class Arguments: ids = graphene.List( graphene.ID, required=True, description="List of ushop ID...
StarcoderdataPython
185456
# gobject_worker.py # # MIT License # # Copyright (c) 2020 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
StarcoderdataPython
3334276
from ..schema.nexusphp import Visit class MainClass(Visit): URL = 'https://pt.msg.vg/' USER_CLASSES = { 'downloaded': [1099511627776, 3298534883328], 'share_ratio': [3.55, 4.55], 'days': [420, 700] }
StarcoderdataPython
1694264
from PhotoClasser import PhotoClasser class PhotoClasserBuilder: def __init__(self): self.obj_photo_classer = None self.src_directory = None self.dst_directory = None self.move_files = None def with_srcdir(self, directory): self.src_directory = directory retur...
StarcoderdataPython
4826278
<filename>sarkas/potentials/force_pp.py """ Module for handling Particle-Particle interaction. """ import numpy as np from numba import njit @njit def update_0D(pos, id_ij, mass_ij, Lv, rc, potential_matrix, force, measure, rdf_hist): """ Updates particles' accelerations when the cutoff radius :math: `r_c` is...
StarcoderdataPython
3379927
from .pandemic_fastapi import Unpack from .pandemic_fastapi import create_fastapi as FastAPI from .pandemic_fastapi import create_router as APIRouter from .signaturebuilder import Adapters, SignatureBuilder # TODO: pydantic analyzerはどこも参照していないので、pandemicにテストのみ移植する。 # TODO: BaseModel生成時、ModelField.inferでFieldInfoが生成される...
StarcoderdataPython
3219009
<filename>04_exploration/solutions/11_solution.py data.groupby('movie_id')['rating'].mean().hist(bins=20)
StarcoderdataPython
1722040
import argparse import collections import json import math import os from datetime import datetime import torchvision from allennlp.modules.vision.region_detector import RegionDetectorOutput from torch import Tensor from torchvision.models.detection.roi_heads import maskrcnn_inference from torchvision.transforms impor...
StarcoderdataPython
197096
################################################################################ # skforecast # # # # This work by <NAME> is licensed under a Creative Commons # # Attribut...
StarcoderdataPython
3379742
#!/usr/bin/env python from __future__ import print_function import sys import rospy import numpy as np from time import sleep sys.path.insert(0, '/home/adrian/Documents/CETYS/Vehiculos/bebop_ws/src/bebop_autonomy/bebop_coordinates/scripts') from CoordinateSystem import CoordinateSystem if __name__=="__main__": ro...
StarcoderdataPython
65529
# Copyright 2019 IBM Corporation # # 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 agreed to in writing, ...
StarcoderdataPython
92824
<filename>bmcs_beam/mxn/utils/file_handler.py<gh_stars>1-10 ''' Created on 18. 3. 2014 @author: Vancikv ''' import os def get_outfile(folder_name, file_name): '''Returns a file in the specified folder using the home directory as root. ''' HOME_DIR = os.path.expanduser("~") out_dir = os.path.join(...
StarcoderdataPython
83798
from django.shortcuts import render from .models import RcStudent from django.http import HttpResponse import os import random import string import hashlib import simplejson def get_post(request): if request.method == "POST": req = simplejson.loads(request.body) # 检查token是否一致 token = "<PAS...
StarcoderdataPython
98283
<reponame>ppolewicz/screeps-starter-python from creeps.builder import Builder from creeps.harvester import Harvester from creeps.miner import Miner from creeps.hauler import Hauler from creeps.scout import Scout from creeps.claimer import Claimer from creeps.upgrader import Upgrader from creeps.settler import Settler f...
StarcoderdataPython
28553
########################################################################## # PyPipe - Copyright (C) AGrigis, 2017 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html # for details. ####...
StarcoderdataPython
1720824
<reponame>mr-bit779/python<filename>5.loop.py x=1 while x<10: print(x) if x==7: break x+=1
StarcoderdataPython
3360906
<reponame>hanqiu-hq/cvpods #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import os import shutil from typing import Callable, Optional from urllib import request from loguru import logger def download( url: str, dir: str, *, filename: Optional[str] = None, progres...
StarcoderdataPython
1757595
<reponame>khurtado/autopyfactory # # import logging import logging.handlers import sys import time import unittest from autopyfactory.plugins.queue.batchstatus.Condor import MockQueue, getMockQueueConfig, Condor class TestCondorStatus(unittest.TestCase): def test_condor_status(self): mq = MockQueue(...
StarcoderdataPython
3330774
<reponame>ssiccha/equivalent-mappings<gh_stars>0 #!/usr/bin/env python ############################################################################# ## ## equivalent mappings ## gap.py ## <NAME> ## ## Copyright 2017 by the authors. ## T...
StarcoderdataPython
3306751
<filename>scripts/WriteOverlappingReads.py<gh_stars>0 #!/usr/bin/python3 import shasta import sys helpMessage = """ This will write in fasta format all the oriented reads tghat overlap a given oriented read. Invoke with two arguments: read id and strand. """ if not len(sys.argv)==3: print(helpMessage) exit(1)...
StarcoderdataPython
21184
<reponame>novafacing/challenges from platform import architecture from qiling import Qiling from typing import Union from asm_practice.coding.challenge import ArchSpec, Challenge, TestCase challenges = [] amd64 = ArchSpec( pwntools_arch="amd64", pwntools_os="linux", qiling_rootfs="qiling/examples/rootfs/...
StarcoderdataPython
1647347
import numpy as np class PoissonClutter2d: """Clutter model. The number of clutters, k, follows a poisson distribution. The k clutters are uniformaly spatially distributed. """ def __init__(self, density): self.dentity = density def arise(self, centor, scope): num_clutter = ...
StarcoderdataPython
1723644
<filename>Plumber/UIItems/Button.py<gh_stars>0 import pygame import Sounds import Settings from pygame import Rect from UIItems.CenteredText import CenteredText class Button: """ Class representing a button """ def __init__(self, text): self.text = None self.click_method = None ...
StarcoderdataPython
1716608
<filename>res/Helper/Const/UI.py class ConstUi(): """ class for storing all our const of our UI""" UI_MINIATURE_SIZE = 100
StarcoderdataPython
81898
<filename>tests/test_models/test_heads/utils.py<gh_stars>10-100 # Copyright (c) OpenMMLab. All rights reserved. from mmcv.cnn import ConvModule from mmcv.utils.parrots_wrapper import SyncBatchNorm def _conv_has_norm(module, sync_bn): for m in module.modules(): if isinstance(m, ConvModule): if ...
StarcoderdataPython
1786953
<reponame>Amourspirit/ooo_uno_tmpl<filename>ooobuild/dyn/sheet/table_validation_visibility.py<gh_stars>0 # coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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 co...
StarcoderdataPython
1636850
from typing import List class Trie: def __init__(self): """ Initialize your data structure here. """ self.trie = {} def insert(self, word: str) -> None: """ Inserts a word into the trie. """ def helper( char, table ):...
StarcoderdataPython
4818358
<reponame>CORE-GATECH-GROUP/hydep import os import pathlib import tempfile import pytest import hydep from tests.regressions import ProblemProxy @pytest.fixture def toy2x2Problem(simpleChain, toy2x2lattice): # Include the chain so reactions are present model = hydep.Model(toy2x2lattice) model.differenti...
StarcoderdataPython
172922
from qualifier import make_table table = make_table( # rows=[ # ["Duck<NAME>", 3], # ["<NAME>", 12], # ["Duck<NAME>", 7], # ["<NAME>", 1] # ], # labels=["Name", "Duckiness"], rows=[ ["Lemon", 18_3285, "Owner"], ["Sebastiaan", 18_3285.1, "Owner"], ["Kuti...
StarcoderdataPython
105963
<reponame>DennisMerkus/omniglot import unittest import pytest from bs4 import BeautifulSoup from omniglot.mul.freedict import FreedictEntry, parse_freedict_entry class TestFreedict(unittest.TestCase): @pytest.mark.asyncio async def test_por_merenda(self): entry = """ <entry> <fo...
StarcoderdataPython
3385588
<filename>TD3_particles.py import copy import pysplishsplash import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import os import time from TD3_base import TD3_base from torchvision import models import gym if not torch.cuda.is_available(): print("WARNING: NO CUDA") else: prin...
StarcoderdataPython
3304098
<filename>Word2Vec Models Proj /test_glove_model.py #!/usr/bin/env python3 ''' Word analogy python3 program -> that solves analogies such as "dog is to cat as puppy is to ___". using Stanford's Glove model. Author: <NAME> (<EMAIL>) Date: 26th May, 2019 ''' import numpy as np import os import sys from gens...
StarcoderdataPython
4823055
<filename>app/utils.py import urllib2 import logging import urllib import urlparse import unicodedata import unidecode as unidecode def fetch_url(url): response = '' try: result = urllib2.urlopen(url) response = result.read() except urllib2.URLError: logging.exception('Caught exc...
StarcoderdataPython
71667
<filename>flask_dance/consumer/requests.py from functools import wraps from flask import redirect, url_for from urlobject import URLObject from requests_oauthlib import OAuth1Session as BaseOAuth1Session from requests_oauthlib import OAuth2Session as BaseOAuth2Session from oauthlib.common import to_unicode from werkzeu...
StarcoderdataPython
90924
# -*- coding: utf-8 -*- # @Time : 2021/2/10 11:58 上午 # @Author : <NAME> # @FileName: __init__.py # @Software: PyCharm # @Blog :https://lesliewongcv.github.io/ import numpy as np import matplotlib.pyplot as plt import sys sys.path.append('../') import GenericAlgorithm as GA from math import * def fitness_score(in...
StarcoderdataPython
126573
import conbench.runner import pyarrow.csv from benchmarks import _benchmark @conbench.runner.register_benchmark class CsvReadBenchmark(_benchmark.Benchmark): """ Read CSV file to arrow table. CsvReadBenchmark().run(<source>, options...) Parameters ---------- source : str A sourc...
StarcoderdataPython
94651
<reponame>catsaveearth/Machine_Learning_termproject import numpy as np from sklearn import metrics import time from sklearn.model_selection import train_test_split from sklearn.model_selection import GridSearchCV, train_test_split # clustering scoring def purity_score(y_true, y_pred): # compute contingency matrix ...
StarcoderdataPython
4828525
<filename>apps/workspaces/migrations/0011_auto_20211005_0726.py # Generated by Django 3.0.3 on 2021-09-28 08:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('workspaces', '0010_auto_20210414_1118'), ] operations = [ migrations.AddFiel...
StarcoderdataPython
28684
# Create the DMatrix: housing_dmatrix housing_dmatrix = xgb.DMatrix(data=X, label=y) # Create the parameter dictionary: params params = {'objective':'reg:linear', 'max_depth':4} # Train the model: xg_reg xg_reg = xgb.train(dtrain=housing_dmatrix, params=params, num_boost_round=10) # Plot the feature importances xgb....
StarcoderdataPython
3396355
<gh_stars>0 from fnmatch import fnmatch, fnmatchcase from pathlib import Path from typing import List, Mapping def ensure_list(obj) -> List: if isinstance(obj, str): return [obj] else: try: return list(obj) except TypeError: return [obj] def get_list(d: Mappin...
StarcoderdataPython
1646422
<filename>src/python/backends/py/runtime/state/state.py from . import configuration from ..... import inspect from .. import graph, stepcounter, telemetry, trace import itertools __all__ = ['InterpreterState', 'RuntimeState'] class InterpreterState(object): ''' The part of the runtime system state that belongs to...
StarcoderdataPython
4816088
from django.core.paginator import Paginator from django.shortcuts import render, redirect from django.views.generic import ListView, DetailView from .models import book from django.template import loader from django.http import HttpResponse class IndexView(ListView): model = book template_name = 'books/inde...
StarcoderdataPython
145742
<filename>ytplaylistsync/YTPlaylistSync.py<gh_stars>0 from ytplaylistsync.cli.CLIParser import CLIParser class YTPlaylistSync: def __init__(self): print("Init") def main(): #parse args self.__args = CLIParser.parse() #do the thing #auth to drive toke...
StarcoderdataPython
105122
<gh_stars>10-100 # -*- coding: utf-8 -*- import sys # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.3.x is_py33 = (is_py3 and _ver[1] == 3) #: Python 3.4.x is_py34 = (is_py3 and _ver[1] == 4) #: Python 3.5.x is_py35 = (is_py3 and _v...
StarcoderdataPython
3377552
""" Test robot class. Early stage """ from irbt import Robot def test_robot_rooms(cloud): """ Test robot rooms. Test robot rooms """ robot = Robot(cloud) assert(robot is not None) assert(robot.rooms() == [ {'id': '1', 'name': 'Living Room', 'region_type': 'living_room'}, ...
StarcoderdataPython
3291960
from .dict import *
StarcoderdataPython
155599
import namespace_override as override def _(methods, address, class_name): ret = [] post = [] if 'using.cs' in methods: add_to = [ret] for line in methods['using.cs']: if '---;' not in line: add_to[0] += [line] else: add_to = [post] ...
StarcoderdataPython
3384540
# Python Imports import datetime import importlib # Django imports from django.conf import settings # Local imports from mwbase import models as mwbase from . import validation def send(identity, message, transport_name=None): ''' Main hook for sending message to identity. If transport_name is None will...
StarcoderdataPython
1611145
import torch from torchvision import transforms from PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True from utils.utils import * import json import cv2 import copy import numpy as np import os from tool.darknet2pytorch import * from tqdm import tqdm from skimage import measure from argparse import ArgumentPa...
StarcoderdataPython
1738214
<filename>tools/idl_parser/idl_ppapi_parser.py<gh_stars>1-10 #!/usr/bin/env python # Copyright (c) 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. """ Parser for PPAPI IDL """ # # IDL Parser # # The parser is uses th...
StarcoderdataPython
1640
<gh_stars>1-10 # Create your views here. # -*- coding: utf-8 -*- from apps.core.helpers import render_to, ajax_response, get_object_or_None from apps.core.decorators import lock, login_required_json from apps.accounts.models import Invite from apps.accounts.decorators import check_invite from apps.accounts.forms import...
StarcoderdataPython
1784435
import math from pypy.lang.js.jsparser import parse, ParseError from pypy.lang.js.astbuilder import ASTBuilder from pypy.lang.js.operations import * from pypy.lang.js.jsobj import ThrowException from pypy.rlib.objectmodel import we_are_translated from pypy.rlib.streamio import open_file_as_stream ASTBUILDER = ASTBuil...
StarcoderdataPython
1703867
__version__ = '0.1.0' import datetime import logging import os.path import re import shutil from collections import namedtuple from decimal import Decimal from string import Template LogFileTuple = namedtuple('LogTuple', 'filename type date') class ConfigDict(dict): def __getattr__(self, name): if name ...
StarcoderdataPython
70578
<filename>tests/test.py import dataclasses from typing import Optional, Tuple, TypeVar import pytest import adt from adt.examples import Option, Result # ------------------------------------------------------------------------------ # Fixtures # ----------------------------------------------------------------------...
StarcoderdataPython
1661225
<reponame>itsmiki/Security-Tokens import os import time import hashlib import pickle class Session(): # Klasa sesja agreguje podległe po nią tokeny # w momencie stworzenia instancji sesja tworzone są foldery do logów i informacji na jej temat def __init__(self, name: str, ip, port = None) -> None: ...
StarcoderdataPython
165833
#!/usr/bin/env python3 import os, sys, glob, time import subprocess import argparse import pathlib parser = argparse.ArgumentParser() parser.add_argument("--optimize") # i.e. "-O3" parser.add_argument("--flags", default="") parser.add_argument("input") parser.add_argument("output") args = parser.parse_args() #pri...
StarcoderdataPython
180449
<gh_stars>0 # Write a program that reads a temperature value and the letter C for Celsius or F for # Fahrenheit. Print whether water is liquid, solid, or gaseous at the given temperature # at sea level. type = str(input("Enter the temperature type, C for celsius or F for fahrenheit: ")) temperature = float(input("Ente...
StarcoderdataPython
1783008
#!/usr/bin/env python import os import logging import requests from importlib.machinery import SourceFileLoader class RedmineLib(object): _key = '' _crt = '' _url = '' _token = '' def __init__(self): cnf=os.path.join(os.getenv('HOME'), '.config', 'redmine_commander', 'env.py') s...
StarcoderdataPython
3209890
<reponame>zooks/django-test from django.conf.urls import include, url from django.contrib import admin from main.views import home, item, get_category # from main import views as main_views urlpatterns = [ # Examples: # url(r'^$', 'futbolkas.views.home', name='home'), # url(r'^blog/', include('blog.urls')...
StarcoderdataPython
4818749
<reponame>farmy-maker/seed from datetime import datetime import random from config import CAMERA_TYPE, DHT_PIN, PUMP_PIN, LED_PIN, DEBUG, CAMERA_LIGHT_THRESHOLD try: from device.light import read_light from device.soil_moisture import get_moisture from device.soil_temperature import get_celsius from dev...
StarcoderdataPython
1602361
<reponame>LostLucidity/lucid_ai import random def worker_rush(self): collectedActions = [] for worker in self.workers: collectedActions.append(worker.attack(self.enemy_start_locations[0])) return collectedActions
StarcoderdataPython
4803837
<reponame>youngmit/armi<filename>armi/reactor/blueprints/__init__.py # Copyright 2019 TerraPower, 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 # # http://www.apache.org/licenses/LI...
StarcoderdataPython
1780788
import time, threading import math import datetime import mufadb as db import mufabattle as mb import mufagenerator as mg StartTime=time.time() def hourly_content_generation(): mg.generate_random_dungeons() mg.dungeon_monsters_generate() mg.global_monsters_generate() def action() : print('action ! -...
StarcoderdataPython
1634935
from download_html import HtmlDownloader as html_downloader from html_analyze import HtmlParser as html_parser from url_controller import UrlControl as url_control import urllib.parse import time class pan115: def __init__(self): self.download_html = html_downloader() # 下载器 self.html_analyze = ...
StarcoderdataPython
71703
<reponame>Gowee/p2kbot # The following code is adapted from https://stackoverflow.com/questions/3362600/how-to-send-email-attachments import os import logging import asyncio from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.utils import ...
StarcoderdataPython
173856
<gh_stars>1-10 import Model.nodo as nodo from Model.jogador import * class Tabuleiro: _tabuleiro = None _nodos_disponiveis = None def __init__(self, tamanho): self._tabuleiro = [[nodo.Nodo([x,y], Jogador.ESPACO_LIVRE) for y in range(tamanho+1)] for x in range(tamanho+1)] self._criar_dict_nodos_disponiveis(tam...
StarcoderdataPython
24226
from django.apps import AppConfig class TextGeneratorConfig(AppConfig): name = 'text_generator'
StarcoderdataPython
1712164
<reponame>hanyhesham/cis_ubuntu_2004<filename>molecule/default/tests/test_section_03.py import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') MOD_DCCP_FILE = "/etc/modprobe.d/3.4.1_dccp.conf" MOD_SC...
StarcoderdataPython
176961
# Copyright 2021 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
90635
<reponame>AlexanderAivazidis/scvelo<filename>scvelo/tools/pymc/pymc3_model.py # -*- coding: utf-8 -*- r"""Base Pymc3 model class for all models in pymc3""" import matplotlib.pyplot as plt import numpy as np import pandas as pd import pymc3 as pm import theano from pymc3.variational.callbacks import CheckParametersConv...
StarcoderdataPython
180372
<filename>db/generate_data.py import random from datetime import datetime from pprint import pprint import csv import json def get_random(): rand_nums = list("12345678") eth = ['chinese', 'malay', 'indian', 'others'] sev = ['Severe', 'Moderate', 'Not urgent'] regions = ['Changi', 'Jurong West', 'Bukit ...
StarcoderdataPython
4832647
"""Defaults urls for the Zinnia TinyMCE""" from django.conf.urls import include from django.conf.urls import url urlpatterns = [ url(r'^', include('zinnia_tinymce.urls.links')), url(r'^filebrowser/', include('zinnia_tinymce.urls.filebrowser')), ]
StarcoderdataPython
1774128
s = input() print(s.count("1"))
StarcoderdataPython
3254886
<reponame>PyText2Speech/PyText2Speech<gh_stars>1-10 """ PyText2Speech NAME text_to_speech - text to speech SYNOPSIS text_to_speech [OPTION] [TEXT]... DESCRIPTION -n, --name user name for service IBM watson/ITRI/Baidu. -p, --password password -s, --service google, watson, itri...
StarcoderdataPython
1611923
<filename>tools/templatetool/ttool/env.py """Jinja2 environment getters """ from jinja2 import Environment, FileSystemLoader from .filters import gen_id def __make_env(include_paths): env = Environment( loader=FileSystemLoader(include_paths) ) env.filters['genid'] = gen_id return env def get...
StarcoderdataPython
1669331
<filename>S03 - Time Series/BLU05 - Classical Time Series Models/utils.py import pandas as pd import numpy as np from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt def load_airlines_series(): airlines = pd.read_csv('data/AirPassengers.csv')[:-1] airlines.Month = pd.to_datetime(a...
StarcoderdataPython
1740543
<filename>awave/models/models.py import torch import torch.nn.functional as F from torch import nn class Feedforward(nn.Module): def __init__(self, input_size, hidden_size=32): super(Feedforward, self).__init__() self.input_size = input_size self.hidden_size = hidden_size # hidden...
StarcoderdataPython
89830
from django.contrib import admin import wemo.models as wemo from homeauto.admin import make_discoverable, remove_discoverable class WemoAdmin(admin.ModelAdmin): list_display = ('name', 'id', 'type', 'status', 'enabled') list_filter = ('type','status','enabled') search_fields = ('name',) actions = [mak...
StarcoderdataPython
1680244
<gh_stars>0 """LAMMPS extension for InterMol. .. module:: lammps_parser .. moduleauthor:: <NAME> <<EMAIL>> """ import os import pdb import logging import numpy as np from collections import OrderedDict import intermol.unit as units from intermol.atom import Atom from intermol.molecule import Molecule from intermol.sy...
StarcoderdataPython
139260
<gh_stars>0 """ Module containing merge operation that act on geometry blocks """ import pandas as pd from shapely.geometry import box from .base import GeometryBlock __all__ = ["MergeGeometryBlocks"] class MergeGeometryBlocks(GeometryBlock): """ Merge two GeometryBlocks into one by index Provide t...
StarcoderdataPython
24182
<filename>src/archive-comments-lambda/main.py import asyncio import json import os from datetime import datetime from src.common import log_utils, pushshift from src.common.filesystem import S3FileSystem, StubFileSystem from src.common.lambda_context import local_lambda_invocation def handler(event, context): lo...
StarcoderdataPython
1602545
from django import template from django.utils.html import mark_safe from ..parse_md import parse_md register = template.Library() @register.filter def md(value, arg=''): # pylint: disable=invalid-name if not arg or arg == 'div': kwargs = {'wrap': 'div', 'html_class': 'markdown'} elif arg == 'blockqu...
StarcoderdataPython
1675600
# -*- coding: utf-8 -*- # # Copyright (C) 2022 GEO Secretariat. # # geo-assets is free software; you can redistribute it and/or modify it under # the terms of the MIT License; see LICENSE file for more details. """Module tests.""" from flask import Flask from geo_assets import GEOAssets def test_version(): """...
StarcoderdataPython
1692948
# Generated by Django 2.2.4 on 2019-08-07 18:26 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('roster', '0013_auto_20190807_1421'), ] operations = [ migrations.AlterField( model_name='clusiveuser', name='permiss...
StarcoderdataPython
3394421
<reponame>JulienPalard/kisee """Entry point for the identification provider. """ import argparse import logging import os import sys from typing import Mapping, Any import toml from aiohttp import web import sentry_sdk from kisee import views from kisee.identity_provider import import_idp from kisee.middlewares imp...
StarcoderdataPython
4817151
#!/usr/bin/python3 import numpy as np import pandas as pd import dask.array as da import sys import os #fluidity_fp = '/mnt/c/Users/julia/fluidity/fluidity-master/python' DA_project_fp = '/mnt/c/Users/julia/Documents/Imperial/DA_project' #sys.path.append(fluidity_fp) sys.path.append(DA_project_fp) import vtktools...
StarcoderdataPython
126690
''' Spline2.py: wrapper for B. Thijsse et al.'s hyper-spline routines. Yet another spline interpolation routine. The problem: given a set of experimental data with noise, find the spline with the optimal number of knots. Solution: They use the usual kind of routines to determine least-squares splines from ...
StarcoderdataPython
4830331
<reponame>DayongTong/ESE650LearningInRobotics # <NAME> (<EMAIL>) import os, sys, pickle, math from copy import deepcopy from scipy.spatial.transform import Rotation from scipy import io import numpy as np import matplotlib.pyplot as plt import time from load_data import load_lidar_data, load_joint_data, joint_name_t...
StarcoderdataPython
3220022
#!/usr/bin/env python # -- encoding: utf-8 -- # # Copyright 2015-2016 Telefónica Investigación y Desarrollo, S.A.U # # This file is part of FI-WARE project. # # 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...
StarcoderdataPython