text stringlengths 957 885k |
|---|
import datetime
from flask import render_template, flash, redirect
from flask_login import login_required, login_user, logout_user, current_user
from app import app, db, lm, bcrypt
from .forms import SpeakerForm, LoginForm, ChangePwdForm
from .models import Submission, User, Vote
from config import appConfiguration, lo... |
# Classes are defined with "class" keyword.
# "self" keyword denotes an object that was just created.
# "width" and "height" are going to be properties of the class "Rectangle".
class Rectangle:
def __init__(self, width, height):
self.width = width
self.height = height
# Object can be initialize... |
import numpy as np
from sklearn.model_selection import train_test_split
from torch.utils.data import Dataset
from sklearn.model_selection import PredefinedSplit
UNLABELLED_CLASS = -1
def merge_train_dev(train, dev):
"""
Merge the train and dev `skorch.Dataset` and return the associated
`sklearn.model_sel... |
#!/usr/bin/env python
# vim:ts=4:sts=4:sw=4:et
# args: harisekhon
#
# Author: <NAME>
# Date: 2016-05-27 13:15:30 +0100 (Fri, 27 May 2016)
#
# https://github.com/harisekhon/devops-python-tools
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on L... |
<gh_stars>0
#!/usr/bin/env python
#===========================================================================
#
# Plot Ray details for KDP analysis
#
#===========================================================================
import os
import sys
import subprocess
from optparse import OptionParser
import numpy as n... |
from device import *
from usb2iic import *
from logger import *
from bme680_defs import *
import time
from ctypes import *
import platform
import globalvar
from save_data import *
globalvar._init()
BME680_lock = Lock()
#根据系统自动导入对应的库文件,若没能识别到正确的系统,可以修改下面的源码
if(platform.system()=="Windows"):
if "64bit" in platform... |
<reponame>juliusf/Neurogenesis<gh_stars>1-10
import re
import sys
import os
from neurogenesis.util import Logger
def extract(scalars_file, simulations):
scalars = []
scalars_file = open(scalars_file, "rb")
[scalars.append(scalar.rstrip()) for scalar in scalars_file]
scalars_file.close()
for simul... |
<reponame>abollu779/brain_language_nlp
import numpy as np
from scipy import stats
import torch
import torch.nn as nn
from torch.optim import Optimizer
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
class MLPEncodingModel(nn.Module):
def __init__(self, input_size, hidden_sizes, output_size... |
"""
Title: Neural style transfer
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2016/01/11
Last modified: 2020/05/02
Description: Transfering the style of a reference image to target image using gradient descent.
"""
"""
## Introduction
Style transfer consists in generating an image
with the same "con... |
<reponame>martimunicoy/offpele-benchmarks
class MoleculeMinimized:
"""
It contains all the tools to minimize a molecule with the OpenForceField toolkit for PELE.
"""
def __init__(self, input_file, PELE_version):
"""
It initializes a MocelueMinimized object.
Parameters:
----------
input_file: PDB with t... |
# -*- coding: utf-8 -*-
import torch
import time
import numpy as np
from collections import namedtuple
from duelling_network import DuellingDQN
N_Step_Transition = namedtuple('N_Step_Transition', ['S_t', 'A_t', 'R_ttpB', 'Gamma_ttpB', 'qS_t', 'S_tpn', 'qS_tpn', 'key'])
class Learner(object):
def __init__(self, e... |
__author__ = 'frieder'
from PyQt4 import QtCore, QtGui, Qwt5
from guiqwt.plot import CurvePlot, PlotManager, CurveDialog
from guiqwt.tools import SelectPointTool
from guiqwt.builder import make
import numpy as np
import logic.DataFlowControl as DataController
class Ui_PlotWidget_Feature_Set(QtGui.QWidget):
""""""... |
<reponame>shanks2999/SearchEngine
import settings
import preprocess
import urllib.request
from urllib.request import urlopen
import requests
from bs4 import BeautifulSoup
from bs4.element import Comment
import urllib.request
import httplib2
h = httplib2.Http()
myList = []
def tag_visible(element):
if element.pa... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05_classification.core.ipynb (unless otherwise specified).
__all__ = ['pil_loader', 'cv2_loader', 'denormalize', 'show_image_batch', 'DatasetDict', 'ClassificationMapper',
'ClassificationDataset', 'FolderParser', 'PandasParser', 'CSVParser']
# Cell
import log... |
#=======================================================================================================================
#
# ALLSorts v2 - Find Centroids
# Not all subtypes are destined to be classified by a small set of genes, they are defined by group membership.
#
# Author: <NAME>
# License: MIT
#
#=========... |
import sys, os, re, time, math, random, struct, zipfile, operator, csv, hashlib, uuid, pdb, types
import settings, logging
from collections import defaultdict
sys.path.insert(0, 'libs')
from bs4 import BeautifulSoup
from utils.deferred import deferred
logging.basicConfig(filename=settings.LOG_FILENAME, level=logging.... |
<reponame>WxBDM/nwsapy<gh_stars>1-10
# General file structure:
# Request error object
# Individual components of the module
# Base endpoint
# All endpoints associated with /path/to/endpoint
import shapely
from shapely.geometry import Point
from datetime import datetime
from collections import OrderedDict
from ... |
<reponame>rimmartin/cctbx_project<gh_stars>0
from __future__ import division
from mmtbx.disorder import backbone
import iotbx.pdb.hierarchy
from cStringIO import StringIO
pdb_raw = """
CRYST1 21.937 6.000 23.477 90.00 107.08 90.00 P 1 21 1 2
ATOM 1 N GLY A 1 -9.009 4.612 6.102 1.00 1... |
<gh_stars>0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy2 Experiment Builder (v1.85.2),
on August 14, 2018, at 13:42
If you publish work using this script please cite the PsychoPy publications:
<NAME> (2007) PsychoPy - Psychophysics software in Python.
Jo... |
# coding: utf-8
"""
Kintone REST API
Kintone REST API # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from openapi_client.configuration import Configuration
class InlineResponse200(object)... |
<filename>PicACG.py
#!/usr/bin/env python3
import hmac
import time
import json
import uuid
import urllib.parse
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
# 关闭安全请求警告
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
class Pica(object):
def __init__... |
<reponame>vahidrnaderi/django-shop
from django.utils import timezone
from rest_framework import serializers
from shop.conf import app_settings
from shop.shopmodels.cart import CartModel
# from shop.shopmodels.defaults.cart import Cart
from shop.shopmodels.order import OrderModel
# from shop.shopmodels.defaults.order im... |
<filename>countess/tests/utilities.py
"""
Enrich2 tests utils module
==========================
Module consists of assorted utility functions.
"""
import os
import json
import pandas as pd
from ..base.config_constants import SCORER, SCORER_OPTIONS, SCORER_PATH
from ..base.config_constants import FORCE_RECALCULATE, C... |
# Standard Library
import io
import json
import logging
import sys
# external
import cybox.utils.caches
from sdv import codes, errors, scripts
import stix2
# internal
from stix2slider.convert_stix import convert_bundle
from stix2slider.options import (
get_option_value, get_validator_options, setup_logger
)
# Mo... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import argparse
import codecs
import logging
import os
import os.path
import re
import shutil
import subprocess
import sys
import t... |
<reponame>JamesG3/Checkers_AI
class Piece(object):
'''
two type of players: black and white
'''
def __init__(self, player):
self.player = player
class Grid(object):
'''
each grid has one color: W - white / B - black
a grid may point to a piece object
'''
def __init__(self, color, piece = None):
self.color... |
<gh_stars>0
import datetime
from google.cloud import datacatalog_v1
class Client:
def __init__(self, project_id: str, region: str) -> None:
self.client = datacatalog_v1.DataCatalogClient()
self.project_id = project_id
self.region = region
def get_entry_group(self, entry_group_id: str)... |
<gh_stars>1-10
#coding=utf-8
'''
Created on 2015-10-10
@author: Devuser
'''
class CITemplatePath(object):
left_nav_template_path = "ci/ci_left_nav.html"
class CIDashBoardPath(CITemplatePath):
dashboard_index_path = "dashboard/ci_dashboard_index.html"
task_queue_webpart="dashboard/ci_dashboard_task... |
<reponame>dmitrii/eucaconsole
# -*- coding: utf-8 -*-
# Copyright 2013-2017 Ent. Services Development Corporation LP
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code ... |
<filename>tf_keras/prunned/keras_finetune_prune.py
import sys
import os.path
import os
#os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import math
import numpy as np
import re
import glob
import argparse
import warnings
import time,datetime
from random import shuffle,seed
from sklearn.metrics import recall_score,accuracy_s... |
<gh_stars>1-10
from sympy.core.logic import (fuzzy_not, Logic, And, Or, Not, fuzzy_and,
fuzzy_or, _fuzzy_group)
from sympy.utilities.pytest import raises
T = True
F = False
U = None
def test_fuzzy_group():
from sympy.utilities.iterables import cartes
v = [T, F, U]
for i in cartes(*[v]*3):
ass... |
<filename>mir_eval/segment.py
# CREATED:2013-08-13 12:02:42 by <NAME> <<EMAIL>>
'''
Evaluation criteria for structural segmentation fall into two categories:
boundary annotation and structural annotation. Boundary annotation is the task
of predicting the times at which structural changes occur, such as when a verse
tr... |
"""
Coordinates System Transformations
==================================
Defines the objects to apply transformations on coordinates systems.
The following transformations are available:
- :func:`colour.algebra.cartesian_to_spherical`: Cartesian to spherical
transformation.
- :func:`colour.algebra.spherical... |
<reponame>jmaces/aapm-ct-challenge
import os
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
from tqdm import tqdm
from operators import FanbeamRadon, l2_error
# ----- ----- Abstract Base Network ----- ... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""
@Author: <NAME>
@Date: 06-Apr-2017
@Email: <EMAIL>
# @Last modified by: <NAME>
# @Last modified time: 08-Apr-2017
@License: Apache License Version 2.0
@Description:
"""
from distutils.core import setup
required = ['aiofiles>=0.3.1',
'aiomysql>=0.0.9... |
import asyncio
import json
import os
import random
import aiohttp
import discord.errors
import requests
from discord.ext import commands
reactions_random = ['👋', '♥', '⚡']
class Errors(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_message(self, me... |
<gh_stars>1-10
"""
References:
[1] <NAME> - Wind Turbine Aerodynamics and Vorticity Based Method, Springer, 2017
[2] <NAME>, <NAME> - Cylindrical vortex wake model: skewed cylinder, application to yawed or tilted rotors - Wind Energy, 2015
Coordinate systems
c coordinate system used in see [2], rotor in pla... |
#!/usr/bin/env python
from __future__ import division, print_function
from collections import defaultdict
import itertools
import numpy as np
from scipy import interp
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import seaborn.apionly as sns
from sklearn.metrics imp... |
# client.py
import socket
import time
import os
import configparser
import DBC.config as cf
import sqlite3 as lite
class pushdb():
confclient = cf.config()
# confclient.readconfig()
print(confclient.gethost())
print(confclient.getuser())
host = confclient.gethost()
user = confclient.getuser(... |
<reponame>DAtek/symbol-detector<gh_stars>0
from asyncio import sleep, create_task, run, Task
from queue import Queue
from threading import Thread
from typing import Optional
import cv2.cv2 as cv2
import numpy as np
from symbol_detector.core import FilterProperty, filter_image, get_center, copy_drawing, draw_lines, \
... |
"""
Copyright (C) 2010-2022 Alibaba Group Holding Limited.
"""
import os
import numpy as np
import mmcv
import matplotlib.pyplot as plt
from mmdet.core.visualization import imshow_det_bboxes
from mmdet.models import DETECTORS
from mmdet.models import SingleStageDetector
from ...core import draw_box_3d_pred, show_bev,... |
<filename>test/testp4svn_actions.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Test cases of perforce to svn replication
'''
import os
import unittest
import tempfile
from testcommon import get_p4d_from_docker
from testcommon_p4svn import replicate_P4SvnReplicate, verify_replication
from lib.buildlogger impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2009, <NAME>'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Tests for testing utils (psutil.tests namespace).
"""
import collections
import contextlib
import errno
import o... |
import pytest
from poetry.packages import Locker as BaseLocker
from poetry.utils._compat import Path
from poetry.utils.exporter import Exporter
class Locker(BaseLocker):
def __init__(self):
self._locked = True
self._content_hash = self._get_content_hash()
def locked(self, is_locked=True):
... |
<reponame>zju3dv/NIID-Net
# ////////////////////////////////////////////////////////////////////////////
# // This file is part of NIID-Net. For more information
# // see <https://github.com/zju3dv/NIID-Net>.
# // If you use this code, please cite the corresponding publications as
# // listed on the above website.
... |
<reponame>tandriamil/copula-shirley
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
from diffprivlib.mechanisms import GaussianAnalytic, GeometricTruncated, LaplaceTruncated
def SampleForVine(data, ratio, x):
"""Sample ratio*n_row from data and force at least two values per column on ... |
# coding: utf-8
import datetime
import random
import pytest
from src.domain.exchange_rate import (
CurrencyExchangeAmountEntity, TimeWeightedRateEntity)
from src.interface.serializers.exchange_rate import (
CurrencySerializer, CurrencyExchangeRateConvertSerializer,
CurrencyExchangeRateAmountSerializer, C... |
<reponame>bowlofstew/client<gh_stars>10-100
from biicode.common.settings.arduinosettings import ArduinoSettings
from biicode.common.exception import BiiException
from biicode.client.setups.finders.arduino_sdk_finder import (valid_arduino_sdk_version,
find_ar... |
<filename>knockoff/factory/prototype.py<gh_stars>10-100
# Copyright 2021-present, Nike, Inc.
# All rights reserved.
#
# This source code is licensed under the Apache-2.0 license found in
# the LICENSE file in the root directory of this source tree.
import os
import six
import logging
import itertools
from operator imp... |
<reponame>mvdoc/mne-python
# Author: <NAME>, <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import assert_raises, assert_true, assert_equal
from ...utils import requires_sklearn_0_15
from ..search_light import _SearchLight, _GeneralizationLight
fr... |
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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
#
# htt... |
import io
import os
import sys
import datetime
import multiprocessing
import subprocess
import traceback
import time
import signal
import jedi
if sys.getdefaultencoding() != 'utf-8':
reload(sys)
sys.setdefaultencoding('utf-8')
class TimeoutException(Exception): # Custom exception class
pass
def timeout_ha... |
<filename>malware/openvc/openvc-1.0.0/openvc/cvtypes_h.py
#!/usr/bin/env python
# PyOpenCV - A Python wrapper for OpenCV 2.x using Boost.Python and NumPy
# Copyright (c) 2009, <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that t... |
<gh_stars>100-1000
## Issue related to time resolution/smoothness
# http://bulletphysics.org/mediawiki-1.5.8/index.php/Stepping_The_World
from gibson.core.physics.scene_building import SinglePlayerBuildingScene
from gibson.core.physics.scene_stadium import SinglePlayerStadiumScene
import pybullet as p
import time
imp... |
import datajoint as dj
import pathlib
import numpy as np
import pandas as pd
import re
from datetime import datetime
from ephys_loaders import neuropixels
def get_ephys_root_data_dir():
data_dir = dj.config.get('custom', {}).get('ephys_data_dir', None)
return pathlib.Path(data_dir) if data_dir else None
de... |
<reponame>manvhah/sporco<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright (C) 2019 by <NAME> <<EMAIL>>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""Interpolatio... |
# Copyright 2018 The Bazel 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 by applicable law or agreed to in wr... |
<filename>mian/analysis/linear_regression.py<gh_stars>1-10
# ===========================================
#
# mian Analysis Data Mining/ML Library
# @author: tbj128
#
# ===========================================
#
# Imports
#
import pandas as pd
from sklearn.impute import SimpleImputer
from sklearn.linear_model import... |
#!/usr/bin/env python
# coding: utf-8
# # JupyterDash
# The `jupyter-dash` package makes it easy to develop Plotly Dash apps from the Jupyter Notebook and JupyterLab.
#
# Just replace the standard `dash.Dash` class with the `jupyter_dash.JupyterDash` subclass.
# In[21]:
port = 8050
# In[22]:
# in case we use C... |
<gh_stars>1-10
__author__ = 'jrx'
import numpy as np
from encoder.bit_density import pad_bit_array, convert_to_bit_density, convert_from_bit_density
from encoder.constants import BITS_PER_BYTE, BYTES_PER_UINT64
from encoder.utilities import add_length_info, strip_length_info
class XorEncoding:
def __init__(sel... |
<reponame>hvsuchitra/tv_tracker<gh_stars>0
import sys
import re
from pathlib import Path
from PyQt5.QtCore import QBasicTimer, QThread, pyqtSignal, QRegExp, Qt, QSize, QTimeLine
from PyQt5.QtWidgets import QApplication, QWidget, QToolTip, QPushButton, QGroupBox, QHBoxLayout, QGridLayout, \
QFileDialog, QMainWindow... |
import os
import sys
import grequests
import logfetch_base
import time
from termcolor import colored
import callbacks
TASK_FORMAT = '/task/{0}'
S3LOGS_URI_FORMAT = '{0}/logs{1}'
REQUEST_FORMAT = '/request/{0}?excludeMetadata=true'
FILE_REGEX="\d{13}-([^-]*)-\d{8,20}\.gz"
progress = 0
goal = 0
def download_s3_logs(a... |
<reponame>C-BAND/jina
import os
import copy
import asyncio
import argparse
from typing import Union
from ....enums import SocketType
from ...zmq import send_ctrl_message
from ....jaml.helper import complete_path
from ....importer import ImportExtensions
from ....enums import replace_enum_to_str
from ..zmq.asyncio imp... |
from cardboard import types
from cardboard.ability import (
AbilityNotImplemented, spell, activated, triggered, static
)
from cardboard.cards import card, common, keywords, match
@card("Fight or Flight")
def fight_or_flight(card, abilities):
def fight_or_flight():
return AbilityNotImplemented
re... |
__author__ = 'civic'
from serial import Serial
import time
from datetime import (
datetime,
timedelta
)
import serial
import math
from .msg import (
AlarmSetting,
StopButton,
TemperatureUnit,
ToneSet,
WorkStatus,
RequestMessage,
ResponseMessage,
InitRequest,
InitResponse,
... |
# -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from groups.models.group_profile import GroupProfile
class GroupTestUpdate(APITestCase):
def setUp(self):
# Create some users
self.user1 = User.objec... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... |
<gh_stars>1-10
#!/usr/bin/env python
import sys
from Tkinter import *
from tkFileDialog import askopenfilenames, askdirectory
import Pmw
import cv
import chrono
class frame:
_colors = ['red', 'blue', 'green', 'yellow', 'cyan', 'magenta', 'black']
_linestyles = [' ', '-', '--', '-.', ':']
_markers = [' ', 'o', '.... |
<filename>ziplineST.py<gh_stars>1-10
import pytz
from datetime import datetime
from zipline.api import order, symbol, record, order_target, order_target_percent, set_benchmark
import numpy as np
# cal = get_calendar('NYSE')
# import pandas as pd
# bundle_name = 'quandl' # "a bundle name"
# ticker_name = "IBM"
# end_... |
"""
Api request handler
TODO:
Use serializers to generate correct output
"""
import json
import logging
from TrackerDash.common import theme_helpers
from TrackerDash.database import common as db_common
from TrackerDash.database.mongo_accessor import MongoAccessor
from TrackerDash.schemas.api import Graph as GraphSchem... |
# -*- coding: utf-8 -*-
"""
<NAME>
11/24/19
"""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Code Flow
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
'''
The true/false variables in the Variables Used section are to be manipulated
to determine what... |
<reponame>contrera/gammapy
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import OrderedDict
from numpy.testing import assert_allclose
import pytest
from astropy import units as u
from ...utils.testing i... |
<filename>Processing/allfeatures.py
#!/usr/bin/env python3
# MIT License
# Copyright (c) 2018 <NAME>
# 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 ... |
<gh_stars>1-10
from threading import Thread
import threading
import Queue
import time
from socket import error as SocketError
import sys
try:
import requests
import curses
import click
except ImportError:
print 'Tolerance requires the following Python modules: Requests and Click. You should be able to ... |
from ss.model.functions import Predicate, Function, rename_functions, initialize, TotalCost, Increase
from ss.model.problem import Problem
from ss.model.operators import Action, Axiom
from ss.algorithms.incremental import exhaustive, incremental
def main(n=2, verbose=False):
Item = Predicate('?b')
Part = Pre... |
<reponame>jehboyes/planning_system
# pylint: disable=no-member
import sys
from datetime import datetime
from dateutil.relativedelta import relativedelta
import click
from getpass import getuser
from office365.runtime.auth.user_credential import UserCredential
from office365.sharepoint.client_context import ClientContex... |
<reponame>atklaus/sportsreference
import pandas as pd
import re
from .constants import SCHEDULE_SCHEME, SQUAD_URL
from datetime import datetime
from ..decorators import float_property_decorator, int_property_decorator
from .fb_utils import _lookup_team
from pyquery import PyQuery as pq
from sportsreference import utils... |
import abc
import logging
import re
from typing import Iterator, Any, Sequence, Callable, Optional, Dict
from urllib.parse import urljoin, urlparse
import scrapy
from lxml import html, etree
LOGGER = logging.getLogger(__name__)
PageCallback = Callable[[scrapy.http.Response], Iterator[Any]]
class SiteLister(abc.AB... |
<gh_stars>1-10
import pandas as pd
import numpy as np
import re
import matplotlib.pyplot as plt
import seaborn as sns
import string
import nltk
import warnings
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
from sklearn.model_selection import train_test_... |
<gh_stars>0
import requests
import numpy as np
import math
import pandas as pd
PLAYERS_URL = ("https://raw.githubusercontent.com/mesosbrodleto/"
"soccerDataChallenge/master/players.json")
EVENTS_URL = ("https://raw.githubusercontent.com/mesosbrodleto/"
"soccerDataChallenge/master/worldCup-... |
<filename>roman_date.py
from datetime import date, datetime, timedelta
latin_months = [
"",
"IAN",
"FEB",
"MART",
"APR",
"MAI",
"IVN",
"IVL",
"AVG",
"SEPT",
"OCT",
"NOV",
"DEC",
]
latin_words = {"none": "NON.", "kalend": "KAL.", "ide": "ID."}
latin_numerals = [
"... |
#!/usr/bin/env python3
"""
Additional commands to add to the CLI beyond the OpenAPI spec.
"""
from __future__ import print_function
import functools
import os
import sys
import click
import requests
import webbrowser
import civis
from civis.io import file_to_civis, civis_to_file
# From http://patorjk.com/software/... |
<reponame>dakoner/smilesparser<gh_stars>1-10
# Copyright 2016 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0... |
<reponame>evenmarbles/rlpy<filename>rlpy/agent/planner/planner.py
import weakref
import numpy as np
from collections import namedtuple
from itertools import count
from ...framework.observer import Observable, Listener
class Planner(object):
"""
"""
class ValueState(Observable):
"""
""... |
"""
Copyright 2019 Johns Hopkins University (Author: <NAME>)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from six.moves import xrange
import os
from collections import OrderedDict as ODict
... |
<reponame>jeffshek/pyvips<filename>pyvips/voperation.py
from __future__ import division, print_function
import logging
import pyvips
from pyvips import ffi, vips_lib, Error, _to_bytes, _to_string, GValue, \
type_map, type_from_name, nickname_find
logger = logging.getLogger(__name__)
# values for VipsArgumentFla... |
"""
Tests for the get_string* functions of the ApplicationProperties class
"""
from application_properties import ApplicationProperties
def test_properties_get_string_with_found_value():
"""
Test fetching a configuration value that is present and string.
"""
# Arrange
config_map = {"property": "m... |
<gh_stars>0
import dask.dataframe as dd
"""
Loads a table file as generated by TPC-H's dbgen.
Returns an uncomputed dataframe - user must persist if desired.
`path` can be a single path or a glob path, and can be local or an S3 url.
https://docs.dask.org/en/latest/dataframe-api.html#dask.dataframe.read_table
"""
de... |
<reponame>qaz734913414/nniefacelib
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
######################################################
#
# pfld.py -
# written by zhaozhichao and Hanson
#
######################################################
import torch
import torch.nn as nn
import math
import torch.nn.init as ini... |
<reponame>ashis-Nayak-13/airbyte
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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
... |
#!/usr/bin/env python
# MIT License
#
# Copyright (c) 2018 <NAME>
#
# 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 use, c... |
"""
A script for rules-based entity recognition. Unused in final system, but made available for further development.
"""
from spacy import load
import re
from spacy.tokens import DocBin, Doc
from spacy.training.example import Example
from spacy.scorer import Scorer
from spacy.language import Language
from spacy.pipelin... |
# _*_ encoding: utf-8 _*_
from copy import copy
from django.template import Library, loader, Context
from django.contrib.admin.templatetags.admin_static import static
from django.utils.html import format_html
from django.utils.text import capfirst
from django.utils.encoding import force_text
from django.utils.transla... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/dialogmainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from es_common.utils.qt import QtCore, QtGui, QtWidgets
from block_manager.view import resources_rc
class Ui_... |
# Copyright 2013: Mirantis 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 b... |
<filename>src/DocumentTemplate/DT_InSV.py
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distr... |
<gh_stars>1-10
################################################################################
# Module: core.py
# Description: Helper functions
# License: Apache v2.0
# Author: <NAME>
# Web: https://github.com/pedroswits/anprx
################################################################################
import co... |
<filename>Juego(por nombrar)/src/clases/Sprites.py<gh_stars>1-10
import pygame as pg
from pygame import sprite
from pygame.locals import *
import glob
from itertools import cycle
class Character_Sprite(sprite.Sprite):
def __init__(self, name, speed):
super().__init__()
self.animation_list = self.... |
<filename>src/metrics/hota.py
from multiprocessing import freeze_support
import sys
import os
import argparse
from TrackEval import trackeval
import pandas as pd
os.chdir(os.path.join("..",".."))
freeze_support()
default_eval_config = trackeval.Evaluator.get_default_eval_config()
default_eval_config['DISPLAY_LESS_PRO... |
import sqlite3 as sql
from datetime import timezone
from flask_sqlalchemy import SQLAlchemy
from os import path
from flask import Flask
from flask_login import LoginManager, login_manager, UserMixin
from sqlalchemy import Table, Column, Integer, ForeignKey, engine, create_engine, inspect
from sqlalchemy.sql import func... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.