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 |
|---|---|---|---|---|---|---|
MultipleLinearRegression/untitled0.py | shubham-shinde/Machine-Learning | 0 | 12782251 | <gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#import the data
dataset = pd.read_csv('50_Startups.csv')
#index location = iloc
#dataset is a 2d matrix
#select all row in first column
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:,4].values
#data preprocessing
from sklearn.pre... | 3.640625 | 4 |
angalabiri/shop/models/cartmodels.py | dark-codr/ebiangala | 1 | 12782252 | <filename>angalabiri/shop/models/cartmodels.py<gh_stars>1-10
import random
import os
import math
import datetime
from decimal import Decimal
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from django.db import models
from category.models import Category, Tag
from ckeditor_uploa... | 1.953125 | 2 |
src/model/models.py | tsoibet/task-management-site-2 | 0 | 12782253 | <reponame>tsoibet/task-management-site-2
import enum
from datetime import datetime
from flask.json import dump
from database import db
from marshmallow import Schema, fields, post_load, validates_schema, ValidationError
from marshmallow.validate import Length, Range, OneOf
from flask_marshmallow import Marshmallow
fro... | 2.265625 | 2 |
inventarios/forms.py | angiealejo/CoreM | 1 | 12782254 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Django:
from django.forms import ModelForm
from django.forms import TextInput
from django.forms import Select
# from django.forms import SelectMultiple
from django.forms import ChoiceField
from django.forms import Textarea
from django.forms import CharField
from django.forms im... | 1.9375 | 2 |
test.py | Shito0907/cat_gen | 1 | 12782255 | import yaml
import argparse
from attrdict import AttrDict
from matplotlib import pyplot as plt
import torch
from torch.autograd import Variable
from models.generator import Generator
def test(params):
G = Generator(params.network.generator)
if params.restore.G:
G.load_state_dict(torch.load(params.... | 2.1875 | 2 |
scrapers/astro_assigner.py | nseifert/splatalogue | 0 | 12782256 | <reponame>nseifert/splatalogue<filename>scrapers/astro_assigner.py
# -*- coding: utf-8 -*-
import pandas as pd
import MySQLdb as mysqldb
from MySQLdb import cursors
import numpy as np
import re
import easygui as eg
from tqdm import tqdm, tqdm_pandas
def init_sql_db():
def rd_pass():
return open('pass.pass... | 2.328125 | 2 |
site_scons/upload_thirdparty.py | neam/TideSDK | 10 | 12782257 | <gh_stars>1-10
# This file has been modified from its orginal sources.
#
# Copyright (c) 2012 Software in the Public Interest Inc (SPI)
# Copyright (c) 2012 <NAME>
#
# 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 c... | 1.882813 | 2 |
tests/casefiles/toplevel_extracode.py | ardovm/wxGlade | 225 | 12782258 | <reponame>ardovm/wxGlade
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade
#
import wx
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# frame extra code
# dialog extra code
# end wxGlade
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxG... | 2.21875 | 2 |
src/final_exam/q_employee/hourly_employee.py | acc-cosc-1336/cosc-1336-spring-2018-MJBrady13 | 0 | 12782259 | from employee import Employee
class HourlyEmployee(Employee):
def __init__(self, hourly_rate, worked_hours, employee_id, name):
self.hourly_rate = hourly_rate
self.worked_hours = worked_hours
def calculate(hourly_rate, worked_hours):
return (hourly_rate * worked_hours)
| 3.46875 | 3 |
algoritmo_genetico.py | higorsantana-omega/Algoritmo-Genetico-Python | 0 | 12782260 | <gh_stars>0
from random import random
class Produto():
def __init__(self, nome, espaco, valor):
self.nome = nome
self.espaco = espaco
self.valor = valor
class Individuo():
def __init__(self, espacos, valores, limite_espacos, geracao=0):
self.espacos = espacos
self.valo... | 3.0625 | 3 |
atcoder/abc/abc169/b.py | zaurus-yusya/atcoder | 3 | 12782261 | <gh_stars>1-10
a = int(input())
i = list(map(int, input().split()))
ans = 1
flag = 0
if i.count(0) > 0:
print(0)
flag = 1
if flag == 0:
for x in range(len(i)):
ans = ans * i[x]
if ans > 1000000000000000000:
flag = 1
break
if flag == 1:
print(-1)
el... | 2.546875 | 3 |
src/atcoder/abc032/b/sol_0.py | kagemeka/competitive-programming | 1 | 12782262 | import typing
def main() -> typing.NoReturn:
s = input()
k = int(input())
print(len(set(s[i:i + k] for i in range(len(s)- k + 1))))
main() | 2.921875 | 3 |
world/gen/layer/DefaultLandMassLayer.py | uuk0/mcpython-4 | 2 | 12782263 | """mcpython - a minecraft clone written in python licenced under MIT-licence
authors: uuk, xkcdjerry
original game by forgleman licenced under MIT-licence
minecraft by Mojang
blocks based on 1.14.4.jar of minecraft, downloaded on 20th of July, 2019"""
from world.gen.layer.Layer import Layer, LayerConfig
import globa... | 2.625 | 3 |
arsenyinfo/src/fit.py | cortwave/camera-model-identification | 6 | 12782264 | from functools import partial
from keras.optimizers import SGD
from fire import Fire
from src.dataset import KaggleDataset, PseudoDataset, ExtraDataset, DataCollection
from src.model import get_model, get_callbacks
from src.aug import augment
from src.utils import logger
def fit_once(model, model_name, loss, train,... | 2.328125 | 2 |
Products/GSSearch/tests/test_searchmessage.py | groupserver/Products.GSSearch | 0 | 12782265 | ##############################################################################
#
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | 1.765625 | 2 |
tools/perf/metrics/timeline_interaction_record_unittest.py | anirudhSK/chromium | 0 | 12782266 | <filename>tools/perf/metrics/timeline_interaction_record_unittest.py
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from metrics import timeline_interaction_record
from telemetry.core.tim... | 2.375 | 2 |
TwoTimeScaleHybridLearning/src/common/utils.py | sidsrini12/FURL_Sim | 0 | 12782267 | <reponame>sidsrini12/FURL_Sim
import common.config as cfg
from math import factorial as f
from models.cnn import CNN
from models.fcn import FCN
from models.svm import SVM
import networkx as nx
import numpy as np
import os
import pickle as pkl
from random import random
import sys
import torch
from torch.utils.data impor... | 2.109375 | 2 |
QuantitativeEditing/parameter_screen.py | wjs018/QuantitativeEditing | 21 | 12782268 | <reponame>wjs018/QuantitativeEditing
import gc
import scenedetect as sd
from moviepy.editor import *
if __name__ == '__main__':
# Specify video location here
video_file = '/media/unraid/Datasets/QuantitativeEditing/To Analyze/Bad Lip Reading_2018_Sample of My Pasta.mkv'
outfile_dir = '/media/unraid/D... | 2.671875 | 3 |
pavement.py | acolinisi/h5py | 1 | 12782269 | from paver.easy import *
import os
DLLS = ['h5py_hdf5.dll', 'h5py_hdf5_hl.dll', 'szip.dll', 'zlib.dll']
@task
def release_unix():
sh('python setup.py clean')
sh('python setup.py configure --reset --hdf5-version=1.8.4')
sh('python setup.py build -f')
sh('python setup.py test')
sh('python setup.py s... | 2.03125 | 2 |
TE_model.py | AllenInstitute/coupledAE | 5 | 12782270 | <reponame>AllenInstitute/coupledAE
# -----------------------------------------------
# 5341 exclusive, 3585 matched, total 8926 in T
# -----------------------------------------------
# 0 exclusive, 3585 matched, total 3585 in E
import argparse
import os
import pdb
import re
import socket
import sys
import timeit
impo... | 1.820313 | 2 |
Programmers/src/12934/solution.py | lstar2397/algorithms | 0 | 12782271 | <reponame>lstar2397/algorithms
def solution(n):
x = n ** 0.5
if x == int(x):
return (x + 1) ** 2
else:
return -1 | 3.28125 | 3 |
utils/utils.py | luowensheng/MCN | 130 | 12782272 | """Miscellaneous utility functions."""
from functools import reduce
from PIL import Image
import numpy as np
from matplotlib.colors import rgb_to_hsv, hsv_to_rgb
import spacy
import re
import cv2
import time
from keras_bert.tokenizer import Tokenizer
from keras_bert.loader import load_trained_model_from_checkpoint, l... | 2.734375 | 3 |
plotting/players_by_server.py | thundersen/ohol-data | 0 | 12782273 | #!env/bin/python3
import datetime
import sched
import pandas as pd
import plotly.graph_objs as go
import plotly.plotly as py
import requests
CSV_FILE = 'OholPlayersByServer.csv'
def process_current_player_counts():
data = fetch()
write(data, CSV_FILE)
draw(CSV_FILE)
def fetch():
timestamp = datetim... | 3.015625 | 3 |
coders/curso_python/fundamentos_projeto/area_circulo_v2.py | flaviogf/Cursos | 2 | 12782274 | <filename>coders/curso_python/fundamentos_projeto/area_circulo_v2.py
#!/usr/local/bin/python3
from math import pi
raio = 15
area = pi * raio**2
print(f'Area {area}')
| 2.515625 | 3 |
config.py | dziaineka/insider_bot | 7 | 12782275 | from os import getenv
from os.path import join, dirname
from dotenv import load_dotenv
# Create .env file path.
dotenv_path = join(dirname(__file__), ".env")
# Load file from the path.
load_dotenv(dotenv_path)
BOT_TOKEN = getenv('BOT_TOKEN', "")
CHAT_NAME = getenv('CHAT_NAME', "")
INSIDE_CHANNEL = getenv('INSIDE_CHA... | 2.21875 | 2 |
scripts/print_cil_from_bytes.py | mandiant/dncil | 0 | 12782276 | <reponame>mandiant/dncil<gh_stars>0
# Copyright (C) 2022 Mandiant, 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: [package root]/LICENSE.txt
# Unless required by ap... | 2.359375 | 2 |
config.py | Theocrat/konfsave | 0 | 12782277 | <reponame>Theocrat/konfsave
import os
from pathlib import Path
if (_config_home := os.path.expandvars('$XDG_CONFIG_HOME')) != '$XDG_CONFIG_HOME':
CONFIG_HOME = Path(_config_home)
else:
CONFIG_HOME = Path.home() / '.config'
KONFSAVE_DATA_PATH = CONFIG_HOME / 'konfsave'
KONFSAVE_PROFILE_HOME = KONFSAVE_DATA_PATH / ... | 2.09375 | 2 |
day13/13.py | stefsmeets/advent_of_code | 0 | 12782278 | <gh_stars>0
import numpy as np
filename = 'data.txt'
with open(filename) as f:
lines = (line.strip() for line in f.readlines())
dots = []
folds = []
for line in lines:
if line.startswith('fold along'):
direction, line_no = line.split()[-1].split('=')
line_no = int(line_no)
folds.appe... | 2.59375 | 3 |
Daily Python/18_StockPredictionLR/18_StockPredictionLR.py | Harjiwan/Python | 17 | 12782279 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import mean_squared_error
import matplotlib.pyplot as plt
#Import the data
data = pd.read_csv("TSLA.csv")
print('Raw data from ... | 3.609375 | 4 |
cobra_utils/__init__.py | earmingol/cobra_utils | 1 | 12782280 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from cobra_utils import io
from cobra_utils import query
from cobra_utils import topology
__version__ = "0.3.1" | 1.015625 | 1 |
students/K33402/Velts Andrey/lab0304/backend/events/urls.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | 4 | 12782281 | <filename>students/K33402/Velts Andrey/lab0304/backend/events/urls.py
from rest_framework.routers import DefaultRouter
from .views import EventViewSet
router = DefaultRouter()
router.register(r"", EventViewSet, basename="events")
urlpatterns = router.urls
| 1.710938 | 2 |
iscan/scan.py | ZhengnanZhao/importscanner | 3 | 12782282 | """Utilities to scan all Python files in a directory and
aggregate the names of all the imported packages
"""
import argparse
import ast
import os
from collections import Counter
from typing import Dict, Iterable, List, Optional, Tuple
from iscan.std_lib import separate_third_party_from_std_lib
class ImportScanner(a... | 2.921875 | 3 |
tools/dev/iamdb.py | chris-angeli-rft/cloud-custodian | 8 | 12782283 | # Copyright 2020 Amazon.com, Inc. or its affiliates. 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... | 2.109375 | 2 |
utils/steal-puzzles.py | jpverkamp/takuzu | 1 | 12782284 | <filename>utils/steal-puzzles.py
import bs4
import os
import requests
import sys
for size in [6, 8, 10, 12, 14]:
for level in [1, 2, 3, 4]:
nr = 0
while True:
nr += 1
response = requests.get('http://www.binarypuzzle.com/puzzles.php', params = {
'level': level... | 2.671875 | 3 |
filter-hitl-language/docai_utils.py | galz10/document-ai-samples | 3 | 12782285 | <filename>filter-hitl-language/docai_utils.py<gh_stars>1-10
"""
Document AI Functions
"""
from collections import defaultdict
from typing import Any
from google.cloud import documentai_v1 as documentai
from gcs_utils import (
get_files_from_gcs,
get_all_buckets,
create_bucket,
move_file,
)
UNDEFINED_... | 2.671875 | 3 |
Dynamic-programming/minimum_string_edit.py | kimjiwook0129/Coding-Interivew-Cheatsheet | 3 | 12782286 | # Minimum operations needed to make A to B
# Insert, Remove, Replace Available
A, B = input(), input()
dp = [[0] * (len(B) + 1) for _ in range(len(A) + 1)]
for i in range(1, len(A) + 1):
dp[i][0] = i
for j in range(1, len(B) + 1):
dp[0][j] = j
for i in range(1, len(A) + 1):
for j in range(1, len(B) + 1)... | 3 | 3 |
pyrestorm/paginators.py | alanjds/py-rest-orm | 9 | 12782287 | class RestPaginator(object):
'''Base paginator class which provides method templates.
'''
def __init__(self, page_size=20, **kwargs):
# Maximum number of elements expected to be returned. If None, max will be intelligently determined
self.max = kwargs.get('max', None)
# Current locat... | 2.71875 | 3 |
utils/hashing.py | omgthatsjackie/keeper | 1 | 12782288 | from hashlib import pbkdf2_hmac
salt = b'<PASSWORD>'
def hash_password(password):
return pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000).hex()[0:50] | 2.75 | 3 |
code/gomap_setup.py | bioinformapping/GOMAP | 0 | 12782289 | #!/usr/bin/env python2
'''
This submodule lets the user download the data files necessary for running the GOMAP pipline from CyVerse
Currently the files are stored in Gokul's personal directory so the download has to be initiated by gokul's own CyVerse account with icommands
'''
import os, re, logging, json, sys, ar... | 2.625 | 3 |
bin/get_html.py | ickc/pocket-export | 1 | 12782290 | #!/usr/bin/env python
import argparse
from functools import partial
from pathlib import Path
from requests_futures.sessions import FuturesSession
import pandas as pd
import numpy as np
# see https://stackoverflow.com/a/50039149
import resource
resource.setrlimit(resource.RLIMIT_NOFILE, (110000, 110000))
__version__... | 2.65625 | 3 |
phyllo/extractors/asconiusDB.py | oudalab/phyllo | 0 | 12782291 | import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
from phyllo.phyllo_logger import logger
# Note: The original ordering of chapters and verses was extremely complex.
# As a result, chapters are the bold headers and subsections are each p tag.
# Case 1: Sec... | 3.171875 | 3 |
cctbx/examples/merging/__init__.py | hbrunie/cctbx_project | 2 | 12782292 | <gh_stars>1-10
from __future__ import absolute_import, division, print_function
from scitbx.examples import bevington # import dependency
import boost.python
ext = boost.python.import_ext("cctbx_large_scale_merging_ext")
from cctbx_large_scale_merging_ext import *
| 1.132813 | 1 |
main.py | SuperSystemStudio/Cleanning | 0 | 12782293 | import configparser
import os
import sys
config.read("path.ini")
config=configparser.ConfigParser()
config = open("./path.ini","r")
if config.read() == "":
config.add_section("path")
for root in os.walk("C:\Users\Lenovo\AppData\Local\kingsoft\WPS Cloud Files\userdata\qing\filecache"):
if root != ".3172735" or r... | 2.265625 | 2 |
kratos/lib.py | IanBoyanZhang/kratos | 39 | 12782294 | import _kratos
from .generator import Generator
class SinglePortSRAM(Generator):
def __init__(self, macro_name: str, data_width: int, addr_width: int,
partial_write: bool = False, is_clone=False, sram_def=None):
if sram_def is None:
self.sram = _kratos.lib.SinglePortSRAM(Gener... | 2.40625 | 2 |
src/input/telnet.py | fufuok/PyAgent | 2 | 12782295 | # -*- coding:utf-8 -*-
"""
telnet.py
~~~~~~~~
数据收集插件 - 端口检测
:author: Fufu, 2021/6/16
"""
from asyncio import ensure_future
from typing import Union
from . import InputPlugin
from ..libs.helper import get_dict_value
from ..libs.metric import Metric
from ..libs.net import chk_port
class Telnet(InputPl... | 2.203125 | 2 |
accounts/views.py | rafaellima47/to-do-list-django | 0 | 12782296 | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from django.contrib import auth
def login(request):
context = {}
if request.method == "POST":
user = auth.authenticate(username=request.POST["email"], password=request.POST["password"])
if user is not None:
auth.login(... | 2.53125 | 3 |
a12_freq.py | yqelcodes/FTD_work | 0 | 12782297 | import collections
import pandas as pd
big_list = [[{'автопродление': 1},
{'аккаунт': 1},
{'акция': 2},
{'безумный': 1},
{'бесплатно': 1},
{'бесплатнои': 1},
{'бесплатныи': 1},
{'бесплатный': 1},
{'бесценок': 1},
{'билет': 2},
{'бритва': 1},
{'бритвеныи': 1},
{'важный': 2},
{'вводить': 1},
{... | 2.140625 | 2 |
src/api/datamanage/pro/datamodel/views/dmm_model_views.py | Chromico/bk-base | 84 | 12782298 | <reponame>Chromico/bk-base<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
--... | 1.203125 | 1 |
schedule/transformData/transformContext.py | JaviMiot/employeeSchedule | 0 | 12782299 | <gh_stars>0
from .transformData import TransformData
class TransformContext:
def __init__(self, strategy: TransformData):
self._strategy = strategy
@property
def strategy(self) -> TransformData:
return self._strategy
@strategy.setter
def strategy(self, strategy: TransformData):
... | 2.4375 | 2 |
src/app/voltdb/voltdb_src/tests/scripts/Testvoltdbclient.py | OpenMPDK/SMDK | 44 | 12782300 | <gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: utf-8
# This file is part of VoltDB.
# Copyright (C) 2008-2021 VoltDB Inc.
#
# 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 res... | 1.820313 | 2 |
saleor/shipping/utils.py | fairhopeweb/saleor | 15,337 | 12782301 | <gh_stars>1000+
from typing import TYPE_CHECKING, Optional
from django_countries import countries
from .interface import ShippingMethodData
if TYPE_CHECKING:
from .models import ShippingMethod
def default_shipping_zone_exists(zone_pk=None):
from .models import ShippingZone
return ShippingZone.objects.... | 2.484375 | 2 |
src/vartools/dynamical_systems/__init__.py | hubernikus/various_tools | 0 | 12782302 | <reponame>hubernikus/various_tools
"""
The :mod:`DynamicalSystem` module implements mixture modeling algorithms.
"""
# Various Dynamical Systems
from ._base import allow_max_velocity, DynamicalSystem
from .linear import LinearSystem, ConstantValue
from .circle_stable import CircularStable
from .circular_and_linear impo... | 1.640625 | 2 |
NLP/roberta/tokenizer/Conversation.py | x54-729/models | 0 | 12782303 | import uuid
from typing import List, Optional
from .utils import logging
logger = logging.get_logger(__name__)
class Conversation:
"""
Utility class containing a conversation and its history. This class is meant to be used as an input to the
:class:`~transformers.ConversationalPipeline`. The conversatio... | 3.703125 | 4 |
query.py | scotte216/Data-Stream | 0 | 12782304 | import argparse
from datetime import datetime
from Common.functions import add_data, get_filtered_stb, get_data
parser = argparse.ArgumentParser(description='Data-stream import and searching. Expected input data-stream line\n' +
'of the form: STB|TITLE|PROVIDER|DATE|REVENUE|TIME\n')
pa... | 2.90625 | 3 |
demo_package/__init__.py | xiaocai2333/setuptools_demo | 0 | 12782305 |
def demo():
print("This is a test package demo!")
if __name__=='__main__':
demo() | 1.28125 | 1 |
Lib/site-packages/psycopg/pq/pq_ctypes.py | CirculusVCFB/example-fastapi | 0 | 12782306 | <filename>Lib/site-packages/psycopg/pq/pq_ctypes.py
"""
libpq Python wrapper using ctypes bindings.
Clients shouldn't use this module directly, unless for testing: they should use
the `pq` module instead, which is in charge of choosing the best
implementation.
"""
# Copyright (C) 2020 The Psycopg Team
import logging... | 1.710938 | 2 |
test/unit/test_first_conditional_stop.py | KTH/aspen | 0 | 12782307 | <filename>test/unit/test_first_conditional_stop.py
__author__ = '<EMAIL>'
import unittest
import mock
from test import mock_test_data # pylint: disable=C0411
from modules.steps.first_conditional_stop import FirstConditionalStop
from modules.util import data_defs, cache_defs
class TestFirstConditionalStop(unittest.Tes... | 2.09375 | 2 |
sppas/sppas/src/annotations/TextNorm/num2text/num_base.py | mirfan899/MTTS | 0 | 12782308 | <gh_stars>0
# -*- coding: UTF-8 -*-
"""
..
---------------------------------------------------------------------
___ __ __ __ ___
/ | \ | \ | \ / the automatic
\__ |__/ |__/ |___| \__ annotation and
\ | | | | ... | 1.523438 | 2 |
scripts/general_analysis/aom_response.py | charlesblakemore/opt_lev_analysis | 0 | 12782309 | import os, fnmatch, sys, time
import dill as pickle
import scipy.interpolate as interp
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import bead_util as bu
import calib_util as cu
import configuration as config
import time
dirname = '/data/old_trap/20201202/power/init'
files,... | 1.695313 | 2 |
pythoncev/exercicios/ex044.py | gustavobelloni/Python | 0 | 12782310 | preço = float(input('Preço das compras: R$'))
print('''FORMAS DE PAGAMENTO
[ 1 ] à vista em dinheiro/cheque
[ 2 ] à vista no cartão
[ 3 ] 2x no cartão
[ 4 ] 3x ou mais no cartão''')
opção = int(input('Qual é a opção? '))
if opção == 1:
desc10 = preço - (preço * 10 / 100)
print(f'A sua compra de R${preço:.2f}, c... | 3.828125 | 4 |
tests/test_requirements.py | kkoralsky/pex | 4 | 12782311 | <reponame>kkoralsky/pex
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from textwrap import dedent
import pytest
from pkg_resources import Requirement
from twitter.common.contextutil import temporary_dir
from pex.requiremen... | 2.140625 | 2 |
src/python/tools/tool1.py | tuh8888/hpl-util | 0 | 12782312 | <reponame>tuh8888/hpl-util
bool x(int a, int b)
{
}
bool y(int a, int b)
{
}
bool z(int c)
{
}
| 1.101563 | 1 |
codenames/models/yolov2/__init__.py | vladimir-tikhonov/codenames_ai | 0 | 12782313 | <filename>codenames/models/yolov2/__init__.py
from .yolov2 import YoloV2
__all__ = [
'YoloV2'
]
| 1.195313 | 1 |
Carletproject/Carletproject/urls.py | shahparkhan/CarLet | 0 | 12782314 | """Carletproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 2.375 | 2 |
p3.py | aleksanderhan/ProjectEuler | 0 | 12782315 | <filename>p3.py
from is_prime import is_prime
def largest_prime_factor(n):
i = 2
while i != n:
if is_prime(i) and n%i == 0:
n = int(n/i)
else:
i += 1
return(i)
print(largest_prime_factor(600851475143))
| 3.640625 | 4 |
Python/PythonIfElse.py | chicio/Hackerrank | 6 | 12782316 | <reponame>chicio/Hackerrank
#
# PythonIfElse.py
# HackerRank
#
# Created by <NAME> on 14/10/17.
#
# https://www.hackerrank.com/challenges/py-if-else
n = int(raw_input())
if n % 2 != 0:
print "Weird"
else:
if 2 <= n <= 5:
print "Not Weird"
if 6 <= n <= 20:
print "Weird"
if n > 20:
... | 3.3125 | 3 |
webapp/home/migrations/0008_alter_notice_enabled.py | usegalaxy-au/galaxy-media-site | 0 | 12782317 | # Generated by Django 3.2 on 2021-12-02 01:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0007_alter_user_email'),
]
operations = [
migrations.AlterField(
model_name='notice',
name='enabled',
... | 1.5625 | 2 |
auto_typing_game.py | Plummy-Panda/python-magictype | 0 | 12782318 | import socket
import re
import config
def get_word(data):
word = None
word_regexp = re.compile(r'[^Score:\s\d{1,}]([a-zA-Z0-9]+)')
found = word_regexp.search(data)
if found:
word = found.group(1)
else:
pass
return word
def get_score(data):
score = None
score_regexp = ... | 3.25 | 3 |
partname_resolver/components/part.py | sakoPO/partname-resolver | 0 | 12782319 | from enum import Enum
class Type(Enum):
MLCC = "Multi layer ceramic capacitor"
ElectrolyticAluminium = "Aluminium Electrolytic Capacitor"
ThinFilmResistor = "Thin Film Resistor"
ThickFilmResistor = "Thick Film Resistor"
ThinFilmResistorArray = "Thin Film Resistor Array"
ThickFilmResistorArray ... | 2.515625 | 3 |
gps_nav/shortest_path_visualizer.py | heng2j/delamain | 2 | 12782320 | <reponame>heng2j/delamain
"""
SHORTEST PATH VISUALIZER
......
Created by DevGlitch
"""
import glob
import os
import sys
try:
sys.path.append(
glob.glob(
"../carla/dist/carla-*%d.%d-%s.egg"
% (
sys.version_info.major,
sys.version_info.minor,
... | 2.78125 | 3 |
salt/modules/mod_random.py | tomdoherty/salt | 9,425 | 12782321 | <filename>salt/modules/mod_random.py
"""
Provides access to randomness generators.
=========================================
.. versionadded:: 2014.7.0
"""
import base64
import hashlib
import random
import salt.utils.pycrypto
from salt.exceptions import SaltInvocationError
ALGORITHMS_ATTR_NAME = "algorithms_guaran... | 3.25 | 3 |
run.py | ServiceInnovationLab/strawberry | 0 | 12782322 | #!/usr/bin/env python
# Read secrets from .env file
import requests
import csv
import json
import os
from dotenv import load_dotenv
load_dotenv()
BOARD_ID = os.getenv("TRELLO_BOARD_ID")
TRELLO_API_KEY = os.getenv('TRELLO_API_KEY')
TRELLO_TOKEN = os.getenv('TRELLO_TOKEN')
output_filename = f'output-{BOARD_ID}.csv'
k... | 2.703125 | 3 |
estudo/processamento_de_videos.py | PedroMoreira87/machine-learning | 0 | 12782323 | <reponame>PedroMoreira87/machine-learning
# TAREFA EXTRA
# 1. Pegar o vídeo "Odalisca E45.mpg" e transformar em uma sequência de imagens
# ORIENTAÇÕES ADICIONAIS:
# 1. Podem trabalhar com as imagens que forem obtidas do vídeo ou com as 4 imagens que estão contidas na pasta.
# Adicionalmente, podem fazer os mesmos exper... | 3.328125 | 3 |
torchx/cli/cmd_run.py | grievejia/torchx | 0 | 12782324 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import logging
import os
import sys
import threading
from dataclasses import asdict
from pprint i... | 1.882813 | 2 |
funds_brazil.py | brunoalvoliv/curva-de-juros | 0 | 12782325 | #Bibliotecas
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import investpy as py
plt.style.use('fivethirtyeight')
#Buscando dados
bonds = py.get_bonds_overview(country='brazil')
#print(bonds)
print('')
#Filtrando por nome e preço de fechamento
bonds2 = py.get_bonds_overview(country='braz... | 2.921875 | 3 |
grades/migrations/0018_remove_max_validation_final_grade.py | Wassaf-Shahzad/micromasters | 32 | 12782326 | <reponame>Wassaf-Shahzad/micromasters
# Generated by Django 2.1.5 on 2019-03-07 06:35
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grades', '0017_micromastersprogramcommendation'),
]
operations = [
migra... | 1.703125 | 2 |
SimpleCV/MachineLearning/TestTemporalColorTracker.py | tpltnt/SimpleCV | 8 | 12782327 | <reponame>tpltnt/SimpleCV
from SimpleCV import Camera, Image, Color, TemporalColorTracker, ROI, Display
import matplotlib.pyplot as plt
cam = Camera(1)
tct = TemporalColorTracker()
img = cam.getImage()
roi = ROI(img.width*0.45,img.height*0.45,img.width*0.1,img.height*0.1,img)
tct.train(cam,roi=roi,maxFrames=250,pkWndw... | 2.484375 | 2 |
server/TimeSeriesJoiner/stream_join_engine.py | iot-salzburg/panta-rhei | 6 | 12782328 | #!/usr/bin/env python3
"""This engine enables to customize the stream joining very flexible by importing only few lines of code that
define customized functionality. This framework ensures exactly-once time-series processing that are based on joins
using the local stream buffering algorithm with Apache Kafka.
Impo... | 2.390625 | 2 |
lib/whoosh/filedb/multiproc.py | ckolumbus/WikidPad.svn | 2 | 12782329 | #===============================================================================
# Copyright 2010 <NAME>
#
# 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/... | 2.28125 | 2 |
aerie/utils.py | alex-oleshkevich/aerie | 6 | 12782330 | <filename>aerie/utils.py<gh_stars>1-10
import typing as t
from contextlib import contextmanager
from sqlalchemy.exc import MultipleResultsFound, NoResultFound
from aerie.exceptions import NoResultsError, TooManyResultsError
@contextmanager
def convert_exceptions() -> t.Generator[None, None, None]:
try:
y... | 2.3125 | 2 |
setup.py | AstroMatt/book-apollo-moon-experiments-alsep | 0 | 12782331 | <filename>setup.py
#!/usr/bin/env python3
from datetime import datetime, timezone
from os import makedirs
from os.path import dirname, abspath, join, basename
from shlex import split
from shutil import rmtree
from subprocess import run
FORMAT = 'singlehtml'
SECOND = 1
MINUTE = 60 * SECOND
START_TIME = datetime.now... | 2.34375 | 2 |
web/djangoappengine/db/utils.py | bdelliott/wordgame | 2 | 12782332 | <filename>web/djangoappengine/db/utils.py<gh_stars>1-10
from google.appengine.datastore.datastore_query import Cursor
class CursorQueryMixin(object):
def clone(self, *args, **kwargs):
kwargs['_gae_cursor'] = getattr(self, '_gae_cursor', None)
kwargs['_gae_start_cursor'] = getattr(self, '_gae_start_... | 2.15625 | 2 |
brainrender/Utils/paths_manager.py | FedeClaudi/brainrender | 0 | 12782333 | <filename>brainrender/Utils/paths_manager.py<gh_stars>0
import sys
import os
from brainrender.Utils.data_io import save_json
"""
Class to create and store paths to a number of folders uesed to save/load data
"""
# Default paths for Data Folders (store stuff like object meshes, neurons morphology data etc)
defau... | 2.625 | 3 |
timetracker/sheets/tasks.py | tm-kn/CHT2520-assignment2 | 0 | 12782334 | <reponame>tm-kn/CHT2520-assignment2
from timetracker.celery import app
from timetracker.sheets.models import TimeSheet
@app.task
def generate_csv_file_for_timesheet(sheet_id, end_datetime):
sheet = TimeSheet.objects.get(pk=sheet_id)
sheet.generate_csv_file()
| 2.234375 | 2 |
ml4vision/ml/__init__.py | ml4vision/ml4vision-py | 0 | 12782335 | try:
import torch
except ImportError:
raise ImportError(
"ml4vision.ml requires the pytorch library. Please run: pip install ml4vision-py[ml]"
) from None
| 1.617188 | 2 |
ConvLSTMCEll.py | Mo0nl19ht/convlstm-seq2seq-attention | 1 | 12782336 | <gh_stars>1-10
import tensorflow as tf
from tensorflow import keras
import tensorflow_addons as tfa
from Self_Attention_Memory_Module import Self_Attention_Memory_Module
class ConvLSTMCell(tf.keras.Model):
def __init__(self, hidden_dim,att_hidden_dim, kernel_size, bias):
super(ConvLSTMCell, self).__init__... | 2.515625 | 3 |
lib/binlog_stream_reader_wrapper.py | jschell12/mysql_binlog_kinesis_producer | 0 | 12782337 | import datetime
from enum import Enum
from pymysqlreplication import BinLogStreamReader
from pymysqlreplication.row_event import (
DeleteRowsEvent,
UpdateRowsEvent,
WriteRowsEvent,
TableMapEvent
)
from pymysqlreplication.event import (
BeginLoadQueryEvent,
ExecuteLoadQueryEvent,
QueryEvent,
... | 2.203125 | 2 |
medium/148. Sort List.py | junyinglucn/leetcode | 0 | 12782338 | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def sortList(self, head: ListNode) -> ListNode:
if not head or not head.next:
return head
curr, length = head, 0
... | 3.921875 | 4 |
sangwoo_example.py | loganlebanoff/correct_summarization | 2 | 12782339 | <gh_stars>1-10
from tqdm import tqdm
import glob
from data import example_generator # The module "data" is from Abigail See's code
import json
dataset_split = 'test'
source_dir = os.path.expanduser('~') + '/data/tf_data/with_coref_and_ssi/cnn_dm'
names_to_types = [('raw_article_sents', 'string_list'), ... | 2.453125 | 2 |
tests/test_http.py | sylwekb/apistar | 0 | 12782340 | <filename>tests/test_http.py
from apistar import App, Route, http
from apistar.test import TestClient
def get_method(method: http.Method) -> http.Response:
return http.Response({'method': method})
def get_scheme(scheme: http.Scheme) -> http.Response:
return http.Response({'scheme': scheme})
def get_host(h... | 2.609375 | 3 |
Node.py | KubaWernerowski/Crimetrax | 1 | 12782341 | <reponame>KubaWernerowski/Crimetrax<filename>Node.py
class Node:
def __init__(self, x, y):
self.long = x
self.lat = y
self.neighbors = 0
def __str__(self):
return str(self.long) + "," + str(self.lat) + "," + str(self.neighbors) | 2.9375 | 3 |
walden/main.py | aravindkoneru/Walden | 1 | 12782342 | import argparse
import os
import sys
from collections import namedtuple
from pathlib import Path
import toml
from ._build import build_journal
from ._create import create_journal
from ._data_classes import JournalConfiguration, WaldenConfiguration
from ._delete import delete_journal
from ._edit import edit_journal
fr... | 2.546875 | 3 |
auditor/auditor/config.py | ravirahman/sancus | 2 | 12782343 | from dataclasses import dataclass
from decimal import Decimal
from common.config import (
BTCProxyConfig,
GRPCServerConfig,
IPFSConfig,
SQLAlchemyConfig,
W3Config,
)
@dataclass(frozen=True)
class WebauthnConfig:
rp_name: str
rp_id: str
origin: str
@dataclass(frozen=True)
class Audit... | 2.09375 | 2 |
behind/chats/routing.py | teamsalad/behind-api | 0 | 12782344 | from django.urls import path
from chats import consumers
websocket_urlpatterns = [
path('ws/v1/chat_rooms/<int:id>/', consumers.ChatConsumer),
] | 1.515625 | 2 |
pymanopt/manifolds/stiefel.py | paulroujansky/pymanopt | 0 | 12782345 | import numpy as np
from scipy.linalg import expm
from pymanopt.manifolds.manifold import EuclideanEmbeddedSubmanifold
from pymanopt.tools.multi import multiprod, multisym, multitransp
class Stiefel(EuclideanEmbeddedSubmanifold):
"""
Factory class for the Stiefel manifold. Instantiation requires the
dimen... | 2.828125 | 3 |
autograd_forward/convenience_wrappers.py | BB-UCL/autograd-forward | 30 | 12782346 | <reponame>BB-UCL/autograd-forward<filename>autograd_forward/convenience_wrappers.py
from __future__ import absolute_import
from autograd.convenience_wrappers import (attach_name_and_doc, safe_type,
cast_to_same_dtype, grad)
from autograd.convenience_wrappers import hessian_ve... | 2.53125 | 3 |
tests/cerami/datatype/translator/base_datatype_translator_test.py | gummybuns/dorm | 0 | 12782347 | from mock import patch, Mock
from tests.helpers.testbase import TestBase
from cerami.datatype import String
from cerami.datatype.translator import BaseDatatypeTranslator
class TestBaseDatatypeTranslator(TestBase):
def setUp(self):
self.dt = String()
self.translator = BaseDatatypeTranslator(self.dt)... | 2.5625 | 3 |
irun/preprocessor.py | reizio/irun | 0 | 12782348 | <gh_stars>0
import io
import re
import token
import tokenize
from argparse import ArgumentParser, FileType
from dataclasses import dataclass
from irun.base import IRunException, Matchers
@dataclass
class PreprocessError(IRunException):
message: str
lineno: int
col_offset: int
end_lineno: int
end_... | 2.46875 | 2 |
application.py | gk2533/Python_Purple_Parrots | 0 | 12782349 | <reponame>gk2533/Python_Purple_Parrots
import uuid
from flask import Flask, request, jsonify
from flask_restplus import Resource, Api
from flask_restplus import fields
from flask_sqlalchemy import SQLAlchemy
import nltk.corpus
import nltk.tag
import nltk
import re
import ssl
try:
_create_unverified_https_context =... | 2.390625 | 2 |
py/g1/asyncs/kernels/g1/asyncs/kernels/pollers.py | clchiou/garage | 3 | 12782350 | <reponame>clchiou/garage
__all__ = [
'Poller',
'Polls',
# Poller implementations.
#
# TODO: Only epoll is supported as cross-platform is not priority.
'Epoll',
]
import enum
import errno
import math
import select
import threading
from typing import Sequence, Tuple, Union
from g1.bases.assertio... | 2.421875 | 2 |