max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
src/ezdxf/tools/pattern.py
hh-wu/ezdxf
0
38300
# Purpose: Standard definitions # Created: 08.07.2015 # Copyright (c) 2015-2020, <NAME> # License: MIT License # pattern type: predefined (1) from ezdxf.math import Vec2 PATTERN_NEW = { "ANSI31": [[45.0, (0.0, 0.0), (-2.2627, 2.2627), []]], "ANSI32": [ [45.0, (0.0, 0.0), (-6.7882, 6.7882), []], ...
1.859375
2
Cogs/Nullify.py
TheMasterGhost/CorpBot
0
38301
<reponame>TheMasterGhost/CorpBot def clean(string): # A helper script to strip out @here and @everyone mentions zerospace = "​" return string.replace("@everyone", "@{}everyone".format(zerospace)).replace("@here", "@{}here".format(zerospace))
2.8125
3
src/grab_stations.py
davis68/capstone-python-intermediate-forecast
0
38302
#!/usr/bin/env python3.3 import requests def grab_website_data(): '''Get raw data as HTML string from the NOAA website.''' url = 'http://www.nws.noaa.gov/mdl/gfslamp/docs/stations_info.shtml' page = requests.get(url) return page.text def extract_section(text): '''Find Illinois data segment (in a P...
3.71875
4
tarpn/netrom/router.py
rxt1077/tarpn-node-controller
0
38303
import datetime import os from dataclasses import dataclass, field from operator import attrgetter from typing import List, Dict, Optional, cast, Set from tarpn.ax25 import AX25Call from tarpn.netrom import NetRomPacket, NetRomNodes, NodeDestination from tarpn.network import L3RoutingTable, L3Address import tarpn.net...
2.28125
2
tests/configuration/config.py
NHSDigital/karsten-ratelimit-test
1
38304
from .environment import ENV # Api Details ENVIRONMENT = ENV["environment"] BASE_URL = f"https://{ENVIRONMENT}.api.service.nhs.uk" BASE_PATH = ENV["base_path"]
1.6875
2
blacktape/pipeline.py
carascap/blacktape
0
38305
<gh_stars>0 from concurrent.futures import ProcessPoolExecutor, as_completed from typing import Iterable, Optional from blacktape.lib import match_entities_in_text, match_pattern_in_text from blacktape.util import worker_init class Pipeline: """ Wrapper around ProcessPoolExecutor """ def __init__(se...
2.390625
2
opencda/customize/core/sensing/localization/extented_kalman_filter.py
xst-666/OpenCDA
1
38306
<reponame>xst-666/OpenCDA # -*- coding: utf-8 -*- """ Use Extended Kalman Filter on GPS + IMU for better localization. """ # Author: <NAME> <<EMAIL>> # License: MIT import math import numpy as np class ExtentedKalmanFilter(object): """ Extended Kalman Filter implementation for gps and imu. Parameters ...
2.546875
3
BinarySearch/koko_eating_bananas.py
mishrakeshav/Competitive-Programming
2
38307
<reponame>mishrakeshav/Competitive-Programming """ link : https://leetcode.com/problems/koko-eating-bananas/ """ class Solution: def minEatingSpeed(self, piles: List[int], h: int) -> int: def condition(val): hr = 0 for i in piles: hr += (val + i - 1)//val ...
3.515625
4
src/rgw/const.py
suryakumar1024/cortx-rgw-integration
0
38308
#!/bin/env python3 # Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option...
1.648438
2
day2/exercises/Jamila/dartdrafts.py
lavjams/BI-Demo
0
38309
<gh_stars>0 ###### ###BACKGROUND #Below Section: Imports necessary functions import numpy as np import matplotlib.pyplot as graph import random as rand import time as watch pi = np.pi #FUNCTION: ishit #PURPOSE: This function is meant to test whether or not a given 2d point is within the unit circle. #INPUTS: x = x-ax...
3.375
3
baidu_code/soap_mockserver/spyne/test/model/test_primitive.py
deevarvar/myLab
0
38310
<filename>baidu_code/soap_mockserver/spyne/test/model/test_primitive.py #!/usr/bin/env python # coding=utf-8 # # spyne - Copyright (C) Spyne contributors. # # This library 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 Sof...
1.875
2
tests/test_humidifiersteamgas.py
marcelosalles/pyidf
19
38311
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.humidifiers_and_dehumidifiers import HumidifierSteamGas log = logging.getLogger(__name__) class TestHumidifierSteamGas(unittest.TestCase): def setUp(self): self.fd,...
2.53125
3
e2e_tests/tests/fixtures/pytorch_lightning_amp/model_def.py
gh-determined-ai/determined
1,729
38312
""" This example shows how to interact with the Determined PyTorch Lightning Adapter interface to build a basic MNIST network. LightningAdapter utilizes the provided LightningModule with Determined's PyTorch control loop. """ from determined.pytorch import PyTorchTrialContext, DataLoader from determined.pytorch.lightn...
2.921875
3
graph.py
tannerb/genetic_math
0
38313
# graph from datetime import date import numpy as np from bokeh.client import push_session from bokeh.io import output_server, show, vform from bokeh.palettes import RdYlBu3 from bokeh.plotting import figure, curdoc, vplot, output_server from bokeh.models import ColumnDataSource from bokeh.models.widgets im...
2.65625
3
ADTs/Node.py
pacevedom/three-in-line-AI
0
38314
<reponame>pacevedom/three-in-line-AI<gh_stars>0 class Node: def __init__(self, value, child, parent): self._value = value self._child = child self._parent = parent def get_value(self): #Return the value of a node return self._value def get_child(self): #Retu...
3.5625
4
deployment/cloudformation/data.py
azavea/cac-tripplanner
13
38315
<filename>deployment/cloudformation/data.py """Handles template generation for Cac Data Plane stack""" from troposphere import ( Parameter, Ref, Output, Tags, GetAtt, ec2, rds, route53 ) from .utils.constants import RDS_INSTANCE_TYPES from majorkirby import StackNode class BaseFacto...
2.4375
2
tests/test_default_currencies_provider.py
pedroburon/python-monon
1
38316
from unittest import TestCase from decimal import Decimal, ROUND_UP from monon.currency import DefaultCurrenciesProvider class DefaultCurrenciesProviderTestCase(TestCase): def setUp(self): self.provider = DefaultCurrenciesProvider() self.isocode = 'USD' def test_decimal_places(self): ...
3.125
3
appion/bin/imageloader.py
leschzinerlab/myami-3.2-freeHand
0
38317
<filename>appion/bin/imageloader.py #!/usr/bin/env python #pythonlib import os import sys import shutil import time import numpy import math import glob #appion from appionlib import appionLoop2 from appionlib import apDatabase from appionlib import apDisplay from appionlib import apDBImage from appionlib import apPro...
2.21875
2
modules/exporter.py
MarzioMonticelli/python-cryptonet
19
38318
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: <NAME> (1459333) """ from os import path from . import model as md from tensorflow import keras class Exporter: def __init__(self, verbosity = False): self.verbosity = verbosity def load(self, base_dir = 'storage/models/'...
2.578125
3
kbc_pul/experiments_utils/file_utils.py
ML-KULeuven/KBC-as-PU-Learning
4
38319
<reponame>ML-KULeuven/KBC-as-PU-Learning import os def print_file_exists(filename: str) -> None: print(f"? file exists: {filename}\n-> {os.path.exists(filename)}")
2.484375
2
combinatorial_gwas/phenotypes/__init__.py
hoangthienan95/combinatorial_GWAS
0
38320
<filename>combinatorial_gwas/phenotypes/__init__.py # AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/package/phenotypes.ipynb (unless otherwise specified). __all__ = ['QueryDataframe', 'parameters', 'catalog_all', 'catalog_all', 'read_csv_compressed', 'get_GWAS_result_link', 'heritability_Neale', 'disp...
2.171875
2
eprime2events/cimaq_convert_eprime_to_bids_event.py
MarieStLaurent/cimaq_memory
1
38321
#!/usr/bin/env python # encoding: utf-8 import os import re import sys import argparse import glob import logging from numpy import nan as NaN import pandas as pd import shutil import zipfile def get_arguments(): parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, ...
2.671875
3
noise_filtering.py
tahoangthang/Wikidata2Text
2
38322
<filename>noise_filtering.py #........................................................................................................ # Title: Wikidata claims (statements) to natural language (a part of Triple2Text/Ontology2Text task) # Author: <NAME> # Email: <EMAIL> # Lab: https://www.cic.ipn.mx # Date: 12/2019...
2.734375
3
Unit 8 Libraries/shapes.py
ItsMrTurtle/PythonChris
0
38323
# -*- coding: utf-8 -*- """ Created on Thu May 28 15:30:04 2020 @author: <NAME> """ class Circle (object): def __init__(self): self.radius = 0 def change_radius(self, radius): self.radius = radius def get_radius (self): return self.radius class Rectangle(object): # A rectang...
3.828125
4
locale/pot/api/core/_autosummary/pyvista-StructuredGrid-reconstruct_surface-1.py
tkoyama010/pyvista-doc-translations
4
38324
<reponame>tkoyama010/pyvista-doc-translations # Create a point cloud out of a sphere and reconstruct a surface # from it. # import pyvista as pv points = pv.wrap(pv.Sphere().points) surf = points.reconstruct_surface() # pl = pv.Plotter(shape=(1,2)) _ = pl.add_mesh(points) _ = pl.add_title('Point Cloud of 3D Surface') p...
3.234375
3
src/tests/test_cli.py
GatorQue/cogit
0
38325
<reponame>GatorQue/cogit<gh_stars>0 # *- coding: utf-8 -*- # pylint: disable=wildcard-import, unused-wildcard-import, missing-docstring # pylint: disable=redefined-outer-name, no-self-use, bad-continuation """ Test '__main__' CLI stub. See http://click.pocoo.org/3/testing/ """ # Copyright © 2017 <NAME> <<EMAIL>> ...
1.960938
2
tests/opytimizer/math/test_hypercomplex.py
macoldibelli/opytimizer
0
38326
import numpy as np import pytest from opytimizer.math import hypercomplex def test_norm(): array = np.array([[1, 1]]) norm_array = hypercomplex.norm(array) assert norm_array > 0 def test_span(): array = np.array([[0.5, 0.75, 0.5, 0.9]]) lb = [0] ub = [10] span_array = hypercomplex....
2.640625
3
card/models.py
tyhunt99/card-collector-db
0
38327
import datetime from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models class Collection(models.Model): ''' A collection of cards. ''' name = models.CharField(max_length=250) class Card(models.Model): first_name = models.CharField(max_length=150) ...
2.625
3
nns_based_approach/tv_recon_network/cg.py
schote/P1-Temp-Reg
0
38328
import torch from scipy.sparse.linalg import LinearOperator, cg from typing import Callable, Optional from torch import Tensor import numpy as np import time class CG(torch.autograd.Function): @staticmethod def forward(ctx, z: Tensor, AcquisitionModel, beta: Tensor, y, G: Callable, GH: Callable, GHG: Optional[...
2.109375
2
AFLW/fddb_symbol_gen.py
kli-nlpr/FaceDetection-ConvNet-3D
159
38329
<filename>AFLW/fddb_symbol_gen.py import mxnet as mx def get_vgg16_gen(): relu_feature = mx.symbol.Variable(name="relu_feature") box_predict = mx.symbol.Variable(name="box_predict") ground_truth = mx.symbol.Variable(name="ground_truth") bbox_label = mx.symbol.Variable(name="bbox_label") ell_labe...
2.296875
2
pythutils/mediautils.py
JolleJolles/pyutilspack
2
38330
#! /usr/bin/env python # Copyright (c) 2018 - 2019 <NAME> <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
2.65625
3
pythoncode/example2.py
morganwillisaws/codeguru
1
38331
import boto3 import subprocess successes = 0 # Dummy AWS Handler to kick off high level processes def lambda_handler(source_region, destination_region, credentials): session = boto3.Session() # Load Records into KINESIS CLIENT_NAME = 'kinesis' kinesis = session.client(CLIENT_NAME, region_name=source...
2.203125
2
runtime/module_resolution.py
cheery/lever
136
38332
<reponame>cheery/lever<filename>runtime/module_resolution.py from space import * import base import bon import evaluator import core import os import pathobj import stdlib import sys class ModuleScope(Object): def __init__(self, local, parent=None, frozen=False): self.cache = {} # maps absolute path -> mod...
2.203125
2
datamine/loaders/liqtool.py
Saran33/datamine_python
39
38333
<filename>datamine/loaders/liqtool.py from . import Loader import pandas as pd from datetime import datetime, timedelta start = datetime(1970, 1, 1) # Unix epoch start time class LiqLoader(Loader): dataset = 'LIQTOOL' fileglob = 'LIQTOOL_*.csv.gz' index = 'tradedate' dtypes = {'category': ('symb...
2.265625
2
setup.py
maraujop/django-rules
20
38334
# -*- coding: utf-8 -*- import os import sys reload(sys).setdefaultencoding("UTF-8") from setuptools import setup, find_packages from distutils.core import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() version = '0.2' setup( name='django-rules', version=versio...
1.242188
1
numbering-systems-final.py
Vandal2006/numbering-systems
0
38335
# Author: <NAME> # Class: cpsc-20000 # Constants INTRODUCTION = ''' ****************************************************** Numbering Systemn 2.0 GilsoSoft ****************************************************** This program will give you your inputed i...
3.546875
4
demo/optimization.py
Pricccvtqu4tt/ngocthinh
1
38336
# Copyright (c) 2018 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 app...
1.828125
2
test/build_bfrange2.py
trueroad/pdf-fix-tuc
20
38337
#!/usr/bin/env python3 # # Fix ToUnicode CMap in PDF # https://github.com/trueroad/pdf-fix-tuc # # build_bfrange2.py: # Build bfrange2 PDF. # # Copyright (C) 2021 <NAME>. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the foll...
2.09375
2
fedot/api/api_utils/initial_assumptions.py
vkirilenko/FEDOT
1
38338
from typing import List, Union from fedot.core.data.data import data_has_categorical_features, InputData from fedot.core.data.multi_modal import MultiModalData from fedot.core.pipelines.node import PrimaryNode, SecondaryNode, Node from fedot.core.pipelines.pipeline import Pipeline from fedot.core.repository.tasks impo...
2.375
2
server/py/dummy.py
sreyas/Attendance-management-system
0
38339
import numpy as np import glob,os import datetime from pathlib import Path from pymongo import MongoClient from flask_mongoengine import MongoEngine from bson.objectid import ObjectId client = MongoClient(port=27017) db=client.GetMeThrough; binary =0; home = str(os.path.dirname(os.path.abspath(__file__))) + "/../../" ...
2.46875
2
TingCheChangSystem/ParkingLot.py
scottyyf/oodoop
2
38340
#!/usr/bin/env python # -*- coding: utf-8 -*- """ File: ParkingLot.py Author: <NAME>(Scott) Email: <EMAIL> Copyright: Copyright (c) 2021, Skybility Software Co.,Ltd. All rights reserved. Description: """ from datetime import datetime from TException import SpotOccupiedError, NoSuitableSpotsError from Ticket import Ti...
2.875
3
hnk05_hupai.py
jcq15/mahjong
1
38341
<reponame>jcq15/mahjong import operator from global_data import * class HupaiCheck: # 对一副具有14张牌的手牌的胡牌与否、胡牌拆分形式进行判断,拥有两个输入接口:self.tehai和self.numtehai,分别表示用数字字母表示的手牌和 # 转化成了方便处理的数字形式的手牌,33332拆解形式是递归,返回存储在了self.hupaiway中,是一个最多三层嵌套的列表。如果没胡是空列表,和了的话 # 最大列表的第一层列表是胡牌形式,里面的每一个列表是拆分成33332中的一份、或者七对子的一对,或者国士无双的所有内容...
1.976563
2
edgelm/examples/wav2vec/unsupervised/kaldi_self_train/st/local/prepare_data_from_w2v.py
guotao0628/DeepNet
1
38342
import kaldi_io import numpy as np import os def get_parser(): import argparse parser = argparse.ArgumentParser() parser.add_argument("w2v_dir", help="wav2vec feature and text directory") parser.add_argument("tar_root", help="output data directory in kaldi's format") parser.add_argument(...
2.5
2
tests/tests_earthquake.py
domenicosolazzo/Earthquake
0
38343
<gh_stars>0 import unittest from lib.earthquake import Earthquake class EarthquakeTestCase(unittest.TestCase): def setUp(self): self.earthquake = Earthquake(service="fake") def test_refresh_exists(self): self.assertTrue(callable(getattr(self.earthquake,"refresh")),"True") def test_refresh_do...
3.1875
3
edmunds/log/logmanager.py
LowieHuyghe/edmunds-python
4
38344
<reponame>LowieHuyghe/edmunds-python<filename>edmunds/log/logmanager.py from edmunds.foundation.patterns.manager import Manager import os class LogManager(Manager): """ Log Manager """ def __init__(self, app): """ Initiate the manager :param app: The application :...
2.65625
3
mottak-arkiv-service/tests/routers/dto/test_Arkivuttrekk.py
arkivverket/mottak
4
38345
from datetime import date from uuid import UUID import pytest from app.domain.models.Arkivuttrekk import Arkivuttrekk, ArkivuttrekkStatus, ArkivuttrekkType from app.domain.models.Depotinstitusjoner import DepotinstitusjonerEnum from app.routers.dto.Arkivuttrekk import ArkivuttrekkCreate as Arkivuttrekk_dto @pytest....
2
2
anecAPI/anecAPI.py
suborofu/anecAPI
0
38346
from modern_jokes import modern_jokes from soviet_jokes import soviet_jokes import random import argparse def soviet_joke(): return random.choice(soviet_jokes) def modern_joke(): return random.choice(modern_jokes) def random_joke(): return random.choice(soviet_jokes + modern_jokes) # TODO: Auto-gene...
3.328125
3
lexicon/encode.py
ishine/neural-lexicon-reader
4
38347
<filename>lexicon/encode.py import transformers from transformers import XLMRobertaTokenizerFast, XLMRobertaModel import torch import json import pickle import tqdm import os from matplotlib import pyplot as plt lengths = [] tokenizer = XLMRobertaTokenizerFast.from_pretrained("xlm-roberta-large") model = XLMRobertaMod...
2.328125
2
05_reseaux_web/2_le_web/demo_web_cgi/cgi-bin/cookie.py
efloti/cours-nsi-premiere
0
38348
#!/opt/tljh/user/bin/python import cgitb; cgitb.enable() # pour débogage import os entete_http = "Content-type: text/html; charset=utf-8\n" # gabarit html ... deux zones d'insertions html_tpl = """ <!DOCTYPE html> <head> <title>cookie</title> </head> <body> <a href="/">retour...</a> <h2>{message}</h2> ...
2.609375
3
globe_observer_cli.py
fpaludi/GlobeObserver
0
38349
<reponame>fpaludi/GlobeObserver<gh_stars>0 from time import time from typing import List, Optional from pathlib import Path from datetime import datetime, timedelta import typer import numpy as np from skimage import exposure import rasterio as rio from rasterio import plot from globe_observer.gee import SatelliteFacto...
2.390625
2
up/utils/model/optim/__init__.py
ModelTC/EOD
196
38350
<filename>up/utils/model/optim/__init__.py from .lars import LARS # noqa from .lamb import LAMB # noqa
1.085938
1
simrd/simrd/parse/graph.py
uwsampl/dtr-prototype
90
38351
import attr from attr import attrib, s from typing import Tuple, List, Optional, Callable, Mapping, Union, Set from collections import defaultdict from ..tensor import Operator @attr.s(auto_attribs=True) class GOp: cost : float size : Tuple[int] alias : Tuple[int] args : Tuple['GTensor'] result ...
2.40625
2
json_schema_checker/validators/__init__.py
zorgulle/json_schema_checker
0
38352
from .validators import Int from .validators import String
1.039063
1
samples/oxy-cope/namd_02-mini.py
sergio-marti/qm3
13
38353
<reponame>sergio-marti/qm3<filename>samples/oxy-cope/namd_02-mini.py import qm3.mol import qm3.fio.xplor import qm3.problem import qm3.engines.namd import qm3.engines.xtb import qm3.engines.mmint import qm3.actions.minimize import os import time import pickle class my_problem( qm3.problem.template ): de...
1.859375
2
wysdom/dom/DOMDict.py
jetavator/wysdom
1
38354
from __future__ import annotations from typing import Generic, TypeVar, Optional, Any, Dict from collections.abc import Mapping from ..base_schema import Schema, SchemaAnything from .DOMElement import DOMElement from .DOMObject import DOMObject from . import DOMInfo from .DOMProperties import DOMProperties T_co = T...
2.359375
2
auto_updater.py
fgreinacher/homebrew-dotnet-sdk-versions
0
38355
<filename>auto_updater.py #!/usr/bin/env python import argparse import glob import hashlib import json import os import re import requests import urllib.request class SdkVersion: def __init__(self, version_string): version_split = version_string.split('.') self.major = int(version_split[0]) ...
2.515625
3
template_creator/reader/strategies/GoStrategy.py
VanOvermeire/sam-template-creator
3
38356
<gh_stars>1-10 import re from template_creator.reader.config.iam_config import GO_EXCEPTIONS from template_creator.reader.strategies.language_strategy_common import find_variables_in_line_of_code, find_api, find_events class GoStrategy: def build_camel_case_name(self, dir_name, file): if '/' in dir_name:...
2.03125
2
indicators/data.py
WPRDC/community-simulacrum
0
38357
import dataclasses import typing from dataclasses import dataclass from typing import List from typing import Optional from profiles.settings import DENOM_DKEY, VALUE_DKEY, GEOG_DKEY, TIME_DKEY if typing.TYPE_CHECKING: from indicators.models import CensusVariable, CKANVariable @dataclass class Datum: variab...
2.390625
2
support.py
Soarxyn/PEF-Structural-Analysis
4
38358
<reponame>Soarxyn/PEF-Structural-Analysis from typing import Tuple from enum import Enum from auxiliary.algebra import Vector3, psin, pcos # this is an auxiliary class used for initializing the Support class's members' values class SupportType(Enum): SIMPLE: Tuple = (1, 0) # tuple values are the number PINNED: Tupl...
3.03125
3
picaact.py
yindaheng98/picacomic
0
38359
import os import re import logging import sqlite3 import json import threading from picaapi import PicaApi from urllib import parse from multiprocessing.pool import ThreadPool class PicaAction: def __init__(self, account, password, proxies=None, threadn=5, data_path=os.path.join(...
2.703125
3
sharpy-sc2/sharpy/plans/require/enemy_building_exists.py
etzhang416/sharpy-bot-eco
0
38360
<reponame>etzhang416/sharpy-bot-eco<filename>sharpy-sc2/sharpy/plans/require/enemy_building_exists.py import warnings from sc2 import UnitTypeId from sharpy.plans.require.require_base import RequireBase class EnemyBuildingExists(RequireBase): """ Checks if enemy has units of the type based on the informatio...
3
3
setup.py
biobakery/halla
6
38361
'''HAllA setup To install: python setup.py install ''' import sys try: import setuptools from setuptools.command.install import install except ImportError: sys.exit('Please install setuptools.') VERSION = '0.8.20' AUTHOR = 'HAllA Development Team' MAINTAINER_EMAIL = '<EMAIL>' class PostInstallCommand(...
2.078125
2
all-sky-average-proper-motions/proper-motion-map.py
agabrown/gaiaedr3-proper-motion-visualizations
5
38362
""" Plot an all-sky average proper motion map, using statistics downloaded from the Gaia archive with a query similar to the following: select gaia_healpix_index(5, source_id) as healpix_5, avg(pmra) as avg_pmra, avg(pmdec) as avg_pmdec from gaiaedr3.gaia_source where parallax_over_error>=10 and parallax*paralla...
2.640625
3
AWERA/wind_profile_clustering/read_requested_data.py
lthUniBonn/AWERA
0
38363
<reponame>lthUniBonn/AWERA #!/usr/bin/env python2 # -*- coding: utf-8 -*- import xarray as xr import numpy as np import sys from os.path import join as path_join from .era5_ml_height_calc import compute_level_heights # FIXME what of this is still necessary? import dask # only as many threads as requested CPUs | o...
2.328125
2
bot/test_gpio.py
radiodee1/awesome-chatbot
22
38364
<reponame>radiodee1/awesome-chatbot #!/usr/bin/env python3 import time pin_skip = False try: import RPi.GPIO as GPIO led_pin_a = 12 led_pin_b = 16 print('load rpi gpio') except: try: import Jetson.GPIO as GPIO led_pin_a = 12 led_pin_b = 16 print('load jetson gpio')...
3.125
3
1-Algorithmic-Toolbox/week3/assignments/car_fueling.py
Helianus/Data-Structures-and-Algorithms-Coursera
0
38365
# python3 import sys def compute_min_refills(distance, tank, stops): # write your code here if distance <= tank: return 0 else: stops.append(distance) n_stops = len(stops) - 1 count = 0 refill = tank for i in range(n_stops): if refill < stops[i...
3.765625
4
avatar/plugins/avatar_plugin.py
gitttt/avatar-python-private
30
38366
<reponame>gitttt/avatar-python-private class AvatarPlugin: """ Abstract interface for all Avatar plugins Upon start() and stop(), plugins are expected to register/unregister their own event handlers by the means of :func:`System.register_event_listener` and :func:`System.unregister_event_listener` ...
2.171875
2
python/python.py
TimVan1596/ACM-ICPC
1
38367
import xlwt if __name__ == '__main__': workbook = xlwt.Workbook(encoding='utf-8') # 创建workbook 对象 worksheet = workbook.add_sheet('sheet1') # 创建工作表sheet # 往表中写内容,第一各参数 行,第二个参数列,第三个参数内容 worksheet.write(0, 0, 'hello world') worksheet.write(0, 1, '你好') workbook.save('first.xls') # 保存表为students.x...
2.609375
3
kiestze_django/kiestze/migrations/0004_auto_20180719_1438.py
oSoc18/kiest_ze
3
38368
# Generated by Django 2.0.7 on 2018-07-19 14:38 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('kiestze', '0003_gemeente'), ] operations = [ migrations.RemoveField( model_name='gemeente', ...
1.507813
2
analysis/get_input_message_pairs.py
Shawn-Guo-CN/EmergentNumerals
2
38369
<gh_stars>1-10 import torch import numpy as np from utils.conf import args from models.Set2Seq2Seq import Set2Seq2Seq from preprocesses.DataIterator import FruitSeqDataset from preprocesses.Voc import Voc DATA_FILE = './data/all_data.txt' OUT_FILE = './data/input_msg_pairs.txt' def load_data(f): dataset = [] ...
2.140625
2
Deck.py
Harel92/BlackJack-Game
0
38370
import random from Card import Card suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs') ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace') class Deck: def __init__(self): # Note this only happens once upon creation of a new Deck ...
3.859375
4
dependencies/src/4Suite-XML-1.0.2/Ft/Xml/Lib/HtmlPrettyPrinter.py
aleasims/Peach
0
38371
<gh_stars>0 ######################################################################## # $Header: /var/local/cvsroot/4Suite/Ft/Xml/Lib/HtmlPrettyPrinter.py,v 1.12 2005/02/09 09:12:06 mbrown Exp $ """ This module supports formatted document serialization in HTML syntax. Copyright 2005 Fourthought, Inc. (USA). Detailed li...
2.796875
3
setup.py
lanius/chord
0
38372
<gh_stars>0 # -*- coding: utf-8 -*- from setuptools import setup setup( name='chord', version='0.0.1', url='https://github.com/lanius/chord/', packages=['chord'], license='MIT', author='lanius', author_email='<EMAIL>', description='Captures current status of keyboard.', install_re...
0.929688
1
modules/deepspell/baseline/symspell_gendawg.py
Klebert-Engineering/deep-spell-9
3
38373
<filename>modules/deepspell/baseline/symspell_gendawg.py # (C) 2018-present <NAME> """ Opens a TSV FTS corpus file and generates misspelled entries for each FTS token with a given maximum edit distance. Takes two arguments: (1) The corpus file (2) The output file. Two output files will be generated from this argument:...
2.953125
3
Smaug/models/users.py
luviiv/Smaug
0
38374
# -*- coding: utf-8 -*- """ users.py ~~~~~~~~~~~ user manage :copyright: (c) 2015 by <NAME>. :license: Apache, see LICENSE for more details. """ import hashlib from datetime import datetime from werkzeug import generate_password_hash, check_password_hash, \ cached_property from flask.ext.sql...
2.453125
2
cfg/launcher/__main__.py
rr-/dotfiles
16
38375
import os from libdotfiles.util import ( HOME_DIR, PKG_DIR, REPO_ROOT_DIR, create_symlink, run, ) create_symlink( PKG_DIR / "launcher.json", HOME_DIR / ".config" / "launcher.json" ) os.chdir(REPO_ROOT_DIR / "opt" / "launcher") run( ["python3", "-m", "pip", "install", "--user", "--upgrade"...
1.890625
2
problems/737.Sentence-Similarity-II/li.py
subramp-prep/leetcode
0
38376
<filename>problems/737.Sentence-Similarity-II/li.py # coding=utf-8 # Author: <NAME> # Question: 737.Sentence-Similarity-II # Complexity: O(N) # Date: 2018-05 14:50 - 14:56, 1 wrong try class Solution(object): def areSentencesSimilarTwo(self, words1, words2, pairs): """ :type words1: List[str] ...
3.453125
3
test/test_datatypes.py
panny2207/OWL-RL
0
38377
""" Test for OWL 2 RL/RDF rules from Table 8. The Semantics of Datatypes https://www.w3.org/TR/owl2-profiles/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules NOTE: The following axioms are skipped on purpose - dt-eq - dt-diff """ from rdflib import Graph, Literal, Namespace, RDF, XSD, RDFS import owlrl DAML...
2.796875
3
pykin/robots/bimanual.py
jdj2261/pykin
14
38378
<reponame>jdj2261/pykin<filename>pykin/robots/bimanual.py<gh_stars>10-100 import numpy as np from pykin.robots.robot import Robot from pykin.utils.error_utils import NotFoundError class Bimanual(Robot): """ Initializes a bimanual robot simulation object. Args: fname (str): path to the urdf file. ...
2.78125
3
tests/test_model.py
tteofili/python-trustyai
0
38379
# pylint: disable=import-error, wrong-import-position, wrong-import-order, invalid-name """Test model provider interface""" from common import * from trustyai.model import Model, feature def foo(): return "works!" def test_basic_model(): """Test basic model""" def test_model(inputs): outputs ...
2.34375
2
avazu-ctr/rf.py
ldamewood/renormalization
6
38380
#!/usr/bin/env python from __future__ import print_function from sklearn.feature_extraction import FeatureHasher from sklearn.ensemble import RandomForestClassifier from sklearn.pipeline import make_pipeline from sklearn.metrics import log_loss import ctr learner = RandomForestClassifier(verbose = False, n_jobs = -1...
2.171875
2
migrations/versions/f6ee6f9df554_.py
d-demirci/blockpy-server
18
38381
"""Add Review Table Revision ID: <PASSWORD> Revises: Create Date: 2019-08-07 13:09:49.691184 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<PASSWORD>' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gener...
1.71875
2
regionsSP/source/summary.py
abdelhadisamir/covid-19-SEIAR
2
38382
<filename>regionsSP/source/summary.py<gh_stars>1-10 if districtRegion1=="DRS 05 - Barretos": date="2020-04-01" #initial condition for susceptible s0=10.0e3 #initial condition for exposed e0=1e-4 #initial condition for infectious i0=1e-4 #initial ...
2.25
2
claymore_json_api.py
bennettwarner/ClaymoreJSON-API
0
38383
<filename>claymore_json_api.py # Author: <NAME> # Last update: 4/16/2018 import sys import socket import json import argparse from http.server import HTTPServer, BaseHTTPRequestHandler if sys.version_info < (3, 0): sys.stdout.write("Sorry, Claymore JSON-API requires Python 3.x\n") sys.exit(1) remote_host, re...
2.390625
2
src/mushr_pf/motion_model.py
rogeriobonatti/mushr_pf
4
38384
#!/usr/bin/env python # Copyright (c) 2019, The Personal Robotics Lab, The MuSHR Team, The Contributors of MuSHR # License: BSD 3-Clause. See LICENSE.md file in root directory. from threading import Lock import numpy as np import rospy from std_msgs.msg import Float64 from vesc_msgs.msg import VescStateStamped # Tu...
2.234375
2
2018/day-22/part2.py
amochtar/adventofcode
1
38385
from collections import defaultdict from heapq import heappop, heappush class Region(object): def __init__(self, y, x, gi, el, t): self.y = y self.x = x self.gi = gi self.el = el self.t = t def pos(self): return (self.y, self.x) tools = { '.': set(['c', '...
3.15625
3
atcoder/abc149/b.py
sugitanishi/competitive-programming
0
38386
a,b,k=map(int,input().split()) print(max(a-k,0),max(b-max(k-a,0),0))
2.34375
2
models/baselines.py
saverymax/qdriven-chiqa-summarization
10
38387
<gh_stars>1-10 """ Script for baseline approaches: 1. Take 10 random sentences 2. Take the topk 10 sentences with highest rouge score relative to the question 3. Pick the first 10 sentences To run python baselines.py --dataset=chiqa """ import json import numpy as np import random import requests import argparse imp...
3.359375
3
pycsvschema/validators/types.py
crowdskout/PycsvSchema
11
38388
#!/usr/bin/python # -*-coding: utf-8 -*- # https://github.com/frictionlessdata/tableschema-py/tree/1d9750248de06a075029c1278404c5db5311fbc5/tableschema/types # type and format # Support types and formats: # string # email # uri # uuid # ipv4 # ipv6 # hostname # datetime # number # integer # boolean # i...
2.125
2
Identifeye/src/adj_list.py
haasm3/Identifeye
0
38389
from difflib import SequenceMatcher """ A Python program to demonstrate the adjacency list representation of the graph """ # weights arreay by value weights = [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7] # A class to represent the adjacency list of the node class AdjNode: def __init__(s...
4.03125
4
scripts/flowed_plaquette_plot.py
hmvege/GluonicLQCD
1
38390
<reponame>hmvege/GluonicLQCD import matplotlib.pyplot as plt, numpy as np plaq_morningstar_ubuntu = np.array(""" 0 0.61401745 1 0.62927918 2 0.64409064 3 0.65844519 4 0.67233862 5 0.68576903 6 0.69873661 7 0.71124351 8 0.72329362 9 0.73489239 10 0.74604666 11 0.7...
2.109375
2
pyalgs/data_structures/commons/queue.py
vertexproject/pyalgs
12
38391
<reponame>vertexproject/pyalgs from abc import abstractmethod, ABCMeta class Queue(object): """ Queue interface """ __metaclass__ = ABCMeta @abstractmethod def enqueue(self, item): pass @abstractmethod def dequeue(self): pass @abstractmethod def is_empty(se...
3.46875
3
anchore_manager/version.py
Nordix/anchore-engine
110
38392
<filename>anchore_manager/version.py version = "0.9.4"
1.070313
1
GaussianTrashSource.py
jkamalu/trashbots-RL
1
38393
<filename>GaussianTrashSource.py from numpy.random import multivariate_normal class GaussianTrashSource: def __init__(self, mean, max_y, max_x, cov=[[1,0],[0,1]], id=None): """ Creates a trashsource Parameters ---------- cov: 2x2 matrix, covariance ...
3.21875
3
twitter_user/__init__.py
hostinfodev/twitter-user
0
38394
from selenium.webdriver.firefox.options import Options from webdriver_manager.firefox import GeckoDriverManager from seleniumwire import webdriver from .fetch import fetchUser as fetchUser_ class TwitterUser(object): # __CONSTRUCTOR def __init__(self, allowed_connection_retries=20, allowed_parsing_retries=500...
2.5
2
file_operations.py
OrkunAvci/Content-Based-Image-Retrieval
0
38395
import cv2 as cv from os import listdir from os.path import isfile, join import json folders = [ # Img sets to use "octopus", "elephant", "flamingo", "kangaroo", "leopards", "sea_horse" ] files = [f for f in listdir("./data/camera") if isfile(join("./data/camera", f))] # Get all file names train_file_nam...
2.75
3
inner_rpc/inner_rpc/ir_exceptions.py
chenjiee815/inner_rpc
1
38396
<reponame>chenjiee815/inner_rpc #!/usr/bin/env python # encoding=utf-8 """ inner_rpc.ir_exceptions ----------------- 该模块主要包括公共的异常定义 """ class BaseError(Exception): pass class SocketError(BaseError): pass class SocketTimeout(SocketError): pass class DataError(BaseError): pass
1.84375
2
floodsystem/analysis.py
AndrewKeYanzhe/part-ia-flood-warning-system
0
38397
<filename>floodsystem/analysis.py import matplotlib import numpy as np def polyfit (dates, levels, p): # dates = matplotlib.dates.date2num(dates) p_coeff = np.polyfit(dates,levels,p) # p_coeff = np.polyfit(dates-dates[0],levels,p) poly = np.poly1d(p_coeff) return poly, dates[0]
3.015625
3
examples/example_backward_elimination.py
patricklai14/gmp_feature_selection
0
38398
from ase import Atoms from ase.calculators.emt import EMT from ase.io.trajectory import Trajectory from ase.io import read import numpy as np import pandas as pd import argparse import copy import os import pdb import pickle from model_eval import model_evaluation from gmp_feature_selection import backward_eliminati...
2.078125
2
merlin/cfg.py
USGS-EROS/lcmap-merlin
0
38399
from cytoolz import assoc from cytoolz import merge from functools import partial from merlin import chipmunk from merlin import chips from merlin import dates from merlin import formats from merlin import specs import os ubids = {'chipmunk-ard': {'reds': ['LC08_SRB4', 'LE07_SRB3', 'LT05_SRB3', 'LT04_SRB...
1.75
2