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 |
|---|---|---|---|---|---|---|
doc/conf.py | IJSComplexMatter/dtmm | 3 | 12765951 | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 1.859375 | 2 |
city_scrapers/spiders/summ_developmental_disabilities.py | City-Bureau/city-scrapers-akr | 0 | 12765952 | <reponame>City-Bureau/city-scrapers-akr<filename>city_scrapers/spiders/summ_developmental_disabilities.py
import json
import re
from datetime import datetime
import scrapy
from city_scrapers_core.constants import BOARD
from city_scrapers_core.items import Meeting
from city_scrapers_core.spiders import CityScrapersSpid... | 2.4375 | 2 |
abc/ABC162/python/c.py | yokotani92/atcoder | 0 | 12765953 | import math
K = int(input())
ans = 0
for i in range(1, K+1):
for j in range(i, K+1):
for k in range(j, K+1):
if (i == j) and (j == k):
ans += math.gcd(i, math.gcd(j, k))
elif (i == j) or (j == k):
ans += 3 * math.gcd(i, math.gcd(j, k))
else... | 3.59375 | 4 |
deprecated.py | jp-richter/formelbaer-rnn | 0 | 12765954 | <reponame>jp-richter/formelbaer-rnn<filename>deprecated.py<gh_stars>0
import sys
import os
import torch
import numpy
import tokens
import config
import generator
import re
import matplotlib.pyplot as plt
class PolicyEvaluator:
def _plot(self, x, y, legend):
figure, axis = plt.subplots()
for y, l... | 1.960938 | 2 |
eventos/views.py | aromero45/proyecto0 | 0 | 12765955 |
from . import models
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
import json
from django.views.decorators.csrf import csrf_exempt
# Create your views here.
#Se define endp... | 2.109375 | 2 |
src/scantree/_scan.py | tomasaschan/scantree | 8 | 12765956 | <filename>src/scantree/_scan.py
from __future__ import print_function, division
import os
from multiprocessing.pool import Pool
from pathspec import RecursionError as _RecursionError
from .compat import fspath
from ._node import (
DirNode,
LinkedDir,
CyclicLinkedDir,
identity,
is_empty_dir_node
... | 3.515625 | 4 |
airbyte_dto_factory.py | eSchwander/airbyte-tentacle | 0 | 12765957 | class SourceDto:
"""Data transfer object class for Source-type Airbyte abstractions"""
def __init__(self):
self.source_definition_id = None
self.source_id = None
self.workspace_id = None
self.connection_configuration = {}
self.name = None
self.source_name = None
... | 2.734375 | 3 |
page/scrape.py | johnb30/atlas | 13 | 12765958 | <filename>page/scrape.py
from __future__ import unicode_literals
import requests
import timeout_decorator
from bs4 import BeautifulSoup
from selenium import webdriver
def scrape(url, extractor, proxy_choice, proxy_login, raw_html=''):
"""
Function to request and parse a given URL. Returns only the "relevant"
... | 3.453125 | 3 |
4_in_1_Python_Games_for_Beginers.py | M-O-N-Q/4_in_1_Python_Games_for_Beginners | 0 | 12765959 | <gh_stars>0
import random as rand
play_again4 = 'y'
play_again2 = 'y'
while play_again2 == 'y':
print("Which Game would you like to play: ")
print("1. Guess the number")
print("2. Mad libs")
print("3. Roll a Die")
print("4. Math Game")
which_game = input("\nEnter your Choice: ")
... | 4.03125 | 4 |
regex_builder/errors.py | Zomatree/regex-builder | 3 | 12765960 | <reponame>Zomatree/regex-builder<filename>regex_builder/errors.py
class NotSection(Exception):
pass
| 1.0625 | 1 |
models/amenity.py | kemboy-254/AirBnB_clone | 0 | 12765961 | #!/usr/bin/python3
"""New class inherit from BaseModel"""
from models.base_model import BaseModel
class Amenity(BaseModel):
"""Class Amenity that inherit from BaseModel"""
name = ""
| 3.15625 | 3 |
django_librest/yasg.py | FRA1T/django_librest | 5 | 12765962 | <gh_stars>1-10
from django.urls import path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
schema_view = get_schema_view(
openapi.Info(
title="Library API",
default_version='v1',
description="Books for everyone!",
contact=openap... | 1.8125 | 2 |
Parsers/Parser.py | maoyuwang/ChangeLogger | 0 | 12765963 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from threading import Thread
from Parsers.Common import *
class Parser(Thread):
def __init__(self):
"""
Initialize a Parser thread.
"""
Thread.__init__(self)
self.deamon = True
self.result = None
def run(self):
""... | 3.265625 | 3 |
_includes/die.py | alexj136/alexj136.github.io | 0 | 12765964 | import random
targetNumber = 6
def throwDie():
print("rolling...")
rand = random.randint(1, 6)
print(str(rand) + "!")
return rand
# roll a 6-sided die until the given target number comes up.
# Return the total number of throws.
def rollDieUntilTarget(target):
print("Rolling until a " + str(target... | 3.9375 | 4 |
retsinfo_app/documents/migrations/0002_rename_documentembeddings_documentembedding.py | IIMunchII/retsinformation | 1 | 12765965 | # Generated by Django 3.2 on 2021-05-30 18:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('scrapers', '0011_alter_retsinfosentences_document'),
('documents', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_n... | 1.679688 | 2 |
Model_setup/NEISO_data_setup.py | keremakdemir/ISONE_UCED | 0 | 12765966 | # -*- coding: utf-8 -*-
"""
Created on Wed May 03 15:01:31 2017
@author: jdkern
"""
import pandas as pd
import numpy as np
#read generator parameters into DataFrame
df_gen = pd.read_excel('NEISO_data_file/generators.xlsx',header=0)
#read transmission path parameters into DataFrame
df_paths = pd.read_csv('NEISO_data... | 2.359375 | 2 |
tests/bootstrap3/test_section.py | angonyfox/djangocms-cascade | 0 | 12765967 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from bs4 import BeautifulSoup
from django.http import QueryDict
from cms.api import add_plugin
from cms.utils.plugins import build_plugin_tree
from cmsplugin_cascade.models import CascadeElement
from cmsplugin_cascade.bootstrap3.container import (Bootstra... | 1.921875 | 2 |
specter/__main__.py | breekristensen/Specter | 18 | 12765968 | from specter.runner import activate
activate()
| 1.015625 | 1 |
L1Trigger/L1THGCal/python/customTriggerCellSelect.py | Purva-Chaudhari/cmssw | 852 | 12765969 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam
from L1Trigger.L1THGCal.hgcalConcentratorProducer_cfi import threshold_conc_proc, best_conc_proc, supertc_conc_proc, coarsetc_onebitfraction_proc, coarsetc_equalshare_proc, bestchoice_ndat... | 1.625 | 2 |
deepchem/feat/molecule_featurizers/maccs_keys_fingerprint.py | deloragaskins/deepchem | 3,782 | 12765970 | <gh_stars>1000+
import numpy as np
from deepchem.utils.typing import RDKitMol
from deepchem.feat.base_classes import MolecularFeaturizer
class MACCSKeysFingerprint(MolecularFeaturizer):
"""MACCS Keys Fingerprint.
The MACCS (Molecular ACCess System) keys are one of the most commonly used structural keys.
Pleas... | 2.6875 | 3 |
fastai_xla_extensions/core.py | hixio-mh/fastai_xla_extensions | 33 | 12765971 | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_core.ipynb (unless otherwise specified).
__all__ = ['XLAOptimProxy', 'DeviceMoverTransform', 'isAffineCoordTfm', 'isDeviceMoverTransform', 'has_affinecoord_tfm',
'has_devicemover_tfm', 'get_last_affinecoord_tfm_idx', 'insert_batch_tfm', 'XLAOptCallback']
#... | 1.914063 | 2 |
twit_app/__init__.py | RMDircio/Twit_vs_Twit | 0 | 12765972 | <gh_stars>0
from flask import Flask
from twit_app.models import db, migrate
from twit_app.routes.user_routes import user_routes
from twit_app.routes.tweet_routes import tweet_routes
from twit_app.routes.Twitter_routes import Twitter_routes
from twit_app.routes.prediction_routes import prediction_routes
DATABASE_URI ... | 2.296875 | 2 |
applicationinsights/channel/contracts/__init__.py | allieus/ApplicationInsights-Python | 1 | 12765973 | <reponame>allieus/ApplicationInsights-Python<filename>applicationinsights/channel/contracts/__init__.py
from .Data import Data
from .Envelope import Envelope
from .DependencyKind import DependencyKind
from .SeverityLevel import SeverityLevel
from .DataPoint import DataPoint
from .MetricData import MetricData
from .Remo... | 1.179688 | 1 |
sars_dashboard/dashboards/views.py | thomasbtf/sars-dashboard | 0 | 12765974 | import pandas as pd
import plotly.express as px
from django.views.generic.base import TemplateView
from plotly.offline import plot
from sars_dashboard.calls.models import PangolinCall
from sars_dashboard.projects.models import Project
from sars_dashboard.samples.models import Sample
from sars_dashboard.voc_definitions... | 2.1875 | 2 |
dispatcher.py | dontcrenie/SNCF-Flask-webapp | 1 | 12765975 | <filename>dispatcher.py
from flask import Flask
from restservice import app as restserv
from train import app as mainapp
from handler import app as soapserv
from werkzeug.middleware.dispatcher import DispatcherMiddleware
app = Flask(__name__)
app.wsgi_app = DispatcherMiddleware(mainapp, {
'/restservice': restserv... | 1.875 | 2 |
scripts/config.py | Debraj2399/Zebra | 4 | 12765976 | import os
import glob
import sys
import error_handle as eh
###########################################################################################################################
def initialize():
###########################################################################################################... | 1.609375 | 2 |
slackapptk/request/view.py | minitriga/slackapptk | 2 | 12765977 | from slackapptk.request.any import AnyRequest
from slackapptk.web.classes.view import View
__all__ = [
'AnyRequest',
'ViewRequest',
'View'
]
class ViewRequest(AnyRequest):
def __init__(
self,
app,
payload
):
super().__init__(
app=app,
rqst_t... | 2.140625 | 2 |
tests/test_speed.py | TobiasKonradsen/Chessure | 1 | 12765978 | <reponame>TobiasKonradsen/Chessure<filename>tests/test_speed.py
# import unittest
# import time
# from game_logic.moves import Moves as SlowMoves, SlowMoves as Moves
# n = 100_000
# class TestSpeed(unittest.TestCase):
# def createMoves(self):
# j = 0
# for i in range(n):
# m = Moves(... | 3.578125 | 4 |
indexers/vector/NmsLibIndexer/__init__.py | Gracegrx/jina-hub | 0 | 12765979 | <reponame>Gracegrx/jina-hub
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
from typing import Tuple, Optional, Dict, Any
import numpy as np
from jina.executors.indexers.vector import BaseNumpyIndexer
from jina.executors.decorators import batching
class NmsLibIn... | 2.4375 | 2 |
deps_report/utils/output/common.py | MeilleursAgents/deps-report | 0 | 12765980 | from packaging import version as version_parser
from deps_report.models import Dependency
from deps_report.models.results import VersionResult
def get_display_output_for_dependency(dependency: Dependency) -> str:
"""Get display name for dependency with some details (transitive, dev-only...)."""
properties = ... | 2.375 | 2 |
modules/kku/choicing_relevant_information_in_articles.py | f4ll1nn/online-lawyer | 0 | 12765981 | """ Module of realisation choice relevant information in articles """
import langdetect
import openpyxl
import pandas as pd
import modules.pytextrank.pytextrank.pytextrank as pyt
from nltk.corpus import wordnet
from modules.kku.trans.mtranslate.mtranslate import translate
class Article:
""" Class of articles """... | 2.984375 | 3 |
src/babysteps/cal/fluke8845a.py | solohm/multimeter | 1 | 12765982 | #!/usr/bin/env python
import socket,time,serial,sys
def removeexp(s):
try:
return float(s)
except ValueError:
return s
class fluke8845a(object):
def __init__(self,host='fluke1',port=3490):
self.host = host
self.port = port
self.connect()
def connect(self):
... | 2.703125 | 3 |
main.py | datagym-ru/server-snitch | 2 | 12765983 | <reponame>datagym-ru/server-snitch
import subprocess
import pandas as pd
from flask import Flask
from werkzeug.contrib.cache import SimpleCache
CRT_FILE = '/etc/jupyterhub/jupyterhub.crt'
KEY_FILE = '/etc/jupyterhub/jupyterhub.key'
PORT = 12304
HOST = '0.0.0.0'
JUPYTER_HOST_API_USERS = 'http://127.0.0.1:8081/jupyterh... | 2.0625 | 2 |
fee_calculator/settings/docker.py | ministryofjustice/laa-fee-calcualtor | 1 | 12765984 | from .base import * # noqa
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY')
ALLOWED_HOSTS = [
'localhost',
'.dsd.io',
'.service.justice.gov.uk'
]
| 1.25 | 1 |
Chapter04/Exercise4.01/Exercise4.01_Unit_test.py | PacktWorkshops/Applied-Deep-Learning-with-Keras | 1 | 12765985 | <filename>Chapter04/Exercise4.01/Exercise4.01_Unit_test.py
import unittest
import numpy as np
import pandas as pd
import numpy.testing as np_testing
import pandas.testing as pd_testing
import os
import import_ipynb
class Test(unittest.TestCase):
def _dirname_if_file(self, filename):
if os.path.isdir(f... | 2.84375 | 3 |
fuzzinator/job/update_job.py | pmatos/fuzzinator | 0 | 12765986 | <reponame>pmatos/fuzzinator
# Copyright (c) 2016-2021 <NAME>, <NAME>.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from ..config import config_get_callable
class ... | 1.929688 | 2 |
Absolute_Integrator/peak_finding/template_match.py | msarahan/Absolute_Integrator | 0 | 12765987 | import numpy as np
# dictionary describing options available to tune this algorithm
options = {
"peak_size": {"purpose": "Estimate of the peak size, in pixels. If 'auto', attempts to determine automatically. Otherwise, this should be an integer.",
"default": "auto",
"type": "i... | 2.796875 | 3 |
TSClusteringLayer.py | JingWENZHA/DTC | 0 | 12765988 | <gh_stars>0
"""
Implementation of the Deep Temporal Clustering model
Time Series Clustering layer
@author <NAME> (FlorentF9)
"""
# from keras.engine.topology import Layer, InputSpec
from tensorflow.keras.layers import Layer, InputSpec
import keras.backend as K
class TSClusteringLayer(Layer):
"""
Clustering ... | 2.640625 | 3 |
Python Advanced/2. Tuples And Sets/Lab/02. Students' Grades.py | a-shiro/SoftUni-Courses | 0 | 12765989 | <reponame>a-shiro/SoftUni-Courses<gh_stars>0
def get_average(g):
return sum(g) / len(g)
n = int(input())
students_record = {}
for _ in range(n):
student, grade = input().split()
if student not in students_record:
students_record[student] = []
students_record[student].append(float(grade))
... | 3.703125 | 4 |
wg-manager-backend/script/wireguard_startup.py | SH-Daemon/wg-manager | 417 | 12765990 | import os
import typing
from sqlalchemy.orm import Session
import const
from database import models
from database.database import SessionLocal
from db.api_key import add_initial_api_key_for_admin
from db.wireguard import server_add_on_init
from script.wireguard import is_installed, start_interface, is_running, load_e... | 2.03125 | 2 |
tests/test_players.py | dmayilyan/dominoes | 38 | 12765991 | <filename>tests/test_players.py<gh_stars>10-100
import copy
import dominoes
import time
import unittest
def _new_game_with_fixed_moves(fixed_moves):
while True:
g = dominoes.Game.new()
for _ in range(fixed_moves):
g.make_move(*g.valid_moves[0])
if g.result is not None:
... | 2.875 | 3 |
services/datalad/datalad_service/handlers/annex.py | tommydino93/openneuro | 57 | 12765992 | import hashlib
import logging
import os
import shutil
import struct
import tempfile
import falcon
from datalad_service.common.stream import update_file
from datalad_service.handlers.git import _check_git_access, _handle_failed_access
def hashdirmixed(key):
"""Python implementation of git-annex hashing for non-b... | 2.59375 | 3 |
codes/course2/demo1.py | BigShuang/big-shuang-python-introductory-course | 0 | 12765993 | names = ["Alan", "Bruce", "Carlos", "David", "Emma"]
scores = [90, 80, 85, 92, 81]
for name in names:
print("hello, %s!" % name)
| 3.359375 | 3 |
cages/.shared/reverse_call.py | targeted/pythomnic3k | 0 | 12765994 | <gh_stars>0
#!/usr/bin/env python3
#-*- coding: iso-8859-1 -*-
################################################################################
#
# This module handles reverse RPC calls, in which target cage actively polls
# for incoming calls, rather that passively waiting for them.
#
# On source cage, a reverse RPC c... | 2.25 | 2 |
flora_tools/utilities.py | Atokulus/flora-tools | 1 | 12765995 | <filename>flora_tools/utilities.py
import random
import string
import numpy as np
def get_random_text(length=None, max_length=254):
if length is None:
length = np.random.randint(-1, max_length + 1)
if length < 0:
return None
else:
text = ''.join(random.choices(string.ascii_letters... | 2.796875 | 3 |
carmesi/nucleo/tests/test_services_token.py | RedGranatum/Carmesi | 0 | 12765996 | <gh_stars>0
# Standar Library
from datetime import datetime, timezone
# Django
from django.test import TestCase
from django.core.exceptions import ValidationError
# Services & Builder
from nucleo.services.token_builders import(
TokenFactory,
TOKEN_TIPO_CLIENTE,
TOKEN_TIPO_USUARIO,
TOKEN_TIPO_USUARIO_... | 2.28125 | 2 |
tests/test_perceptron.py | KEVINYZY/plume | 22 | 12765997 | from plume.perceptron import PerceptronClassifier
import numpy as np
x_train = np.array([[3, 3], [4, 3], [1, 1]])
y_train = np.array([1, 1, -1])
clf = PerceptronClassifier(dual=False)
clf.fit(x_train, y_train)
print(clf.get_model())
print(clf.predict(x_train))
clf1 = PerceptronClassifier()
clf1.fit(x_train, y_trai... | 3.171875 | 3 |
ChasingTrainFramework_GeneralOneClassDetection/data_provider_base/base_provider.py | dvt0101/A-Light-and-Fast-Face-Detector-for-Edge-Devices | 1,172 | 12765998 | """
This module takes an adapter as data supplier, pack data and provide data for data iterators
"""
class ProviderBaseclass(object):
"""
This is the baseclass of packer. Any other detailed packer must inherit this class.
"""
def __init__(self):
pass
def __str__(self):
return se... | 2.875 | 3 |
code401challengespython/array_shift/array_shift.py | danhuyle508/data-structures-and-algorithms | 0 | 12765999 | def insertShiftArray(arr, num):
count = len(arr)
middle = len(arr) // 2
shift_arr = []
for i in range(count):
if i != middle:
shift_arr.append(arr[i])
else:
if count % 2 == 0:
shift_arr.append(num)
shift_arr.append(arr[i])
... | 3.78125 | 4 |
ner_plugins/NER_BERT.py | ArinaBelova/MASK_public | 0 | 12766000 | from transformers import BertForTokenClassification
import torch
from transformers import BertTokenizer
import numpy as np
import nltk.data
nltk.download('punkt')
import torch
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from transformers import BertTokenizer, BertConfig, Au... | 2.265625 | 2 |
omics/feature_selection/MRMR.py | choyichen/pybcb | 3 | 12766001 | """MRMR method.
Implementation of Ding (2005) Minimum redundancyi-maximum relevance (MRMR) feature selection method.
Minimum redundancy feature selection from microarray gene expression data.
<NAME>, <NAME>
J Bioinform Comput Biol. 2005 Apr; 3(2) 185-205
DOI: 10.1142/S0219720005001004, PMID: 15852500
"""
import panda... | 3.328125 | 3 |
P0-Tutorial/tutorial/shop.py | jorcus/CS188-Intro-to-AI | 6 | 12766002 | <reponame>jorcus/CS188-Intro-to-AI
# shop.py
# -------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to... | 3.265625 | 3 |
tests/test_api_refund.py | obytes/tap-python | 3 | 12766003 | <reponame>obytes/tap-python<filename>tests/test_api_refund.py
from . import tap_vcr
import pytest
import tap
from tap.api_resources.refund import Refund
@tap_vcr.use_cassette('refund/create_refund.yaml')
def test_create_refund(create_customer, create_charge):
customer = create_customer()
charge = create_charg... | 2.40625 | 2 |
patch_rt_container_registry_repos/python/list_docker_repos.py | jfrog/log4j_tools | 170 | 12766004 | import sys
import requests
from urllib.parse import urljoin
JFROG_API_KEY_HEADER_NAME = 'X-JFrog-Art-Api'
class DockerRegistryPagination:
def __init__(self, concatenating_key):
self.concatenating_key = concatenating_key
def __call__(self, url, *args, **kwargs):
response = requests.get(url, *... | 2.5625 | 3 |
coffea/lumi_tools/__init__.py | dnoonan08/coffea | 1 | 12766005 | <gh_stars>1-10
"""Tools to parse CMS luminosity non-event data
These tools are currently tailored to the CMS experiment
data formats, however they could be generalized and/or compartmentalized
into a standalone package.
"""
from .lumi_tools import (
LumiData,
LumiList,
LumiMask,
)
__all__ = [
'LumiDat... | 1.203125 | 1 |
IceSpringMusicPlayer/plugins/IceSpringPlaylistPlugin/playlistWidgetConfig.py | baijifeilong/rawsteelp | 0 | 12766006 | <filename>IceSpringMusicPlayer/plugins/IceSpringPlaylistPlugin/playlistWidgetConfig.py
# Created by <EMAIL> at 2022/2/14 14:52
from __future__ import annotations
import dataclasses
from IceSpringMusicPlayer.common.jsonSupport import JsonSupport
@dataclasses.dataclass
class PlaylistWidgetConfig(JsonSupport):
row... | 1.828125 | 2 |
hostname_resolver/custom_datatypes/gatherunique/__init__.py | dpazavalos/bulk-hostname-scanner | 0 | 12766007 | <filename>hostname_resolver/custom_datatypes/gatherunique/__init__.py
"""Reusable unique item gatherer. Returns unique values with optional list_in and blacklists"""
class GatherUnique:
"""
Reusable unique item gatherer. Returns unique values with optional list_in and blacklists
"""
def __init__(self... | 3.0625 | 3 |
tests/test_utils_mem.py | PSandeepSandy/fastai | 0 | 12766008 | import pytest, fastai
from fastai.utils.mem import *
from math import isclose
# Important: When modifying this test module, make sure to validate that it runs w/o
# GPU, by running: CUDA_VISIBLE_DEVICES="" pytest
# most tests are run regardless of cuda available or not, we just get zeros when gpu is not available
if t... | 2.703125 | 3 |
savecode/pythonpackages/commonbaby/mslog/filelogprovider.py | Octoberr/swm0920 | 2 | 12766009 | <filename>savecode/pythonpackages/commonbaby/mslog/filelogprovider.py
"""File log provider that provides separated log file write"""
# -*- coding:utf-8 -*-
from .filelogwriter import MsFileLogWriter
from .mslogconfig import MsFileLogConfig, MsLogConfig
from .msloglevel import MsLogLevels
from .mslogprovider import Ms... | 3.015625 | 3 |
client/verta/tests/test_versioning/test_code.py | stefan-petrov-toptal/modeldb | 1 | 12766010 | <gh_stars>1-10
import pytest
import hypothesis
import hypothesis.strategies as st
import itertools
from google.protobuf import json_format
import verta.code
from verta._internal_utils import _git_utils
# check if in git repo
try:
_git_utils.get_git_repo_root_dir()
except OSError:
IN_GIT_REPO = False
else:
... | 2.171875 | 2 |
Data Science With Python/15-statistical-thinking-in-python-(part1)/4-thinking-probabilistically--continuous-variables/the-normal-cdf.py | aimanahmedmoin1997/DataCamp | 3 | 12766011 | '''
The Normal CDF
100xp
Now that you have a feel for how the Normal PDF looks, let's consider its CDF. Using the
samples you generated in the last exercise (in your namespace as samples_std1, samples_std3,
and samples_std10), generate and plot the CDFs.
Instructions
-Use your ecdf() function to generate x and y value... | 4.28125 | 4 |
firstcode.py | congnb/mypython | 1 | 12766012 | import sys
a="hello"
def myfunc():
print("xxxx")
a="du"
print (a)
myfunc()
print(a)
x="xxxxx\""
print(x, x[3:9])
print (str.format("abc {}",a))
for x in range(10):
if x%2 == 0:
print(x)
else:
pass
# while True:
# print(a)
powOf = lambda a : a*a
print(powOf(4))
def lbdIn... | 3.625 | 4 |
ParaMol/Tasks/parametrization.py | mnagaku/ParaMol | 15 | 12766013 | # -*- coding: utf-8 -*-
"""
Description
-----------
This module defines the :obj:`ParaMol.Tasks.parametrization.Parametrization` class, which is a ParaMol task that performs force field parametrization.
"""
import numpy as np
import logging
# ParaMol libraries
from .task import *
from ..Optimizers.optimizer import *
f... | 2.40625 | 2 |
app/__init__.py | BerniceWu/SpotifyBot | 0 | 12766014 | import sys
from flask import Flask
import telegram
import spotipy
import spotipy.util as util
from spotipy.oauth2 import SpotifyClientCredentials
from config import config
bot = None
spotify = None
def create_app(config_name):
global bot
global spotify
app = Flask(__name__)
app.config.from_object... | 2.390625 | 2 |
libcloud/container/base.py | brookewhite9/libcloud | 0 | 12766015 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 1.765625 | 2 |
alipay/aop/api/domain/AlipayEcoMycarMaintainShopModifyModel.py | articuly/alipay-sdk-python-all | 0 | 12766016 | <filename>alipay/aop/api/domain/AlipayEcoMycarMaintainShopModifyModel.py<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayEcoMycarMaintainShopModifyModel(object):
def __init__(self):
self._address = None
... | 2.125 | 2 |
frameworks/Python/falcon/app_waitress.py | http4k/FrameworkBenchmarks | 2 | 12766017 | <filename>frameworks/Python/falcon/app_waitress.py
#!/usr/bin/env python
from waitress import serve
from app import wsgi
from gunicorn_conf import bind, keepalive, workers
import logging
if __name__ == "__main__":
logging.basicConfig()
logging.getLogger().setLevel(logging.CRITICAL)
logging.disable(True)
... | 1.632813 | 2 |
server/runtime/cleanData/removeTrashData.py | Hackorama2019/donde-comprar | 0 | 12766018 | <filename>server/runtime/cleanData/removeTrashData.py<gh_stars>0
import json
import pandas as pd
import numpy as np
with open("./totalData.json", 'r') as json_file:
data = json.load(json_file)
data = np.array(data["data"])
futureDataFrame = []
columns = []
for keys in data[0].keys():
if... | 3.09375 | 3 |
app/main.py | jjrpayne/starter-snake-python | 0 | 12766019 | import json
import os
import random
import bottle
from api import ping_response, start_response, move_response, end_response
@bottle.route('/')
def index():
return '''
Battlesnake documentation can be found at
<a href="https://docs.battlesnake.com">https://docs.battlesnake.com</a>.
'''
@bottle.route('/stati... | 3.5625 | 4 |
.history/blog/urls_20200416031229.py | abhinavmarwaha/demo-django-blog | 0 | 12766020 | <gh_stars>0
from django.conf.urls import url
from django.contrib import admin
from djangoo.u
urlpatterns = [
path(r'^admin/', admin.site.urls),
]
| 1.375 | 1 |
src/_set_import_paths.py | gordonsilvera/project-implicit | 0 | 12766021 | #!/usr/bin/env python3
import site
import configs
SOURCE_CODE_FILEPATH = '/home/jovyan/work/src'
def set_import_path(import_path=configs.SOURCE_CODE_FILEPATH):
site.addsitedir(import_path)
print("Added the following path to the import paths "
"list:\n{}".format(import_path))
if __name__ == '__mai... | 2.234375 | 2 |
setup.py | libffcv/tf-ffcv | 7 | 12766022 | from setuptools import setup
setup(
name="tf-ffcv",
version="0.0.2",
packages=["tf_ffcv"],
description='Utilitaries to integrate tensorflow to FFCV',
author='MadryLab',
author_email='<EMAIL>',
)
| 1.078125 | 1 |
service/paged-rest-proxy.py | andebor/paged-rest-proxy | 0 | 12766023 | <gh_stars>0
import json
from flask import Flask, request, Response
import os
import requests
import logging
import dotdictify
from time import sleep
app = Flask(__name__)
logger = None
format_string = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logger = logging.getLogger('paged-datasource-service')
# Log ... | 2.390625 | 2 |
inference/grpc_inference_generator.py | nncrystals/maskrcnn-benchmark | 1 | 12766024 | <gh_stars>1-10
import logging
import threading
import grpc
import io
import random
import torch
import torchvision
from PIL import Image
from inference.configuration import cfg
from inference.service import InferenceService
import inference.proto.inference_service_pb2_grpc as grpc_service
import inference.proto.inf... | 2.171875 | 2 |
src/jk_simpleexec/invoke_utils.py | jkpubsrc/python-module-jk-simpleexec | 0 | 12766025 | <reponame>jkpubsrc/python-module-jk-simpleexec
import os
import subprocess
import invoke
from . import _common as _common
from .CommandResult import CommandResult
from .TextDataProcessingPolicy import TextDataProcessingPolicy
try:
from fabric import Connection
except ImportError as ee:
pass
#
# Run a comman... | 2.328125 | 2 |
huxley/core/tests/admin/test_registration.py | srisainachuri/huxley | 18 | 12766026 | # Copyright (c) 2011-2017 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
from django.urls import reverse
from django.test import TestCase
from huxley.utils.test import models
class RegistrationAdminTest(TestCase):
fixtures = ['conferenc... | 2.046875 | 2 |
ilscvr/step2/compression_conv_fc.py | chatzikon/DNN-COMPRESSION | 9 | 12766027 | import sys
sys.path.append('../')
import torchnet as tnt
from torch.autograd import Variable
import torch.nn.functional as F
from model_utils.load_utils import load_model, SAVE_ROOT
from model_utils.model_utils import get_layer_names
MODEL_NAME='mobilenetv2_imagenet'
model_init,model = load_model(MO... | 2.375 | 2 |
student/migrations/0002_institute_names.py | YarinBou/SJMaster | 1 | 12766028 | <reponame>YarinBou/SJMaster
from django.db import migrations, transaction
class Migration(migrations.Migration):
dependencies = [
('student', '0001_initial'),
]
def generate_data(apps, schema_editor):
from student.models import EducationalInstitution
institution_names = [
... | 2.15625 | 2 |
consensys_utils/flask/config.py | ConsenSys/python-utils | 4 | 12766029 | """
consensys_utils.flask.config
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
App configuration
:copyright: Copyright 2017 by ConsenSys France.
:license: BSD, see :ref:`license` for more details.
"""
def set_app_config(app, config=None):
"""Set application configuration
:param app: Flask application
... | 1.820313 | 2 |
pylsl/motor_imagery_app.py | aume1/liblsl-Python | 0 | 12766030 | """Example program to show how to read a multi-channel time series from LSL."""
import math
import threading
# import pygame
from random import random
from sklearn.preprocessing import OneHotEncoder
from pylsl import StreamInlet, resolve_stream
import numpy as np
import pandas as pd
import time
from sklearn import m... | 2.578125 | 3 |
at_seq.py | AlejandraWilson/learning_python | 0 | 12766031 | <filename>at_seq.py<gh_stars>0
#!/usr/bin/env python3
import random
#random.seed(1) # comment-out this line to change sequence each time
# Write a program that stores random DNA sequence in a string
# The sequence should be 30 nt long
# On average, the sequence should be 60% AT
# Calculate the actual AT fraction whil... | 4.0625 | 4 |
mongomock/connection.py | thedrow/mongomock | 0 | 12766032 | import itertools
from .database import Database
class Connection(object):
_CONNECTION_ID = itertools.count()
def __init__(self, host = None, port = None, max_pool_size = 10,
network_timeout = None, document_class = dict,
tz_aware = False, _connect = True, **kwargs):
... | 2.359375 | 2 |
tests/brusselator/test_brusselator.py | masumis/pymgrit | 6 | 12766033 | """
Tests brusselator
"""
import numpy as np
from pymgrit.brusselator.brusselator import Brusselator
from pymgrit.brusselator.brusselator import VectorBrusselator
def test_brusselator_constructor():
"""
Test constructor
"""
brusselator = Brusselator(t_start=0, t_stop=1, nt=11)
np.testing.assert_... | 2.765625 | 3 |
ref/signature.py | bbbbbr/porklike.gb | 14 | 12766034 | # Carve
# sigs = [255,214,124,179,233]
# msks = [0,9,3,12,6]
# Door
# sigs = [192,48]
# msks = [15,15]
# Freestanding
# sigs=[0,0,0,0,16,64,32,128,161,104,84,146]
# msks=[8,4,2,1,6,12,9,3,10,5,10,5]
# Walls
sigs=[251,233,253,84,146,80,16,144,112,208,241,248,210,177,225,120,179,0,124,104,161,64,240,128,224,176,242,24... | 2.390625 | 2 |
scfmsp/controlflowanalysis/instructions/InstructionCmp.py | sepidehpouyan/SCF-MSP430 | 1 | 12766035 | from scfmsp.controlflowanalysis.instructions.AbstractInstructionTwoRegisters import AbstractInstructionTwoRegisters
class InstructionCmp(AbstractInstructionTwoRegisters):
name = 'cmp'
def get_execution_time(self):
return self.clock
def execute_judgment(self, ac):
self._execute_judgment_... | 2.1875 | 2 |
stock_image_clf/somemodels.py | ernest222/- | 10 | 12766036 | from keras import layers
from keras import models
def cnn_model(shape=(80,80,3),dropout=0.5,last_activation='softmax'):
model=models.Sequential()
model.add(layers.Conv2D(64,(3,3),activation='relu',input_shape=shape))
model.add(layers.MaxPool2D((2,2)))
model.add(layers.Conv2D(64,(3,3),act... | 3.296875 | 3 |
python/213_2.py | kylekanos/project-euler-1 | 0 | 12766037 | <filename>python/213_2.py
#!/usr/bin/env python
from gmpy import mpf
off = [(0,1), (1,0), (0,-1), (-1,0)]
paths = [ [[0]*900 for j in xrange(900)] for i in xrange(2) ]
for i in xrange(900):
paths[0][i][i] = 1
for r in xrange(50):
print r
c = (r+1)%2
p = r%2
for i in xrange(900):
y, x = i//... | 2.25 | 2 |
main.py | mystic-wizord/apex-framework | 0 | 12766038 | <filename>main.py
import pathlib
import os
import pwd
import click
import chevron
import json
import yaml
@click.group()
def cli():
"""
Thank you for using Apex Framework!
"""
pass
@cli.command()
def init():
click.echo(f"Initializing Apex!")
pathlib.Path(f'./apex-framework').mkdir(parents=Tru... | 2.765625 | 3 |
adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/circuitplayground_tapdetect.py | jacoblb64/pico_rgb_keypad_hid | 75 | 12766039 | <filename>adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/circuitplayground_tapdetect.py
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""This example prints to the serial console when the board is double-tapped."""
import time
from adafrui... | 2.671875 | 3 |
photos/serializers.py | christianwgd/photos | 0 | 12766040 | <filename>photos/serializers.py
# -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Photo, Event, Import, Tag
class EventSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Event
fields = ['url', 'id',... | 2.09375 | 2 |
govee_api/device_factory.py | filipealvesdef/govee_api | 15 | 12766041 | import govee_api.device as dev
import abc
class _AbstractGoveeDeviceFactory(abc.ABC):
""" Declare an interface for operations that create abstract Govee devices """
@abc.abstractmethod
def build(self, govee, identifier, topic, sku, name, connected):
""" Build Govee device """
pass
clas... | 3.046875 | 3 |
test/test_cli.py | pratyakshajha/pytest-check-links | 7 | 12766042 | import subprocess
import pytest
def test_cli_meta():
assert subprocess.call(["pytest-check-links", "--version"]) == 0
assert subprocess.call(["pytest-check-links", "--help"]) == 0
@pytest.mark.parametrize("example,rc,expected,unexpected", [
["httpbin.md", 0, [" 6 passed"], [" failed"]],
["rst.rst", ... | 2.21875 | 2 |
src/torforce/activations.py | leaprovenzano/torforce | 0 | 12766043 | <reponame>leaprovenzano/torforce
import torch
from torch import nn
class SoftPlusOne(nn.Softplus):
"""this is simply softplus(x) + 1
Example:
>>> import torch
>>> from torforce.activations import SoftPlusOne
>>>
>>> act = SoftPlusOne()
>>> act(torch.tensor(.5))
... | 2.703125 | 3 |
conf.py | DawudH/ImageColorizer | 0 | 12766044 | # -*- coding: utf-8 -*-
"""
authors: <NAME>, <NAME>, <NAME> and <NAME>
written for the NN course IN4015 of the TUDelft
"""
##### SETTINGS: #####
# Number of epochs to train the network over
n_epoch = 0
# Folder where the training superbatches are stored
training_folder= 'selection'
# Folder where the validation sup... | 1.953125 | 2 |
mixEM/examples/demo_multinormal.py | mjafin/LongQC | 61 | 12766045 | #!/usr/bin/env python
import numpy as np
import mixem
from mixem.distribution import MultivariateNormalDistribution
def generate_data():
dist_params = [
(np.array([4]), np.diag([1])),
(np.array([1]), np.diag([0.5]))
]
weights = [0.3, 0.7]
n_data = 5000
data = np.zeros((n_data, 1... | 2.46875 | 2 |
engineer/unittests/__init__.py | pridkett/engineer | 1 | 12766046 | <filename>engineer/unittests/__init__.py
# coding=utf-8
from tempfile import mkdtemp
from unittest.case import TestCase
from path import path
from engineer.log import bootstrap
__author__ = '<NAME> <<EMAIL>>'
class SettingsTestCase(TestCase):
settings_file = None
def __init__(self, *args, **kwargs... | 2.515625 | 3 |
app/models.py | agailloty/api | 0 | 12766047 | from sqlalchemy.sql.expression import null, text
from sqlalchemy.sql.sqltypes import TIMESTAMP
from .database import Base
from sqlalchemy import Column, Integer, String, Boolean
class Post(Base):
__tablename__ = "user_posts"
id = Column(Integer, primary_key=True, nullable=False)
title = Column(String, nul... | 2.703125 | 3 |
pymaginopolis/chunkyfile/common.py | benstone/pymaginopolis | 9 | 12766048 | import struct
from pymaginopolis.chunkyfile import model as model
from pymaginopolis.chunkyfile.model import Endianness, CharacterSet
GRPB_HEADER_SIZE = 20
CHARACTER_SETS = {
model.CharacterSet.ANSI: "latin1",
model.CharacterSet.UTF16LE: "utf-16le"
}
def get_string_size_format(characterset):
# FUTURE: ... | 2.84375 | 3 |
pyasn1_alt_modules/rfc6010.py | CBonnell/pyasn1-alt-modules | 2 | 12766049 | #
# This file is part of pyasn1-alt-modules software.
#
# Created by <NAME> with assistance from asn1ate v.0.6.0.
# Modified by <NAME> to add maps for use with opentypes.
# Modified by <NAME> to include the opentypemap manager.
#
# Copyright (c) 2019-2022, Vigil Security, LLC
# License: http://vigilsec.com/pyasn1-alt-m... | 1.828125 | 2 |
quasimodo/tests/test_gaussian_nb_with_missing_values.py | Aunsiels/CSK | 16 | 12766050 | import unittest
import numpy as np
from quasimodo.assertion_fusion.gaussian_nb_with_missing_values import GaussianNBWithMissingValues
class TestFilterObject(unittest.TestCase):
def test_gaussian2(self):
std = -0.1339048038303071
mean = -0.1339048038303071
x = 150.10086283379565
... | 2.53125 | 3 |