content stringlengths 5 1.05M |
|---|
quarterCodes = {
'Winter': '1',
'Spring': '2',
'Fall': '4'
}
subjectCodes = {
'ANTH': 'ANTH ',
'ART': 'ART ',
'ARTHI': 'ARTHI',
'ARTST': 'ARTST',
'ASAM': 'AS AM',
'ASTRO': 'ASTRO',
'BIO': 'BIOL ',
'BMSE': 'BMSE ',
'BLST': 'BL ST',
'CHEMENG': 'CH E ',
'CHEMBIO': ... |
import signal
class Tools():
def __init(self,):
pass
@staticmethod
def remove_special_chars(input_string):
special_chars = ["'"]
result = input_string
for char in special_chars:
result = result.replace(char, '')
return result
# Known exchanges:
... |
# -*- coding: utf-8 -*-
from collections import OrderedDict
import h5py
import pandas as pd
import numpy as np
def write_profile( profile_array, lengths_array, hdf5_handle, metadata ):
start_site_coverage = merge_metagene()
stop_site_coverage = merge_metagene()
# Do this in array - pyothonic way
#... |
import FWCore.ParameterSet.Config as cms
preIdAnalyzer = cms.EDAnalyzer("PreIdAnalyzer",
PreIdMap=cms.InputTag("trackerDrivenElectronSeeds:preid"),
TrackCollection=cms.InputTag("generalTracks"),
... |
from invoke import task
@task
def test(ctx):
ctx.run("pytest src")
# ... |
import numpy as np
import manga_tools as m
from astropy import wcs, nddata
from astropy import units as u, constants as c
def get_emline_qty(maps, qty, key, sn_th=3., maskbits=list(range(64))):
'''
return a masked array for a particular emission-line
'''
qty = qty.upper()
qty_extname = 'EMLINE_{}... |
from entity.queueEntity.QueueEntity import QueueEntity
class Decide(QueueEntity):
def __init__(self, simSystem, Type, id, inputPointer, outputPointer, name, expression):
super(Decide, self).__init__(simSystem, Type, id, inputPointer, outputPointer, name)
self.expression = expression
def take... |
#!/usr/bin/python
#Title : vmc.py
#Usage : python vmc.py -h
#Author : pmorvalho
#Date : February 11, 2022
#Description : Encodes the problem of Virtual Machines Consolidation (VMC) into MaxSAT\
#Notes :
#Python Version: 3.8.5
# (C) Copyright 2022 Pedro Orvalho.
#=====================================... |
from django.apps import AppConfig
class IrradiationsConfig(AppConfig):
default_auto_field = 'django.db.models.AutoField'
name = 'irradiations'
|
'''test_jutil.py - test the high-level interface
python-javabridge is licensed under the BSD license. See the
accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2013 Broad Institute
All rights reserved.
'''
import gc
import os
import numpy as np
... |
import os
from lxml import etree
class Toc:
_TOC_NS = "http://www.daisy.org/z3986/2005/ncx/"
def __init__(self, toc):
self._toc = etree.parse(toc)
def getTitles(self):
def addTitles(parentNavPoint):
titles = []
childNavPoints = self._xpath(parentNavPoint, "toc:na... |
# -*- coding: utf-8 -*-
import re
f = open('urls_6711', 'rb')
s = open('urls_6711_filtered', 'wb')
patterns = [
# 论坛 (论坛应该没有 参与改版)
r'bbs\.6711\.com\/thread-\d+-\d+-\d+.html', # bbs 帖子评论 分页
r'bbs\.6711\.com\/viewthread\.php\?.+', # 帖子
r'bbs\.6711\.com\/viewthread\.php\?extra=', # 帖子
r'bbs\.671... |
# Python
import unittest
from unittest.mock import Mock
# ATS
from pyats.topology import Device
# Metaparset
from genie.metaparser.util.exceptions import SchemaEmptyParserError, \
SchemaMissingKeyError
# Parser
from genie.libs.parser.ios.show_ntp import ShowNtpAssociation... |
import pandas as pd
import click
from astropy.table import Table
@click.command()
@click.argument('source_file_path',
type=click.Path(exists=True))
@click.argument('store_file_path',
type=click.Path(exists=False))
def main(source_file_path: str, store_file_path: str):
args = parse... |
import bz2
import json
import os
import re
import shutil
import zipfile
def unzip(path_to_zip_file):
if os.path.isfile(path_to_zip_file):
zip_ref = zipfile.ZipFile(path_to_zip_file, "r")
zip_ref.extractall(".")
shutil.rmtree("./__MACOSX")
def unbz2(path):
filesList = list()
for (... |
# Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.
# You have the following three operations permitted on a word:
# Insert a character
# Delete a character
# Replace a character
class Solution:
def minDistance(self, word1: str, word2: str... |
from z3 import *
import cairo
import math
chip_size = (30, 30)
pow_min_offset = (18, 18)
pow_sizes = [
(4, 3),
(4, 3),
]
com_sizes = [
(4, 5),
(4, 6),
(5, 20),
(6, 9),
(6, 10),
(6, 11),
(7, 8),
(7, 12),
(10, 10),
(10, 20),
]
pow_positions = [(Int(f"pow{i}_pos_x"), In... |
#!/usr/bin/env python
from cgi import parse_qs, escape
from time import sleep
import json
import os
import random
import re
from poem import *
html_template = """
<html>
<head>
<title>A simple poem generator</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel=... |
from enum import Enum
import pytest
from bs4 import BeautifulSoup
from django.contrib.auth.models import Group, User
from django_sql_dashboard.models import Dashboard
def test_anonymous_user_redirected_to_login(client):
response = client.get("/dashboard/?sql=select+1")
assert response.status_code == 302
... |
# Author: Takanori Nakane
# License: BSD-2 Clause
# Version: 0.3.20120830
'''
Dynamic Mesh
This script was tested on PyMOL 1.2 and 1.5.
Example:
run dynamic_mesh.py
fetch 1hwk, async=0
fetch 1hwk, 1hwk_map, type=2fofc, async=0
dynamic_mesh 1hwk_map, sym_source=1hwk
show sticks, resn 117
show ribbon
zoom chain A and... |
"""Tests for alpacka.training_data.replay_buffers."""
import collections
import numpy as np
import pytest
from alpacka.trainers import replay_buffers
_TestTransition = collections.namedtuple('_TestTransition', ['test_field'])
# Keep _TestTransitions with a single number in the buffer.
_test_datapoint_spec = _Test... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: vizfilter.py
# Author: Qian Ge <geqian1001@gmail.com>
import os
import scipy
import argparse
import tensorflow as tf
import config_path as config
import sys
sys.path.append('../')
from lib.nets.googlenet import BaseGoogLeNet
import lib.utils.viz as viz
import lib... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-14 17:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('builds', '0012_add-predefined-match-arg-field'),
]
operations = [
migratio... |
import telnetlib as tn
from influxdb import InfluxDBClient
import time as t
import datetime as dt
import os
import sys
import logging
from logging.handlers import TimedRotatingFileHandler
import sdnotify
from configparser import ConfigParser
influx_ip = None
influx_port = None
influx_username = None
influx_password = ... |
import math
import numpy as np
import nibabel as nib
from scipy.special import gammaln
import warnings
warnings.filterwarnings("ignore")
def spm_vol(input_file):
"""
Get header information for images
"""
v = nib.load(input_file)
return v
def spm_read_vols(mapped_image_volume):
"""
Read... |
from django.test import TestCase
from django.test.client import RequestFactory
from rest_framework.compat import patterns, url
from rest_framework.reverse import reverse
factory = RequestFactory()
def null_view(request):
pass
urlpatterns = patterns('',
url(r'^view$', null_view, name='view'),
)
class Rever... |
from .gradient_descent import GradientDescent
from .least_squares import LeastSquares
|
from aql_testcase import AqlTestCase
from aql.util_types import UniqueList, split_list_type, List, value_list_type
# ==============================================================================
class TestListTypes(AqlTestCase):
def test_unique_list(self):
ul = UniqueList([1, 2, 3, 2, 1, 3])
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint, render_template, request, session, redirect, url_for, jsonify
admin_bp = Blueprint('admin_bp', __name__)
@admin_bp.route('/')
def admin_index():
next = request.args.get('next', 'welcome')
return render_template('layout/base_iframe.ht... |
import argparse
import os
import unittest
from typing import Optional
from mock import MagicMock
from prometheus_client import REGISTRY
from bxcommon import node_runner
from bxcommon.models.node_type import NodeType
from bxcommon.services import http_service
from bxcommon.test_utils import helpers
from bxcommon.utils... |
class UnboundFormException(Exception):
"""
Raise when an unbound form (no request data) calls a member function that requires request data
"""
pass |
# Ciholas, Inc. - www.ciholas.com
# Licensed under: creativecommons.org/licenses/by/4.0
# System libraries
import numpy as np
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
# Local libraries
from cdp import PressureV2
from network_objects import *
from settings import *
class PlotPressureV2(QtGui.QMa... |
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import StaleElementReferenceException
from selenium.common.exceptions import ElementClickInterceptedException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui i... |
# Generated by Django 3.1.3 on 2020-12-30 15:35
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0012_auto_20201230_1730'),
]
operations = [
migrations.AddField(
model_name='stu... |
'''1.Faça um programa em Python que leia uma palavra pelo teclado e faça a impressão
conforme o exemplo a seguir para a palavra AMOR:
A
AM
AMO
AMOR'''
'''2.Faça um programa em Python que leia uma palavra pelo teclado e faça a impressão
conforme o exemplo a seguir para a palavra AMOR
AMOR
AMO
AM
A'''
##############... |
from decaylanguage.decay.ampgen2goofit import ampgen2goofit
try:
from pathlib2 import Path
except ImportError:
from pathlib import Path
DIR = Path(__file__).parent.resolve()
def test_full_convert():
text = ampgen2goofit(DIR / '../models/DtoKpipipi_v2.txt', ret_output=True)
with (DIR / 'output/DtoKpi... |
import torch
import torch.nn as nn
target = torch.zeros(2, dtype=torch.long)
target[0] = 1
target[1] = 2
output = torch.zeros(2,3)
output[0][0] = 0.5
output[0][1] = 0.2
output[0][2] = 0.4
output[1][0] = 0.7
output[1][1] = 0.5
output[1][2] = 0.1
criterion = nn.MultiMarginLoss(p=1, weight=torch.ones(3), margin=0.1)
... |
# -*- coding: utf-8 -*-
import scrapy
from ..items import ZomatoItem
class ZomSpideySpider(scrapy.Spider):
name = 'zom_spidey'
allowed_domains = ['zomato.com']
start_urls = ['https://www.zomato.com/mumbai/restaurants']
page_num = 2
res_link= 'nikal gaya'
city='mumbai'
def parse(self, respon... |
# coding: utf-8
# # Preamble
# In[3]:
get_ipython().run_line_magic('matplotlib', 'inline')
get_ipython().run_line_magic('config', "InlineBackend.figure_format = 'retina'")
import seaborn as sns
sns.set(style="white")
# Allows for interactive shell - outputs all non variable statements
from IPython.core.interacti... |
#!/usr/bin/env python
import socket
import sys
# Create a UDP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Bind the socket to the port
server_address = ('0.0.0.0', 10000)
print >>sys.stderr, 'starting up on %s port %s' % server_address
sock.bind(server_address)
while True:
print >>sys.std... |
from beyonic.apis.abstract_api import AbstractAPI
class Payment(AbstractAPI):
"""
Payment api wrapper class
"""
_method_path = 'payments'
|
"""
SPDX-FileCopyrightText: 2019 oemof developer group <contact@oemof.org>
SPDX-License-Identifier: MIT
"""
import filecmp
import os
from shutil import copyfile
import pandas as pd
import pytest
import requests
from windpowerlib.data import (
check_data_integrity,
check_turbine_data,
get_turbine_types,
... |
# coding:utf-8
import re
import torch
import torch.nn as nn
from torch import optim
from torch.nn import functional as F
import random
import codecs
import pathlib
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
from pathlib import Path
from functools import partial
SOS = '<sos>'
EOS = '<eos>... |
from nets.deeplab import Deeplabv3
from keras.utils.data_utils import get_file
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from PIL import Image
import time
import keras
from keras import backend as K
import numpy as np
ALPHA = ... |
from constants import GAME_SPEED
from rlbot.utils.game_state_util import GameState, GameInfoState
from controller import *
from extra_math import *
from structs import *
# Base action class
class Action:
def update(self, agent, packet):
raise NotImplementedError
# Idle is called when a maneuver has p... |
"""
The roseguarden project
Copyright (C) 2018-2020 Marcus Drobisch,
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 (at your option) any later
version.
This pr... |
# Generated by Django 3.0a1 on 2019-09-29 08:31
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='WebDevelopment',
fields=[
('id', models.Aut... |
from django.db.models import signals
from django.contrib.auth.models import User
from guardian import models as guardian_app
from guardian.conf import settings as guardian_settings
def create_anonymous_user(sender, **kwargs):
"""
Creates anonymous User instance with id from settings.
"""
try:
U... |
# Generated by Django 2.2.5 on 2020-04-07 14:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('studies', '0031_expressiondata_jbrowse_id'),
]
operations = [
migrations.AddField(
model_name='expressiondata',
name... |
from django.shortcuts import render,redirect
from django.http import HttpResponse,Http404,HttpResponseRedirect
import datetime as dt
from .forms import ImagePost, NewCommentForm, NewStatusForm
from .models import Images, Profile, Comments,Like
from django.contrib.auth.decorators import login_required
from django.contr... |
# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
from builtins import object
import arvados
import contextlib
import errno
import hashlib
import ht... |
import sympy as sp
from src.equations.symbols import *
nomoto_first_order = sp.Eq(K*delta,
r + T_1*r_1d + T_2*r_2d) |
from __future__ import annotations
import asyncio
import datetime
import logging
import dateutil
from aiohttp import ClientSession
from tenacity import retry, retry_if_exception_type
from .const import (
AUTH_ENDPOINT,
BASE_ENDPOINT,
BASE_URL,
CLIENT_HEADERS,
LATEST_OD_READ_ENDPOINT,
METER_EN... |
from sklearn.utils import shuffle
import pandas as pd
import os
import spams
from PIL import Image
import numpy as np
import cv2
import matplotlib.pyplot as plt
from skimage import io
os.environ["CUDA_VISIBLE_DEVICES"] = '0'
class TissueMaskException(Exception):
pass
###########################################... |
# Generated by Django 3.1 on 2020-08-30 05:40
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('autotasks', '0002_auto_20200701_1615'),
]
operations = [
migrations.AddField(
model_name='au... |
import scrapy
import re
from locations.items import GeojsonPointItem
class DairyQueenSpider(scrapy.Spider):
name = "dairyqueen"
allowed_domains = ["www.dairyqueen.com"]
download_delay = 1.5
start_urls = (
'https://www.dairyqueen.com/us-en/Sitemap/?localechange=1&',
)
def parse_stores... |
print('$$$ CONVERSOR DE REAL PARA DÓLAR $$$')
n = float(input('Digite o valor que deseja fazer a conversão: '))
d = n / 5.65
print('O valor de R${} reais equivale a US${:.2f} dólares'.format(n, d))
|
"""
Fetch NWP files from NCEP NOMADS for select variables. Should primarily be used
as a CLI program.
The script fetches grib2 files from NOMADS as they are available using g2sub,
uses wgrib2 to convert the grib files to netCDF (and adds wind speed),
and optimizes the netCDF file for our expected usage accessing a ti... |
'''
Contiene funciones para generar mapas coropléticos que muestran
conteos de ingresos agrupados por primera letra de CIE,
municipio del AMM y semana epidemiológica.
AMM = Área Metropolitana de Monterrey
'''
import itertools
import plotly
import plotly.graph_objects as go
import pandas as pd
import epiweeks
from f... |
import hashlib
import logging
from tornado import gen
from redistest import RedisTestCase, async_test
class ScriptingTestCase(RedisTestCase):
@async_test
@gen.engine
def test_eval(self):
script = 'return 2'
script_digest = hashlib.sha1(script).hexdigest()
results = yield gen.Tas... |
import numpy as np
import pandas as pd
import altair as alt
import pathlib
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from utils import Header, make_dash_table
# Allow large data set
alt.data_transformers.disable_max_rows()
# Get data
wine = pd.rea... |
"""Mixin classes for Renderers that plot.
"""
import os, sys, re, math, tempfile
import itertools
import numpy
from SphinxReport.ResultBlock import ResultBlock, ResultBlocks
from SphinxReportPlugins.Renderer import Renderer, NumpyMatrix
from SphinxReport.DataTree import path2str
from collections import OrderedDict as... |
from typing import List, Optional
from cloudrail.knowledge.context.aws.ec2.security_group import SecurityGroup
from cloudrail.knowledge.context.aws.indirect_public_connection_data import IndirectPublicConnectionData
from cloudrail.knowledge.context.aws.kms.kms_key import KmsKey
from cloudrail.knowledge.context.aws.net... |
from pytelegrafhttp.util import check_online
# Global default install directory for all files. Note that each specific file / directory may override where it is
# located, but by default they are all grouped together
install_dir = '/etc/pytelegrafhttp'
###############
# ENVIRONMENT #
###############
# Directory for ... |
"""
Copyright (c) 2017, Jairus Martin.
Distributed under the terms of the MIT License.
The full license is in the file LICENSE.text, distributed with this software.
Created on Aug 2, 2017
@author: jrm
"""
import markdown
from .lxml_raw import RawComponent
from web.components.md import ProxyMarkdown
class Markdown... |
# -*- coding: utf-8 -*-
import environ
# Scrapy settings for scrapy_app project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.... |
import pandas as pd
import numpy as np
from datetime import datetime
from rdflib import Graph, Literal, URIRef
from rdflib.namespace import FOAF , XSD, DC, FOAF, SKOS, RDF, RDFS
import cleansing.contact as cls_contact
from helper.functions import add_literal, concept_uri, export_data, export_df, exists_contact_cont, g... |
# Python MSI Generator
# (C) 2003 Martin v. Loewis
# See "FOO" in comments refers to MSDN sections with the title FOO.
import msilib, schema, sequence, os, glob, time, re, shutil, zipfile
from msilib import Feature, CAB, Directory, Dialog, Binary, add_data
import uisample
from win32com.client import constants
from dist... |
import torch
import torch.functional as F
from torch import nn
__all__ = ["DropBlock2D", "DropBlock3D", "DropBlockScheduled"]
class DropBlock2D(nn.Module):
r"""Randomly zeroes 2D spatial blocks of the input tensor.
As described in the paper
`DropBlock: A regularization method for convolutional networks`_... |
from file_manager import *
from centralauth import *
from cohorts import *
from tags import *
from replication_lag import *
from reports import *
from batch import *
# ignore flake8 because of F403 violation
# flake8: noqa
|
from enum import Enum
class ReturnCodes(Enum):
OK = 0
ERROR = 1
FATAL = 2
DOCKER_ERROR = 125
|
from .q_learner import QLearner
from components.episode_buffer import EpisodeBatch
import torch as th
class DCGLearner(QLearner):
""" QLearner for a Deep Coordination Graph (DCG, Boehmer et al., 2020). """
def train(self, batch: EpisodeBatch, t_env: int, episode_num: int):
""" Overrides the train met... |
import torch
from torch.utils.data.dataset import Dataset
import torchvision
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import torch.nn as nn
import torch.nn.functional as F
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor
from torchvision.utils import make_gr... |
# proxy module
from __future__ import absolute_import
from apptools.naming.adapter.api import *
|
from sys import platform
import time
from datetime import datetime as dt
redirect="127.0.0.1"
temp_host="hosts"
web_block_list=["Youtube.com","Facebook.com","Twitter.com"]
if platform == "linux" or platform == "linux2":
host_path=r"/etc/hosts"
#print("Im Here Linux")
elif platform == "darwin":
host_pa... |
import paho.mqtt.client as mqtt
import logging
# When in production change this to a non public one
host = 'broker.emqx.io'
port = 1883
keepalive = 60
topic = 'world'
def on_connect(client, userdata, flags, rc):
print("Connected with result code "+str(rc))
print(f"Connected ? {client.is_connected... |
import json
from periodic_table import ELEMENTS, lookupEle
string = []
with open("string_2.json", "r") as f:
string_2 = json.load(f)["response"]
for each in string_2:
formula = each["formula"]
string.append({lookupEle(element): number for element, number in formula.items()})
print(len(stri... |
import click
import os
import shutil
import tempfile
import zedenv.plugins.configuration as plugin_config
from typing import Tuple
from zedenv.lib.logger import ZELogger
class SystemdBoot(plugin_config.Plugin):
systems_allowed = ["linux"]
bootloader = "systemdboot"
allowed_properties: Tuple[dict] = (
... |
import sys
import termcolor
def match(target, patterns):
"""
:param patterns: the patterns to search for within the target string
:type patterns: list
:param target: the string to search within
:type target: str
"""
spans = []
current_index = 0
for pattern in patterns:
i =... |
import requests
from datetime import datetime
def weatherAPI(apikey):
with open(apikey) as f:
userkey = f.read()
datacode = 'F-C0032-001' # 一般天氣預報-今明 36 小時天氣預報
mylocation = '桃園市'
cwbpage = 'https://opendata.cwb.gov.tw/api/v1/rest/datastore/%s?Authorization=%s&locationName=%s' % (datacode, userk... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
import matplotlib as mpl
import matplotlib.gridspec as gridspec
import matplotlib
from auxFunctions import *
from function_for_si_figures import *
def getContacts_rand(nt,na,tstart,tend):
contacts=[]
for sim in range(20):
... |
from scrapy.exceptions import DropItem
from scrapy.exporters import CsvItemExporter
class ValidateItemPipeline(object):
def process_item(self, item, spider):
if not all(item.values()):
raise DropItem('Missing Values!')
else:
return item
class WriteItemPipeline(object):
... |
"""
solution AdventOfCode 2019 day 9 part 1.
https://adventofcode.com/2019/day/9
author: pca
"""
from general.general import read_file
from general.general import get_location_input_files
from app.int_machine import IntMachine
def main(args=None):
program_code = read_file(get_location_input_files(), 'input_d... |
import os
import sys
import numpy as np
import random
import matplotlib.pyplot as plt
import cv2
sys.path.append("../../")
from topview.common import get_big_data_path
from topview.datasets.common import get_cloud_itop, get_joints_itop, get_cloud_panoptic, get_joints_panoptic
ITOP = "ITOP"
PANOPTIC = "PANOPTIC"
BOTH ... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import spack
from spack.main import SpackCommand
python = SpackCommand('python')
def test_python():
out = python('-... |
from pprint import pprint
def Loop(row,col):
step=1
while True:
steps = list(range(1,step+1))
for i,j in zip(list(reversed(steps)),steps):
if (i,j) == (1,1):
prevVal=20151125
else:
nextValue = (prevVal*252533)%33554393
prevVal=nextValue
# print("({},{}) = {}".format(i,j,prevVal))
if (i,j... |
from pathlib import Path
from typing import Optional
from logger import Logger
class ConversionJob(object):
__slots__ = ["output_format", "verbose", "output_path", "file_path", "logger"]
def __init__(
self,
output_format: str,
verbose: bool,
output_path: Path,
file_path:... |
from flask import Flask, redirect, url_for, render_template, request
import pymongo
import os
from dotenv import load_dotenv
load_dotenv()
client = pymongo.MongoClient(os.getenv('MONGO_CLIENT')) #This takes the login credientials for the mongoDB from the .env file e.g. "mongodb+srv://ojas:<PASSWORD>@cluster0.kfpcm.m... |
# coding: utf-8
#------------------------------------------------------------------------------------------#
# This file is part of Pyccel which is released under MIT License. See the LICENSE file or #
# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. #
#------------------------... |
from mergers import *
def merge_data():
""" Merge all the data and export to a new file
"""
season_latin = ['2016-17', '2017-18', '2018-19', '2019-20', '2020-21', '2021-22']
encoding_latin = ['latin-1', 'latin-1', 'latin-1', 'utf-8', 'utf-8', 'utf-8']
df = pd.DataFrame()
for i,j in zip(season... |
# coding=utf-8
import os
import re
import string
from string import Template
def fun_replace(str):
"""去除list中的非单词字符和空白字符"""
str1 = re.sub(r'[^\w\s]', '', str)
return str1.strip()
def not_empty(s):
"""过滤掉空字符串"""
return s and s.strip()
# def fun_get_attri(line):
# line_list = line.split('//'... |
import numpy as np
import matplotlib.pyplot as plt
from astropy.cosmology import FlatLambdaCDM
from scipy import interpolate
import util as UT
from ChangTools.plotting import prettyplot
from ChangTools.plotting import prettycolors
def test_median():
''' Test the weighted median
'''
w = np.repeat(1., ... |
from _mycmath import add # NOQA
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: python.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflec... |
from turtle import Turtle, Screen
t = Turtle()
screen = Screen()
def move_forwards():
t.forward(10)
def move_backwards():
t.backward(10)
def turn_left():
t.left(10)
def turn_right():
t.right(10)
def clear():
t.home()
t.clear()
screen.listen()
screen.onkey(key="Up", fun=move_forward... |
#!/usr/bin/python3
# -*-coding:utf-8 -*-
# ProjectName:Zhihaofans的文件模块
# Author:zhihaofans
# PythonVersion:3.x
import os
import shutil
def read(filePath):
with open(filePath) as f:
return f.read()
def write(filePath, fileData, stopIfExisted=False):
if stopIfExisted and exists(filePath):
retu... |
import os
import sys
import launch
import launch_ros.actions
from ament_index_python.packages import get_package_share_directory
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
def generate_launch_description():
yolox_ros_share_dir = get_package_share_direc... |
# -*- coding: utf-8 -*-
from datetime import datetime
from pytz import timezone, utc
from pytz.exceptions import UnknownTimeZoneError
from bleach import linkify
from flask import g, render_template, redirect, request, Markup, abort, flash, escape
from flask_mail import Message
from coaster.utils import make_name
from... |
import torch as _torch
assert _torch.__version__ >= '1.1.0'
from .acts import *
from .op import *
from .layers import *
from .blocks import *
from .utils import *
from .optim import *
|
#!/usr/bin/env python
from __future__ import with_statement
import logging
# Library path
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# Standard libraries
import atexit
import random
import re
import socket
import threading
import time
import traceback
import weakref
import x... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.