text stringlengths 957 885k |
|---|
<reponame>dahliaOS/fuchsia-pi4
#!/usr/bin/env python3.8
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import tempfile
import shutil
import tarfile
import unittest
from unittest import mock
from... |
"""This module contains the general information for ProcessorSecurityStats ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class ProcessorSecurityStatsConsts:
SUSPECT_FALSE = "false"
SUSPECT_NO = "no"
SUSPECT_TRUE =... |
# Copyright (c) 2021-2021, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions an... |
from math import exp, log, pi, sqrt
from typing import List, Tuple
__all__ = ["Glicko2Entry", "glicko2_update", "glicko2_configure"]
EPSILON = 0.000001
# TAO = 1.2
TAO = 0.5
LOSS = 0.0
DRAW = 0.5
WIN = 1.0
MAX_RD = 500.0
MIN_RD = 30.0
MIN_VOLATILITY = 0.01
MAX_VOLATILITY = 0.15
MIN_RATING = 100.0
MAX_RATING = 6000.0... |
"""
Credits:
Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME> (Sinergise)
Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise)
Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME> (Sinergise)
This source code is licensed under the MIT license found in the LICENSE
file in the root director... |
<filename>etc/fixtures/generate_data.py
# Generate a fake database for the django application
import datetime
import glob
import lipsum
import json
import osmapi
import sys
import argparse
from nominatim import Nominatim
import os
import random
def basename(x):
# Returns the basename of a file
return os.path.s... |
<reponame>GC-HBOC/HerediVar<gh_stars>0
from os import path
import sys
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import argparse
import common.functions as functions
import json
parser = argparse.ArgumentParser(description="")
parser.add_argument("-i", "--input", default="", help="path to in... |
<reponame>djmattyg007/dreg-client<filename>dreg_client/client.py
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Callable, Dict, Optional, Sequence, TypedDict, cast
from requests import HTTPError, RequestException, Response
from requests_toolbelt.sessions import BaseUrlSession
fro... |
"""Process DynamoRIO's instr_create.h file and generate a simplied
instruction creation API for use by Granary.
Author: <NAME> (<EMAIL>)
Copyright: Copyright 2012-2013 <NAME>, all rights reserved.
"""
import re
# Generated source files.
code = open('granary/gen/instruction.cc', 'w')
header = open('granary/... |
import os
import csv
import json
import logging
import types
import subprocess
import datetime
import shlex
import traceback
import time
from os.path import join
from django.conf import settings
from collections import OrderedDict
from django.db import transaction
from django.db.utils import IntegrityError
from twora... |
import cv2
import numpy as np
from PIL import Image
import os
# CALCULA A IOU MÉDIA DA MASCARA DO COLOR_CLASSIFIER COM O GROUND TRUTH
# img = cv2.imread('images/mask.jpg')
# gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# output = gray_img
#
# img = cv2.imread('../segmentation_dataset/ground_truth/fire000_gt.png')... |
<reponame>FernandoZhuang/Emotion-recognition-of-netizens-during-the-epidemic
'''
Learn from
https://mccormickml.com/2019/07/22/BERT-fine-tuning/#1-setup
https://towardsdatascience.com/bert-classifier-just-another-pytorch-model-881b3cf05784
Depreciated
先验知识 bayes相关函数
动态batchsize
时间层面特征
'''
import to... |
"""NSGA-II related functions"""
import functools
from nsga2.population import Population
import random
from examples.interfaceTriclusteringNSGAII import InterfaceTriclusteringNSGAII as InterfaceTrNSGA
import examples.triclusteringPlusAffiramationScore as tr
from examples.triclusteringPlusAffiramationScore import Tricl... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 5 18:11:33 2016
@author: johnlewisiii
"""
import math
import os
import statistics
import sys
from importlib import reload
import emcee
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import numpy as ... |
from civicboom.lib.base import *
from cbutils.misc import make_username
from civicboom.model import User, Group
from civicboom.lib.authentication import get_user_from_openid_identifyer, get_user_and_check_password, signin_user, signin_user_and_redirect, signout_user, login_redirector, set_persona
from civicboom.lib.... |
#! /usr/bin/env python3
# ============================================================================
# Copyright 2021 <NAME>
#
# Licensed under the 3-Clause BSD License.
# (See accompanying file 3_CLAUSE_BSD_LICENSE.txt or
# <https://opensource.org/... |
<reponame>hadware/pyannote-audio
# MIT License
#
# Copyright (c) 2020-2021 CNRS
#
# 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
... |
# Copyright 2021 The Private Cardinality Estimation Framework 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
#!/usr/bin/env python3
import torch
import itertools
from collections import defaultdict
from .lazy_tensor import LazyTensor, delazify
from .non_lazy_tensor import lazify
class CatLazyTensor(LazyTensor):
r"""
A `LazyTensor` that represents the concatenation of other lazy tensors.
Each LazyTensor must hav... |
import re
import tempfile
import typing as tp
import webbrowser
from functools import cached_property
from typing import TYPE_CHECKING
from urllib.parse import urljoin
import httpx
from bs4 import BeautifulSoup, Tag
from robox._controls import Submit
from robox._form import Form
from robox._link import (
Link,
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Indictrans and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
#from erpnext.utilities.address_and_contact import ... |
<reponame>fluiddyn/transonic<gh_stars>10-100
"""Capture the external nodes used in functions
===============================================
"""
import gast as ast
from transonic.analyses import beniget
from transonic.analyses import extast
class CaptureX(ast.NodeVisitor):
"""Capture the external nodes used in ... |
<filename>loxpy/Parser.py
from typing import List
from .Expr import *
from .ParserError import ParseError
from .Stmt import *
from .Tokens import TokenType, Token
class Parser:
def __init__(self, tokens: List[Token]):
self.tokens = tokens
self.current = 0
# expression -> equality ;
def e... |
<filename>Parallel_ACO_Solver/Docker-master/master.py
import json
import logging
import os
import random
import socket
import string
# import hug
import sys
from collections import namedtuple
from threading import Thread
logging.getLogger("falcon").setLevel(logging.WARNING)
input_problem = 'text_problem_good.txt'
NOD... |
<reponame>DiceNameIsMy/recruiting<gh_stars>0
# Generated by Django 3.2.4 on 2021-06-27 14:44
from django.db import migrations, models
import recruiting.utils.handler
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... |
from django.shortcuts import render
from django.http import JsonResponse, HttpResponse
from django.apps import apps
from django.core import serializers
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from django.db.models import Q
... |
import logging
import sys
import os
import requests as req
from collections import OrderedDict
import cartosql
import lxml
from xmljson import parker as xml2json
from dateutil import parser
import requests
import datetime
import json
# do you want to delete everything currently in the Carto table when you run this scr... |
<gh_stars>0
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from textwrap import dedent
from typing import Iterable
import pytest
from pants.backend.codegen.protobuf import protobuf_dependency_infere... |
<filename>verification/testcases/functional_testcases/test_duns_verification.py
import json
from datetime import datetime
from unittest import TestCase
from unittest.mock import patch, Mock
from uuid import uuid4
from verification.application.handlers.verification_handlers import initiate, callback
from verification.a... |
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
<reponame>benety/mongo
# Copyright (C) 2021-present MongoDB, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the Server Side Public License, version 1,
# as published by MongoDB, Inc.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ... |
<reponame>naveenjafer/language
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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
#
# http://www.apache.org/licenses/LICE... |
<reponame>tlb-lab/credoscript<filename>credoscript/models/structure.py
from sqlalchemy import Integer, select
from sqlalchemy.sql.expression import and_, cast
from sqlalchemy.orm import backref, deferred, relationship
from sqlalchemy.orm.collections import attribute_mapped_collection
from credoscript import Base, sche... |
<reponame>kadenP/TheRoleOfBuildingsInAChangingEnvironmentalEra_PleweMSThesis
'''
<NAME>
3/5/2019
Optimization Model for SEB Single Thermal Zone Building
This will define an optimization problem based on the small office EnergyPlus model. It will be passed into
the optimization algorithm directly.
idf location: ... |
<filename>src/nlplib/general/unittest.py
''' This module handles unit testing for the package. If this module is ran as a script, it will run all of the tests
for the entire package. These tests are denoted by the <__test__> module level functions. '''
import unittest
import pkgutil
import warnings
__all__ = ['U... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pandas as pd
import math
import sklearn.preprocessing as sk
import seaborn ... |
<reponame>openvax/isovar<filename>test/test_variant_reads_with_dummy_samfile.py
from __future__ import print_function, division, absolute_import
from nose.tools import eq_
from varcode import Variant
from isovar.allele_read import AlleleRead
from isovar.read_collector import ReadCollector
from mock_objects import Mo... |
<reponame>chapuzzo/quicktracer<filename>quicktracer/displays.py
from collections import deque
import pyqtgraph as pg
# Protocol constants (duplicated because of import problems)
KEY = 'k'
VALUE = 'v'
TIME = 't'
CUSTOM_DISPLAY = 'custom_display'
DEFAULT_MAX_DATA_SERIES_LENGTH = 1000
view_boxes = {}
class Display():
... |
<gh_stars>0
#!/usr/bin/env python
"""
update_dreqs_0194.py
Create an issue for EC-Earth3P-HR highresSST-future r1i1p1f1 v20190514 about
a metadata issue.
"""
import argparse
import logging.config
import os
import sys
from cf_units import date2num, CALENDAR_GREGORIAN
import django
django.setup()
from django.contrib.... |
from atlas_helper_methods import AtlasHelper
import requests
from requests.exceptions import ConnectionError, HTTPError, Timeout
import collections
from collections import defaultdict
import sys
import json
from json import loads
import memcache
import threading
from threading import Thread, Lock
from aws_helper import... |
<filename>notebooks/Python/2 Statistical Learning/2.3 Lab - Introduction to Python.py
# coding: utf-8
# ## 2.3 Lab: Introduction to Python
# ### 2.3.1 Basic Commands
# In[1]:
import numpy as np # for calculation purpose, let use np.array
import random # for the random
# In[2]:
x = np.array([1, 3, 2, 5])
... |
<reponame>Itskaleem/NetworkSimulator<gh_stars>0
from scipy.constants import Planck, pi, c
from scipy.special import erfcinv
import numpy as np
import pandas as pd
import json
from random import shuffle
import matplotlib.pyplot as plt
import itertools as it
import copy
class Lightpath(object):
def __init__(self, p... |
<filename>NewServer.py<gh_stars>0
#!/usr/bin/python
import datetime
import sys
import os
import json
execfile('newSearch.py')
from config import port
import math
from flask import Flask
from flask import request
from flask.ext.cors import CORS, cross_origin
from loadManager import DataManager
app = Flask(__name__)
co... |
<reponame>ewanbarr/mpikat<gh_stars>1-10
import mock
import re
import json
from tornado.gen import coroutine, Return, sleep
from tornado.testing import AsyncTestCase
from katcp.testutils import mock_req, handle_mock_req
from katpoint import Target
from mpikat.meerkat.fbfuse import BaseFbfConfigurationAuthority
from mpik... |
<reponame>nipunagarwala/cs273b_final_project
import numpy as np
import os
import json
import csv
import argparse
BRAIN_DIR = os.path.abspath('/data/originalfALFFData')
BRAIN_DIR_AUG_ALL = os.path.abspath('/data/augmented_swap_all')
BRAIN_DIR_AUG_PARTIAL = os.path.abspath('/data/augmented_swap_partial')
# BRAIN_DIR_AU... |
import statistics
from django.contrib import admin
from django.db import models
from django.db.models import Count
from django.db.models.functions import Lower
from django.utils.html import format_html
from allianceauth.eveonline.models import EveAllianceInfo, EveCorporationInfo
from allianceauth.services.hooks impor... |
#!/usr/bin/env python3
from abc import ABC
from argparse import ArgumentParser
from datetime import datetime
from functools import wraps
from itertools import islice
from multiprocessing import Pool, Value
import time
from cassandra import ConsistencyLevel
from cassandra.cluster import Cluster
from cassandra.concurr... |
import DistributedLawnDecor
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.ShowBase import *
from direct.interval.IntervalGlobal import *
import GardenGlobals
from toontown.toonbase import TTLocalizer
from toontown.estate import PlantingGUI
from toontown.estate import PlantTreeGUI
from toontown... |
<reponame>py4/SFUTranslate
"""
The class in charge of padding , batching, and post-processing of the created instances in the dataset reader
"""
from typing import Union, List, Tuple
from translate.readers.constants import InstancePartType
from translate.readers.datareader import AbsDatasetReader
from translate.backen... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
zine.database
~~~~~~~~~~~~~
This module is a rather complex layer on top of SQLAlchemy 0.4.
Basically you will never use the `zine.database` module except you
are a core developer, but always the high level
:mod:`~zine.database.db` module which you can im... |
<gh_stars>0
import base64
from io import BytesIO
import time
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
from PIL import Image
import requests
from model import detect, filter_boxes, detr, trans... |
#coding=utf-8
# Copyright 2017 - 2018 Baidu 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 law or ag... |
from pyehr.ehr.services.dbmanager.drivers.factory import DriversFactory
from pyehr.utils import get_logger
from pyehr.ehr.services.dbmanager.dbservices.index_service import IndexService
from pyehr.ehr.services.dbmanager.dbservices.wrappers import PatientRecord, ClinicalRecord
from pyehr.ehr.services.dbmanager.errors im... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
from django.test import TestCase
import mock
import datetime
from dateutil import tz
## Repository Test
from porchlightapi.models import Repository
# Constant values used for testing
UNDEPLOYED_VALUE_TUPLE = ('c9d2d5b79edd7d4acaf7172a98203bf3aee2586a',
... |
<gh_stars>10-100
import shutil
import subprocess
from enum import Enum
import pytest
from laia.common.arguments import DecodeArgs
from laia.scripts.htr.decode_ctc import get_args
def test_get_args():
args = get_args(
argv=[
"syms",
"img_list",
"--common.checkpoint=mod... |
<filename>codes/run_main_v2.py
# %%
"""# Interdependent Network Mitigation and Restoration Decision-making (Complete Analysis Dashboard) This notebook
finds mitigation actions and restoration plans for synthetic or infrastructure interdependent networks subject to
different initial seismic damage scenarios. Various res... |
from enum import Enum
from math import radians, sin, cos
from time import sleep
import cv2
import numpy as np
from functions import pinhole_projection
from pid import PID
from vrep_object import VRepClient, VRepObject
class Visibility(Enum):
VISIBLE = 1
NOT_VISIBLE = 2
UNREACHABLE = 3
class Drone(VRep... |
# Copyright 2021 The TEMPO Collaboration
#
# 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... |
<gh_stars>10-100
# coding: utf-8
'''
Module for composite material analysis
Hyer-Stress Analysis of Fiber-Reinforced Composite Materials
Herakovich-Mechanics of Fibrous Composites
Daniel-Engineering Mechanics of Composite Materials
Kollar-Mechanics of COmposite Structures
NASA- Basic Mechancis of Lamianted C... |
import copy
import itertools
from graph_generator import generate_complete_graph
from models import LinearLayout, Graph
from view import show_linear_layouts
def observation_1(show_layouts=True):
"""
Generate all possible 2-stack 1-queue layouts of a complete graphs with
8 vertices. Except that edges (i, ... |
from django.test import TestCase, RequestFactory
from django.core.urlresolvers import reverse
from django.test.client import Client
from django.contrib.auth.models import User
from django.db import models
from . import models
from gallery.models import Album
from events.models import Event
from bot.models import Telegr... |
<reponame>salman-ahmed-sheikh/gpt-2
#!/usr/bin/env python3
import fire
import json
import os
import numpy as np
import tensorflow as tf
from google_trans_new import google_translator
import csv
import random
import model, sample, encoder
def translate(items):
translator = google_translator()
if type(items) =... |
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 <NAME> <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free So... |
<filename>retro_data_structures/formats/mrea.py<gh_stars>0
"""
Wiki: https://wiki.axiodl.com/w/MREA_(Metroid_Prime_2)
"""
import hashlib
import io
import construct
from construct import (
Int32ub, Struct, Const, Float32b, Array, Aligned, GreedyBytes, ListContainer, Container, Rebuild,
Tell, Computed, FocusedSe... |
# -*- coding: utf-8 -*-
"""Computes symmetrical RCC3 relations: 'dc':disconnected, 'po':partial overlap, 'o': occluded/part of
:Author: <NAME> <<EMAIL>>
:Organization: University of Leeds
:Date: 10 September 2014
:Version: 0.1
:Status: Development
:Copyright: STRANDS default
:Notes: future extension to handle polygons... |
<filename>wrappers/python/virgil_crypto_lib/foundation/aes256_cbc.py<gh_stars>10-100
# Copyright (C) 2015-2021 Virgil Security, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1)... |
<reponame>jpodivin/pystrand
import multiprocessing as mp
import uuid
from pystrand.populations import BasePopulation
from pystrand.selections import RouletteSelection, ElitismSelection, BaseSelection
from pystrand.mutations import BaseMutation, PointMutation
from pystrand.loggers.csv_logger import CsvLogger
from pystr... |
<reponame>titonbarua/sphotik
import os.path
import sqlite3
import logging
from collections import deque, Counter
class HistoryManager:
SCHEMA = """
CREATE TABLE history(
roman_text TEXT NOT NULL,
bangla_text TEXT NOT NULL,
usecount INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY (rom... |
<gh_stars>1-10
import itertools
import logging
import os
import shutil
from typing import List, Tuple, Dict, TypeVar, Generator
import numpy as np
from .segment_quality_utils import HMMSegmentationQualityCalculator
from .. import types
from ..io import io_consts, io_commons, io_denoising_calling, io_intervals_and_cou... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016, <NAME>
# All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE S... |
# -*- coding: utf-8 -*-
# Copyright 2018 FanFicFare team
#
# 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 ... |
import os
import torch
import numpy as np
import numpy.random as rd
class ReplayBuffer:
def __init__(self, max_len, state_dim, action_dim, if_use_per, gpu_id=0, state_type=torch.float32):
"""Experience Replay Buffer
save environment transition in a continuous RAM for high performance training
... |
<gh_stars>1-10
class TreeFragment:
"""(Abstract) empty sentence fragment"""
def __init__(self, tree):
"""
Construct a sentence tree fragment which is merely a wrapper for
a list of Strings
Args:
tree (?): Base tree for the sentence fragment, type depends on
... |
# -*- coding: utf-8 -*-
"""
oy.models.mixins.polymorphic_prop
~~~~~~~~~~
Provides helper mixin classes for special sqlalchemy models
:copyright: (c) 2018 by <NAME>.
:license: MIT, see LICENSE for more details.
"""
import sqlalchemy.types as types
from sqlalchemy import literal_column, event
from... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Various utils and helpes used by AS3 Ninja
"""
# pylint: disable=C0330 # Wrong hanging indentation before block
# pylint: disable=C0301 # Line too long
# pylint: disable=C0116 # Missing function or method docstring
import json
import sys
from functools import wraps
from typi... |
<reponame>yuxuan-du/Robust-quantum-classifier
import pennylane as qml
from pennylane import numpy as np
import os
# load synthetic dataset based on the paper 'Supervised learning with quantum-enhanced feature spaces'
data_all = np.load('data.npy')
label_all = np.load('label.npy')
data_train, label_train = data_all[:... |
<filename>bot.py
from fuzzywuzzy import process
import logging, os, discord, asyncio,sys,csv
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
FIREFOX_PATH = r'C:\Program Files\Mozilla Firefox\firefox.exe'
GECKODRIVER_PATH = r'C:\geckodriver.exe'
cachefolder = os.getcwd... |
# -*- coding: utf-8 -*-
import scrapy
from lianjia.items import ResidenceInfoItem
import datetime
from lianjia.Exception.emailSender import emailSender
city_dict = {
'bj.lianjia': u'北京', 'sh.lianjia': u'上海', 'xm.lianjia': u'厦门', 'nj.lianjia': u'南京', 'cd.lianjia': u'成都', 'qd.lianjia': u'青岛',
'wh.lianjia': u'武汉... |
<filename>make_style_dataset.py
import os, json, argparse
from threading import Thread
from queue import Queue
import numpy as np
from scipy.misc import imread, imresize
import h5py
"""
Create an HDF5 file of images for training a feedforward style transfer model.
Original file created by <NAME> available at:
https:/... |
<reponame>dnabanita7/PySyft
# stdlib
from abc import ABC
from collections import OrderedDict
from collections import UserDict
from collections import UserList
from collections import UserString
from typing import Any
from typing import Optional
from typing import Union
# syft relative
from .. import python
from ...cor... |
<filename>src/external/coremltools_wrap/coremltools/coremltools/test/pipeline/test_model_updatable.py
# Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
imp... |
# Copyright 2017 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
# Asset manager provides tools for managing a local database of
# photos, that are tagged with point information. These photos can
# then be used in other commands, without us having to specify via the
# command line.
import pickle
import collections
import os
from pathlib import Path
from typing import List, Tuple
fr... |
from typing import Dict, Union
import gym
import numpy as np
from stable_baselines3.common.type_aliases import GymObs, GymStepReturn
class TimeFeatureWrapper(gym.Wrapper):
"""
Add remaining, normalized time to observation space for fixed length episodes.
See https://arxiv.org/abs/1712.00378 and https://g... |
<gh_stars>0
#!/usr/bin/env python
# Copyright 2007 The Spitfire Authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builti... |
import math
import torch
from torch import nn
import torch.nn.functional as F
class AAEmbeddings(nn.Module):
def __init__(self, embed_dim):
super(AAEmbeddings, self).__init__()
self.embed_dim = embed_dim
self.onehot = nn.Embedding(21, 21)
self.onehot.weight.data = torch.eye(21)
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013, <NAME>
# Author: <NAME> <<EMAIL>>
import collections
import serial
import threading
import time
import constants
# Override thread quit exception handler
class ThreadQuitException(Exception):
pass
class BLEParser(threading.Thread):
"""
A parser for... |
#!/usr/bin/env python
# coding: utf-8
import pickle
import numpy as np
import pandas as pds
from pyro.ops.stats import quantile
from scipy.stats import norm
import data_loader
import pyro_model.helper
# ## loading data
countries = [
'United Kingdom',
'Italy',
'Germany',
'Spain',
'US',
'Fr... |
<reponame>BixinKey/electrum
import abc
import base64
import logging
from typing import Any, Dict, Iterable, List
from pycoin.coins.bitcoin import Tx as pycoin_tx
from trezorlib import btc as trezor_btc
from trezorlib import messages as trezor_messages
from electrum_gui.common.basic import bip44
from electrum_gui.comm... |
<gh_stars>0
from kivy.lang import Builder
from kivy.uix.scrollview import ScrollView
from kivy.uix.label import Label
from kivy.metrics import sp
from kivy.properties import (
StringProperty, ObjectProperty, BooleanProperty,
NumericProperty, ListProperty
)
from json import dumps
from kivy_modules.behavior.textb... |
<filename>shard/config/database_config.py<gh_stars>10-100
import copy
import urllib.parse
from typing import Dict, List, Optional, Tuple
from dj_database_url import config
from shard.constants import DATABASE_CONFIG_MASTER, DATABASE_CONFIG_SHARD_GROUP, DATABASE_CONFIG_SHARD_NUMBER
__all__ = ('make_shard_configuratio... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 19 06:54:04 2020
@author: <NAME>
## TARNSFERRED TO PYQT GUI
"""
import time, datetime
import requests#, threading
import sys
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QApplication, QMainWindow,\
QPushButton, QWidget... |
<filename>unittests/test_discord.py
import time
import logging
import os
import socket
import unittest
import yaml
from mock import mock
from octoprint_discordremote.discord import Discord
from octoprint_discordremote.embedbuilder import EmbedBuilder, upload_file, DISCORD_MAX_FILE_SIZE
from unittests.discordremotetes... |
<gh_stars>1-10
import json
import torch
from utils.diffquantitative import DiffQuantitativeSemantic
K=10
class Car:
""" Describes the physical behaviour of the vehicle """
def __init__(self):
self._max_acceleration = 20.0
self._min_acceleration = -self._max_acceleration
self._max_veloc... |
<gh_stars>1-10
import math
import random
import string
import unittest
import itertools
import contextlib
import warnings
import pickle
from copy import deepcopy
from itertools import repeat, product
from functools import wraps, reduce
from operator import mul
from collections import OrderedDict
import hashlib
import o... |
import os
import sys
import inquirer
from colorama import Fore, Style
from .constants import ProjInfo
def print_blue(text):
print(Fore.BLUE + text + Style.RESET_ALL)
def print_red(text):
print(Fore.RED + text + Style.RESET_ALL)
def print_yellow(text):
print(Fore.YELLOW + text + Style.RESET_ALL)
def print_gre... |
<gh_stars>0
from model import Item
import inspect
import os
import random
import sqlite3
import string
CHARS = string.ascii_letters + string.digits + string.punctuation
PASSWORD_LENTH = 10
# create dir for db
filename = inspect.getframeinfo(inspect.currentframe()).filename
path = os.path.dirname(os.path.abspath(filena... |
"""This module includes some general-purpose utility functions and classes
"""
import os
import shutil
import socket
import pickle
import logging
import time
from multiprocessing import Process, Queue
from queue import Empty
__all__ = [
"ParallerRunner",
"SocketCollector",
"TestDirectory",
]
class Socke... |
<reponame>InsightLab/pymove-osmnx
import numpy as np
from pandas import DataFrame, Timestamp
from pandas.testing import assert_frame_equal
from pymove.core.dataframe import MoveDataFrame
from pymove_osmnx.utils.interpolate import (
check_time_dist,
feature_values_using_filter,
fix_time_not_in_ascending_ord... |
"""Plays a list of files from the local filesystem, with interactive options."""
import logging
import os
import sys
from multiprocessing import Process
from os import chdir, name, path, scandir
from pathlib import Path
from random import choice, sample
from typing import List
from soco import SoCo # type: ignore
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.