id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
8131802
<gh_stars>0 from django.urls import path from django.contrib.auth import views as auth_views from . import views urlpatterns = [ path('register/',views.doctor_register,name='register-doctor'), path('my_appointments/',views.my_appointment,name='doctor-appointments'), ]
StarcoderdataPython
3514892
<gh_stars>1-10 # # MIT License # # Copyright (c) 2020 <NAME>, @pablintino # # 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 rig...
StarcoderdataPython
1742823
<reponame>RL-OtherApps/website-addons<gh_stars>1-10 import datetime import random import werkzeug from odoo import http from odoo.http import request class Chess(http.Controller): # chess chat @http.route("/chess/game/chat/init", type="json", auth="public") def init_chat(self, game_id): author_...
StarcoderdataPython
4860249
<reponame>drkitty/web-test<gh_stars>0 hash_rounds = 20000 app_config = { 'debug': True, 'secret_key': '', } database = { 'host': 'localhost', 'user': 'checklist', 'passwd': <PASSWORD>, 'db': 'checklistdb', 'echo': True, }
StarcoderdataPython
1792577
<filename>datutils/datmeta.py<gh_stars>1-10 from datutils.utils import write_metadata # py2/3 compatibility try: input = raw_input except NameError: pass def datmeta(datfiles): sr = False while not sr: try: print("sampling rate:") isr = float(input()) ...
StarcoderdataPython
12819186
#!/usr/bin/env python # -*- coding: utf-8 -*- # # similarString.py # # Copyright 2014 Leandro <<EMAIL>> # import difflib import random def DNA(length): return ''.join(random.choice('CGTA') for nucleot in xrange(length)) DNA1 = DNA(15) print '-'*45 print 'Sequencia 1' print '-'*45 print DNA1 print '-'*45 pr...
StarcoderdataPython
4811823
""" @brief Compute spectrum-weighted exposure correction for counts light curves prepared by gtbin. @author <NAME> <<EMAIL>> """ # # $Header: /nfs/slac/g/glast/ground/cvs/users/jchiang/pyExposure/python/flux_lc.py,v 1.1 2006/05/28 14:40:27 jchiang Exp $ # import numarray as num from FunctionWrapper import FunctionWrap...
StarcoderdataPython
252490
from django.conf.urls.defaults import patterns, url, include, handler404, handler500 from django.contrib import admin import settings admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'home.html'}, name='home'), (r'^accounts/', include('usere...
StarcoderdataPython
5044828
<gh_stars>0 def change_frame(frame=0): pass def clear_render_border(): pass def curves_point_set(point='BLACK_POINT'): pass def cycle_render_slot(reverse=False): pass def external_edit(filepath=""): pass def invert(invert_r=False, invert_g=False, invert_b=False, invert_a=False): pass ...
StarcoderdataPython
4988746
<filename>leetcode/p102.py # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def levelOrder(self, root: Optional[TreeNode]) -> List[List[int]]: result...
StarcoderdataPython
6657508
<filename>packages/VikiLabs_CIFAR_Wrapper.py<gh_stars>1-10 ''' PyTorch Wrapper to work with CIFAR Handwritten Digit Database Author: <NAME> (a) Viki <EMAIL> ''' import torchvision from torchvision import transforms import torch from torchvision import datasets import os import errno from Vik...
StarcoderdataPython
6591995
<filename>megfile/lib/compat.py import sys __all__ = ['PathLike', 'fspath'] if sys.version_info < (3, 6): # pragma: no cover from pathlib import PurePath as PathLike def fspath(path) -> str: """os.fspath replacement, useful to point out when we should replace it by the real function once we...
StarcoderdataPython
6500546
from kubernetes import client from kubernetes.client.rest import ApiException from .load_kube_config import kubeConfig kubeConfig.load_kube_config() core = client.CoreV1Api() class K8sPods: def get_pods(ns, logger): try: if ns == 'all': logger.info ("Fetching all namespace ...
StarcoderdataPython
3350124
# Copyright 2021 - 2022 Universität Tübingen, DKFZ and EMBL # for the German Human Genome-Phenome Archive (GHGA) # # 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/...
StarcoderdataPython
90541
# %load_ext autoreload # %autoreload 2 import numpy as np from pyhamimports import * from spectrum import Spectrum import glob from tqdm import tqdm from subprocess import check_output datestr = check_output(["/bin/date","+%F"]) datestr = datestr.decode().replace('\n', '') singleTemp_dir = "resources/templates/" SB...
StarcoderdataPython
3451712
import requests response = requests.request('GET', 'https://wallhaven.cc') print(response.reason)
StarcoderdataPython
5141851
<gh_stars>0 for i in range(1,10): for j in range(1,i+1): print("%d*%d=%2d" % (j,i,i*j),end=" ") print("")
StarcoderdataPython
142738
# importiamo i pacchetti necessari import pandas as pd import matplotlib.pyplot as plt # l'indirizzo da cui vogliamo scaricare la tabella pageURL = 'https://it.wikipedia.org/wiki/Leone_d%27oro_al_miglior_film' # facciamo scaricare la pagina direttamente a pandas, dando indizi su qual e' la tabella che ci interessa ...
StarcoderdataPython
3505226
# -*- coding: utf-8 -*- """ coord_geog manage geographical points, perform conversions, etc 2015.nov 0.2 mlabru pep8 style conventions 2014.nov 0.1 mlabru initial version (Linux/Python) """ # < imports >---------------------------------------------------------------------------------- # python library import lo...
StarcoderdataPython
8120033
from django.apps import AppConfig class ServertestConfig(AppConfig): name = 'servertest'
StarcoderdataPython
3310262
<reponame>eladshabi/banias<filename>src/test/Publish_events.py from google.cloud import pubsub_v1 import json import time publisher = pubsub_v1.PublisherClient() topic_path = publisher.topic_path("elad-playground", "Autofleer_Topic") f = open("/src/test/test_events.txt", "r") event = f.readline() json_file = json.loa...
StarcoderdataPython
341116
<reponame>bcgov/CIT from .test_opportunity import *
StarcoderdataPython
9676782
from django.db import models from django.forms import model_to_dict from . import choices class DateTime(models.Model): year = models.PositiveSmallIntegerField( default=None, blank=True, null=True, ) month = models.PositiveSmallIntegerField( default=None, blank=Tru...
StarcoderdataPython
11242818
<gh_stars>10-100 #! /usr/bin/env python # Copyright 2014-2017 <NAME> <<EMAIL>> # Licensed under the GNU General Public License version 3 or higher # I don't use the ez_setup module because it causes us to automatically build # and install a new setuptools module, which I'm not interested in doing. from setuptools imp...
StarcoderdataPython
3267401
# -*- coding: utf-8 -*- def test_all_contains_only_valid_names(): import pycamunda.filter for name in pycamunda.filter.__all__: getattr(pycamunda.filter, name)
StarcoderdataPython
6676171
<reponame>TommasoPino/oem import numpy as np import warnings from oem.tools import epoch_span_overlap, epoch_span_contains, time_range REFERENCE_FRAMES = { "inertial": ["EME2000", "GCRF", "ICRF", "MCI", "TEME", "TOD"], "rotating": ["GRC", "ITRF2000", "ITRF-93", "ITRF-97", "TDR"] } class EphemerisCompare(ob...
StarcoderdataPython
1774942
#!/usr/bin/env python # -*- coding: utf-8 -*- from testrail_yak import Milestone from testrail_yak.lib.testrail import APIClient from tests import BASEURL, reqmock client = APIClient(BASEURL) m = Milestone(client) def test_get(reqmock): milestone_id = 1 reqmock.get(f"{BASEURL}/index.php?/api/v2/get_milestone...
StarcoderdataPython
4877771
<filename>genienlp/paraphrase/model_utils.py import torch import math import os import glob import re import logging import shutil import numpy as np from .transformers_utils import SPIECE_UNDERLINE from genienlp.metrics import computeBLEU logger = logging.getLogger(__name__) def sort_checkpoints(output_dir): r...
StarcoderdataPython
3302194
<filename>halotools/mock_observables/void_statistics/void_prob_func.py """ Module containing the `~halotools.mock_observables.void_prob_func` and `~halotools.mock_observables.underdensity_prob_func` used to calculate void statistics. """ from __future__ import absolute_import, division, print_function, unicode_literal...
StarcoderdataPython
3548045
import numpy as np import os # data_dir = '/users/hzhang2/projects/Cavs/apps/lstm/sst' data_dir = '/users/shizhenx/projects/Cavs/apps/lstm/data/sst' # splits = ['train', 'test', 'dev'] splits = ['train'] class Vocab(object): def __init__(self, path): self.words = [] self.word2idx = {} self.idx2word = ...
StarcoderdataPython
6655668
<reponame>hidaruma/caty # coding: utf-8 import os from caty.jsontools import prettyprint, TaggedValue, TagOnly import caty.jsontools.stdjson as stdjson def initialize(conf): # 初期化時にディレクトリの作成は行う if not os.path.exists(conf['data_dir']): os.mkdir(conf['data_dir']) def connect(conf): return FileStorag...
StarcoderdataPython
8183462
<filename>app/utils/db/database.py from typing import Optional from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm.session import Session from sqlmodel import SQLModel from env_config import settings from sqlalchemy.engine import create_engine, Engine from sqlalchemy.ext.asyncio import AsyncSe...
StarcoderdataPython
3537241
import json import os import shutil from enum import Enum from typing import List COLOR_ESC = '\033[' COLOR_RESET = f'{COLOR_ESC}0m' COLOR_GREEN = f'{COLOR_ESC}32m' COLOR_RED = f'{COLOR_ESC}31m' COLOR_CYAN = f'{COLOR_ESC}36m' COLOR_GRAY = f'{COLOR_ESC}30;1m' class Board(Enum): SLIMEVR = "BOARD_SLIMEVR" WROOM...
StarcoderdataPython
6444578
# Size Settings CHUNK_SIZE = 16 TILE_SIZE = 16 # Networking HEADER_SIZE = 32 # Game Settings, should be configurable CAMERA_SPEED = 4 LOAD_DISTANCE = 2 VIEWPORT_SIZE = ( round(CHUNK_SIZE*TILE_SIZE*1.5), round(CHUNK_SIZE*TILE_SIZE) ) # Layers WORLD_LAYERS = [ "ground", "player" ] UI_LAYERS = [ ] # Ti...
StarcoderdataPython
11391443
import numpy as np from typing import Dict, NamedTuple from mlagents.torch_utils import torch, default_device from mlagents.trainers.buffer import AgentBuffer from mlagents.trainers.torch.components.reward_providers.base_reward_provider import ( BaseRewardProvider, ) from mlagents.trainers.settings import Curiosit...
StarcoderdataPython
11383444
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import src.functions as fns import src.sparse_grids as spg from src.xtDG_projection import ProjectionXtDG import mesh_generator.io_mesh as meshio # projection of exact solution, full-grid 2d # noinspection PyUnusedLocal def projectionFG_2d(cfg, dir_m...
StarcoderdataPython
1772613
import unittest from pokeman import BasicConfig class BasicConfigTests(unittest.TestCase): def setUp(self): self.basic_config = BasicConfig( connection_attempts=5, heartbeat=7200, retry_delay=2 ) def test_base_name(self): self.assertEqual(self.basic...
StarcoderdataPython
11314489
<gh_stars>1-10 import sys from datetime import datetime, timedelta import logging import argparse import boto3 from elasticsearch import helpers from elasticsearch import Elasticsearch from elasticsearch.client.utils import _make_path from elasticsearch.exceptions import NotFoundError from iris.service.content.file.do...
StarcoderdataPython
9640294
<filename>python/Math/polar coordintes.py import cmath num=input() comp_num=complex(num) result=cmath.phase(comp_num) print((comp_num.real**2+comp_num.imag**2)**0.5) print(result)
StarcoderdataPython
4921797
import os from typing import Callable import vlc vlc_instance = None player = None playback_end_callback = lambda: NotImplemented current_mrl = None def init(callback: Callable[[], None]) -> None: global vlc_instance global player global playback_end_callback vlc_instance = vlc.Instance("--no-xli...
StarcoderdataPython
4818508
<filename>exploringShipLogbooks/classification.py import collections import exploringShipLogbooks import rpy2 import warnings import numpy as np import pandas as pd import os.path as op from .basic_utils import extract_logbook_data from .basic_utils import isolate_columns from .basic_utils import isolate_training_data...
StarcoderdataPython
6492236
#!/usr/bin/env python # -*- coding: utf-8 -*- from .. import bar import base import urllib import urllib2 import gobject import threading try: import json except ImportError: import simplejson as json class BitcoinTicker(base._TextBox): ''' A bitcoin ticker widget, data provided by the MtGox API ...
StarcoderdataPython
3248140
# -*- coding: utf-8 -*- ## \package globals.threads # # WARNING: Standard Python module 'threads' cannot be imported here # MIT licensing # See: docs/LICENSE.txt import threading from dbr.log import Logger thr = threading ## Standard thread class with renamed methods class Thread(thr.Thread): def __init__(se...
StarcoderdataPython
18498
# code jam: Qualification Round 2017: Problem C. Bathroom Stalls def read_int(): return int(raw_input()) def read_int_n(): return map(int, raw_input().split()) def get_y_z(n, k): if k == 1: if n & 1 == 0: # Even Number return n >> 1, (n >> 1) - 1 else: ...
StarcoderdataPython
3302001
"""Tests for interacting with Postgres database""" from typing import Dict, Any import json from driver.collector.collector_factory import get_postgres_version, connect_postgres from driver.database import collect_data_from_database from driver.collector.postgres_collector import PostgresCollector # pylint: disable=...
StarcoderdataPython
11342357
class Solution(object): def evalRPN(self, tokens): """ :type tokens: List[str] :rtype: int """ stck=[] for i in xrange(len(tokens)): # deal with negative if tokens[i].isdigit() or (tokens[i][0]=='-' and tokens[i][1:].isdigit()): ...
StarcoderdataPython
6491953
<gh_stars>1-10 """ Functions for interacting with the database server. """ from server_common.utilities import dehex_and_decompress, print_and_log from server_common.channel_access import ChannelAccess from server_common.pv_names import DatabasePVNames import json import traceback def get_iocs(prefix): """ Ge...
StarcoderdataPython
385818
#Naemazam(github:@naemazam) #R-PAss (Remember Password) from tkinter import * from tkinter import messagebox import json import pyperclip # password generator from password_generator import password_generator # color WINDOW_BG = "#020203" FIELD_COLORS = "#272b2b" FIELD_FONT_COLOR = "#07d6fa" LABEL_COLOR = "#10cf02" FO...
StarcoderdataPython
3295030
<filename>create_tf_records.py #!/usr/bin/env python import glob import random import tensorflow as tf import os import cv2 def int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) def int64_list_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(valu...
StarcoderdataPython
6554716
<reponame>pointcloudAI/libDepthEye ### # PointCloud Python Sample : ShowDepthNoGUI. # # Copyright (c) 2018 PointCloud.AI Inc. # # Author : Adam.Han # # Functional description: # Show simple usage with python to get depth information from DepthEye Camera # # Exit shortcut keys: # Input [Enter] Key ### import sy...
StarcoderdataPython
12857322
from django.contrib import admin from django.db.models import Model __all__ = ["register_all"] def register_all(models, admin_class=admin.ModelAdmin): """ Easily register Models to Django admin site. :: from yourapp import models from django_boost.admin.sites import register_all regi...
StarcoderdataPython
9792337
<gh_stars>0 from flask import render_template, url_for, flash, redirect, request, redirect, g, current_app, Markup import os from flask_login import login_user, current_user, logout_user, login_required from .. import db, bcrypt import secrets from werkzeug.urls import url_parse from flask_dance.consumer.backend.sqla i...
StarcoderdataPython
6643973
from pyrtcdc import ffi, lib from time import sleep from threading import Thread from base64 import b64encode, b64decode RTCDC_CHANNEL_STATE_CLOSED = 0 RTCDC_CHANNEL_STATE_CONNECTING = 1 RTCDC_CHANNEL_STATE_CONNECTED = 2 RTCDC_DATATYPE_STRING = 0 RTCDC_DATATYPE_BINARY = 1 @ffi.def_extern() def onopen_cb(channel, userd...
StarcoderdataPython
11389449
from BuildFrame import BuildDataFrame from ArbitrageHunter import ArbitrageHunter import time import yfinance #Test 1 while True: start_time = time.time() DD20210205call ,DD20210205put = BuildDataFrame('DD','2021-02-05') DD20210212call ,DD20210212put = BuildDataFrame('DD','2021-02-12') DD20210219c...
StarcoderdataPython
218116
#!/usr/bin/env python3 import os import re from setuptools import setup, find_packages version = None def find(haystack, *needles): regexes = [(index, re.compile(r'^{}\s*=\s*[\'"]([^\'"]*)[\'"]$'.format(needle))) for index, needle in enumerate(needles)] values = ['' for needle in needles] for line in ...
StarcoderdataPython
6595998
# -*- coding: utf-8 -*- from __future__ import absolute_import import datetime # noinspection PyUnresolvedReferences,PyProtectedMember from ._lib import _perl as perl5 from .vendor_perl import PERL_PACKAGE __version__ = 1.0 class Loader(perl5.Loader): PACKAGE = "PyPerl5::Loader" class Proxy(perl5.Proxy): ...
StarcoderdataPython
1600326
<filename>service_api/services/__init__.py<gh_stars>0 from dataclasses import dataclass from typing import Optional from urllib.parse import urlencode import aiohttp import aioredis import ujson from aioredis.commands import Redis from sanic.log import logger from service_api.domain.decorators import asyncio_task @...
StarcoderdataPython
1815154
# This script shows how to filter an existing target as a pose # This is useful for a robot that has been calibrated and we need to get the filtered pose # Important: It is assumed that the robot will reach the pose with the calculated configuration from robolink import * # API to communicate with RoboDK from robod...
StarcoderdataPython
12857805
<reponame>Novartis/yap #!/usr/bin/env python """ Copyright 2014 Novartis Institutes for Biomedical Research 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/LICENS...
StarcoderdataPython
9665455
import tkinter as tk from tkinter import ttk from tkinter import messagebox import gui.widgets as tkw from PIL import ImageTk, Image class FrameTagPictures(tk.Frame): def __init__(self, parent, controller=None, prop_frame={}, **kwargs): ...
StarcoderdataPython
4889716
<gh_stars>0 import os import logging from telegram import ParseMode from telegram.ext import CommandHandler from trello import TrelloClient from reventlov.bot_plugins import get_list_from_environment from reventlov.bot_plugin import BotPlugin version = '0.0.1' logger = logging.getLogger(__name__) logger.info(f'Trell...
StarcoderdataPython
6504553
#!/usr/bin/python # # Copyright 2018-2022 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
StarcoderdataPython
5003942
<gh_stars>1-10 # -*- coding: utf-8 -*- """The parser mediator object.""" import datetime import logging import os from dfvfs.lib import definitions as dfvfs_definitions # TODO: disabled as long nothing is listening on the parse error queue. # from plaso.lib import event from plaso.lib import py2to3 from plaso.lib im...
StarcoderdataPython
11220841
import numpy as np from sklearn.utils import check_random_state from mne.io import BaseRaw from joblib import Memory from .core_smica import SMICA from .mne import ICA, transfer_to_mne from .utils import fourier_sampling location = './cachedir' memory = Memory(location, verbose=0) def _transform_set(M, D): '''...
StarcoderdataPython
11224662
import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim from utils import conv2d_flipkernel, adjecent_matrix, adjecent_sparse def dot(x, y, sparse=False): if sparse: return tf.sparse_tensor_dense_matmul(x, y) else: return tf.matmul(x, y) def kernel_net_coord(coord, w...
StarcoderdataPython
9608455
<reponame>silverlogic/plum-back<filename>apps/cards/models.py<gh_stars>1-10 from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.contrib.postgres.fields import ArrayField from django.core.mail import send_mail from django.template.loader...
StarcoderdataPython
1605952
<filename>test_short.py import RPi.GPIO as GPIO from time import sleep import time Motor1A = 16 Motor1B = 18 Motor1E = 22 Motor2A = 19 Motor2B = 21 Motor2E = 23 Trigcenter = 38 Echocenter = 40 Trigright = 38 Echoright = 40 Trigleft = 38 Echoleft = 40 x = 0 GPIO.setmode(GPIO.BOARD) GPIO.setup(Motor1A,GPIO.OUT) GPIO.s...
StarcoderdataPython
3232247
#!/usr/bin/env python3 # # Copyright 2018 Red Hat, Inc. # # Authors: # <NAME> <<EMAIL>> # # This work is licensed under the MIT License. Please see the LICENSE file or # http://opensource.org/licenses/MIT. from django.template import Context, Template from patchew.tags import tail_lines, grep_A, grep_B, grep_C, g...
StarcoderdataPython
309139
import configparser import argparse import torch from torch.utils.data import TensorDataset import torch_xla.distributed.xla_multiprocessing as xmp import torch_xla import torch_xla.core.xla_model as xm from DTI_model import DTI_model, modelConfig from Tester import Tester, TesterConfig from utils import * from pre...
StarcoderdataPython
1762428
<gh_stars>0 from collections import deque num = int(input()) pumps = deque() for _ in range(num): info = [int(x) for x in input().split()] pumps.append(info) for i in range(num): is_valid = True fuel = 0 for _ in range(num): current = pumps.popleft() fuel += current[0] - current[...
StarcoderdataPython
8053389
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ :mod:`Quantulum` parser. """ # Standard library import re import logging from fractions import Fraction from collections import defaultdict from math import pow # Quantulum from . import load from . import regex as reg from . import classes as cls from . i...
StarcoderdataPython
284402
<reponame>ionicsolutions/modelstore # Copyright 2020 <NAME> # # 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
3221427
import os import pytest import fetch_data as fd def test_file_logging(): import logging from fetch_data import utils dest = "./tests/downloads/logging_download.log" utils.log_to_file(dest) logging.warning("[TESTING] This is a test log for downloading") with open(dest) as file: a...
StarcoderdataPython
3464273
<gh_stars>1-10 #!/usr/bin/env python import netcdf4_functions as nffun import os, sys, csv, time, math, numpy from optparse import OptionParser #Create, run and process a CLM/ELM model ensemble member # given specified case and parameters (see parm_list and parm_data files) # Parent case must be pre-built and all n...
StarcoderdataPython
9738863
# https://github.com/ValvePython/steam/issues/97 import gevent.monkey gevent.monkey.patch_all() from getpass import getpass from gevent.pywsgi import WSGIServer from steam_worker import SteamWorker from flask import Flask, request, abort, jsonify import logging logging.basicConfig(format="%(asctime)s | %(name)s | %(m...
StarcoderdataPython
9715790
<reponame>avacorreia/Exercicio-Curso-em-Video-Pyton-Modulo1 import datetime ano = int(input('Insira o ano: ')) if ano == 0: ano = datetime.datetime.now().year if ano % 400 and ano != 0 and ano % 4 == 0 and ano % 100: print(ano) print('O ano é bissexto.') else: print(ano) print('O ano não é bissexto....
StarcoderdataPython
271094
from __future__ import unicode_literals from __future__ import absolute_import, division, print_function """ Entity editing tests for enumerated value fields """ __author__ = "<NAME> (<EMAIL>)" __copyright__ = "Copyright 2014, <NAME>" __license__ = "MIT (http://opensource.org/licenses/MIT)" import os impo...
StarcoderdataPython
1835419
import torch import torch.nn as nn from torch.nn import init import math import numpy as np ''' try: from networks.resample2d_package.resample2d import Resample2d from networks.channelnorm_package.channelnorm import ChannelNorm from networks import FlowNetC from networks import FlowNetS ...
StarcoderdataPython
8110546
<filename>setup.py import os,sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")] def initialize_options(self): TestCommand.initialize_options(self) ...
StarcoderdataPython
202544
<filename>certbot-dns-digitalocean/certbot_dns_digitalocean/_internal/dns_digitalocean.py """DNS Authenticator for DigitalOcean.""" import logging import digitalocean import zope.interface from certbot import errors from certbot import interfaces from certbot.plugins import dns_common logger = logging.getLogger(__na...
StarcoderdataPython
1800852
<filename>qiskit_nature/drivers/second_quantization/pyquanted/pyquantedriver.py # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2021. # # 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...
StarcoderdataPython
3317930
<gh_stars>0 """ CSC111 Final Project: Reconstructing the Ethereum Network Using Graph Data Structures in Python General Information ------------------------------------------------------------------------------ This file was created for the purpose of applying concepts in learned in CSC111 to the real world probl...
StarcoderdataPython
37840
# -*- coding: utf-8 -*- from coralquant.models.odl_model import BS_Stock_Basic, BS_SZ50_Stocks, TS_Stock_Basic, TS_TradeCal from coralquant.spider.bs_stock_basic import get_stock_basic from coralquant import logger from datetime import date, datetime, timedelta from sqlalchemy import MetaData from coralquant.database i...
StarcoderdataPython
6568453
''' @Author: hua @Date: 2019-12-12 14:03:17 @description: https://www.cnblogs.com/luxiaojun/p/6567132.html @LastEditors: hua @LastEditTime: 2019-12-13 13:24:09 ''' from app import sched, delayQueue, socketio import time from app.Vendor.Utils import Utils #循环执行 @sched.scheduled_job('interval', seconds=5) def interval_j...
StarcoderdataPython
3435912
<reponame>chandru99/nilmtk from nilmtk import * ds = DataSet("/Users/nipunbatra/Downloads/nilm_gjw_data.hdf5") elec = ds.buildings[1].elec elec.plot()
StarcoderdataPython
3243919
<filename>findash/polls/urls.py from django.urls import path from . import views # namespace will differentiate app urls from other app urls with the same name. app_name= 'polls' # paths within the app urlpatterns = [ # /polls path('',views.IndexView.as_view(), name='index'), # /polls/5 path('<int:pk>/...
StarcoderdataPython
6476439
from .maze_craze.maze_craze import env, parallel_env, raw_env # noqa: F401
StarcoderdataPython
11216118
<reponame>romgar/django-biolabs from biolabs.core import models as core_models from rest_framework import serializers class LaboratorySerializer(serializers.HyperlinkedModelSerializer): description = serializers.CharField(required=False, max_length=255) adress = serializers.CharField(required=False, max_lengt...
StarcoderdataPython
6519486
<filename>extras/video_processor.py """ A script for processing video files into entries so that Lauhdutin can be used to manage a library of videos. Requires ffmpeg (for ffmpeg.exe and ffprobe.exe) and ImageMagick (for convert.exe). The structure of the config file, which should be in the working directory of the scr...
StarcoderdataPython
1936061
#!/usr/bin/env python3 # vim: nospell expandtab ts=4 # SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>> # # SPDX-License-Identifier: BSD-2-Clause from __future__ import annotations from typing import Any, Generator, List, Tuple import json import logging import requests from bs4 import BeautifulSoup, NavigableString ...
StarcoderdataPython
3492580
from .zincbase import KB
StarcoderdataPython
6589300
load("//antlir/bzl:oss_shim.bzl", "http_file") # This wrapper function around `native.prebuilt_python_library` # exists because directly using `native.prebuilt_python_library` # in BUCK causes a build error. def prebuilt_python_library(**kwargs): # @lint-ignore BUCKLINT native.prebuilt_python_library(**kwargs)...
StarcoderdataPython
3465594
<gh_stars>0 # -*- mode: python; encoding: utf-8 -*- # # Copyright 2012 <NAME>, Opera Software ASA # # 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...
StarcoderdataPython
4996571
# 2.5) from SinglyLikedList import SinglyLikedList def add_lists(l1, l2): added = get_real_number(l1) + get_real_number(l2) return turn_into_list(added) def get_real_number(linked_list): node = linked_list.head factor = 1 result = 0 while node is not None: element = node.element ...
StarcoderdataPython
1781300
<gh_stars>1000+ import scrabble # Print all the words containing uu for word in scrabble.wordlist: if "uu" in word: print(word)
StarcoderdataPython
3458216
<reponame>Quentin18/Line-Track-Designer<gh_stars>1-10 """ The **error** module manages the errors of the library. """ class LineTrackDesignerError(Exception): """Manage exception errors.""" pass
StarcoderdataPython
5073999
import os from src.perturbator.support_modules.perturbator import branch_insert_process,\ count_tasks_in,\ count_sequence_flows_in,\ count_parallel_gateways_in def test_parallel_insert_fragment(): absolute_input_path = os.path.abspath('./tests/test_files/input1.bpmn') absolute_input2_path = os.pat...
StarcoderdataPython
6504095
import numpy as np import face_recognition from scipy import spatial from PIL import Image, ImageFont, ImageDraw class FaceLandmarks(object): def __init__(self): pass def find_list(self, name_file): image = face_recognition.load_image_file(name_file) return face_recognition.face_landmarks(image) def fin...
StarcoderdataPython
1693035
# pytest -s sa/tests/test_sa.py import os import sys from typing import Text for module_path in [os.path.abspath("/home/gus/Desktop/nlp-finance/"), os.path.abspath("/home/gus/Desktop/nlp-finance/sa")]: if module_path not in sys.path: sys.path.append(module_path) import json from sa.server_finance import S...
StarcoderdataPython
5154837
<reponame>sixin-zh/kymatio_wph __all__ = ['PhaseHarmonics2d']
StarcoderdataPython