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/pretix/plugins/badges/__init__.py | snadal/pretix | 0 | 12786051 | from django.apps import AppConfig
from django.utils.translation import ugettext, ugettext_lazy as _
from pretix import __version__ as version
class BadgesApp(AppConfig):
name = 'pretix.plugins.badges'
verbose_name = _("Badges")
class PretixPluginMeta:
name = _("Badges")
author = _("the p... | 1.929688 | 2 |
SPICE/__init__.py | nfahlgren/SPICE_py | 6 | 12786052 | <filename>SPICE/__init__.py
from SPICE.SPICE import *
from SPICE.QPP import *
from SPICE import util
| 1.101563 | 1 |
benchmarks/pydy_pendulum.py | Midnighter/symengine.py | 133 | 12786053 | <gh_stars>100-1000
import os
import time
import sys
sys.path = ["../sympy", "../pydy", "../symengine.py"] + sys.path
import sympy
import symengine
import pydy
from sympy.physics.mechanics.models import n_link_pendulum_on_cart
print(sympy.__file__)
print(symengine.__file__)
print(pydy.__file__)
if (len(sys.argv) > 1)... | 2.109375 | 2 |
shutterstock_api/models/license_request_metadata.py | Lumen5/shutterstock-api | 1 | 12786054 | # coding: utf-8
"""
Shutterstock API Reference
The Shutterstock API provides access to Shutterstock's library of media, as well as information about customers' accounts and the contributors that provide the media. # noqa: E501
OpenAPI spec version: 1.0.11
Generated by: https://github.com/swagge... | 2.125 | 2 |
anonympy/pandas/core_pandas.py | ArtLabss/open-data-anonimizer | 29 | 12786055 | import pandas as pd
import numpy as np
from texttable import Texttable
from cape_privacy.pandas import dtypes
from cape_privacy.pandas.transformations import NumericPerturbation
from cape_privacy.pandas.transformations import DatePerturbation
from cape_privacy.pandas.transformations import NumericRounding
from cape_p... | 2.765625 | 3 |
Containers/Kubernetes-examples/GCP/greetings/application.py | danavaziri/Cloud | 0 | 12786056 | <reponame>danavaziri/Cloud<filename>Containers/Kubernetes-examples/GCP/greetings/application.py
import os
import time
from flask import request
from flask import Flask, render_template
import mysql.connector
from mysql.connector import errorcode
import json
application = Flask(__name__)
app = application
def get_d... | 2.921875 | 3 |
soundsig/spikes.py | theunissenlab/sounsig | 22 | 12786057 | <gh_stars>10-100
from __future__ import division, print_function
import operator
import numpy as np
from scipy.stats import gamma
from scipy.ndimage import convolve1d
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from matplotlib.patches import Rectangle
def compute_joint_isi(spike_tr... | 2.40625 | 2 |
study/pytorch_study/02.py | strawsyz/straw | 2 | 12786058 | import matplotlib.pyplot as plt
import torch
# 回归类型的例子
data_shape = torch.ones(400, 2)
x0 = torch.normal(2 * data_shape, 1)
y0 = torch.zeros(data_shape.size()[0])
x1 = torch.normal(-2 * data_shape, 1)
y1 = torch.ones(data_shape.size()[0])
x = torch.cat((x0, x1), 0).type(torch.FloatTensor)
y = torch.cat((y0, y1)).type... | 3.609375 | 4 |
backup.d/backup.py | davidhi7/backup | 0 | 12786059 | <filename>backup.d/backup.py<gh_stars>0
import sys
import os
import shutil
import subprocess
import datetime
import configparser
from pathlib import Path
def load_config(filepath: Path):
config = configparser.ConfigParser()
# stop converting key names to lower case, see https://stackoverflow.com/questions/1935... | 3.015625 | 3 |
2015/05/main.py | juanrgon/advent-of-code | 3 | 12786060 | <reponame>juanrgon/advent-of-code
TEST = [
(
"""
ugknbfddgicrmopn
aaa
jchzalrnumimnmhp
haegwjzuvuyypxyu
dvszwmarrgswjxmb
""",
1 + 1,
),
]
TEST2 = [
(
"""
qjhvhtzxzqqjkmpb
xxyxx
uurcxstgmygtbstg
ieodomkazucvgmuy
""",
1 + 1,
),
]
import aoc
from collections import Counte... | 3.140625 | 3 |
autoscalingsim/scaling/policiesbuilder/adjustmentplacement/desired_adjustment_calculator/scoring/score/score_impl/__init__.py | Remit/autoscaling-simulator | 6 | 12786061 | from .price_score import PriceScore
| 0.984375 | 1 |
utils.py | learningequality/sushi-chef-readwritethink | 0 | 12786062 | <reponame>learningequality/sushi-chef-readwritethink
import json
import os
from pathlib import Path
import ntpath
from ricecooker.utils import downloader
import requests
from ricecooker.utils.caching import CacheForeverHeuristic, FileCache, CacheControlAdapter
#from le_utils.constants import licenses, content_kinds, fi... | 2.421875 | 2 |
fssim_rqt_plugins/rqt_fssim_track_editor/src/rqt_fssim_track_editor/cone_editor.py | AhmedOsamaAgha/fssim | 200 | 12786063 | # AMZ-Driverless
# Copyright (c) 2018 Authors:
# - <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, ... | 1.625 | 2 |
tests/test_base.py | youngsoul/PyBlynkRestApi | 0 | 12786064 | import unittest
from pyblynkrestapi.PyBlynkRestApi import PyBlynkRestApi
class TestBase(unittest.TestCase):
def __init__(self,*args, **kwargs):
super(TestBase, self).__init__(*args, **kwargs)
self.auth_token = ''
self.blynk = PyBlynkRestApi(auth_token=self.auth_token)
| 2.3125 | 2 |
Count.py | avishek19/allneo | 0 | 12786065 | import DbConnect
from DbConnect import Connection
import pandas as pd
class NodeCount:
def __init__(self,uri,uname,pwd):
self.self = self
self.uri = uri
self.uname = uname
self.pwd = <PASSWORD>
# print('NodeCount:',uri,' ',uname,' ',pwd)
self.conn = Connect... | 3.046875 | 3 |
core/co_struct_to_xml.py | ykiveish/mks_dashnoard | 0 | 12786066 | <filename>core/co_struct_to_xml.py
import os
import struct
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import tostring
class StructParser:
def __init__(self, schema):
self.Schema = schema
def ConvertListToInteger(self, buffer):
buffer_size = len(buffer)
if buffer_size > 4:
return 0
... | 2.953125 | 3 |
python/merge_sort.py | v0rs4/algorithms | 0 | 12786067 | <gh_stars>0
from random import shuffle
def mergeSort(arr):
if len(arr) == 1:
return
m = len(arr) // 2
left = arr[:m]
right = arr[m:]
mergeSort(left)
mergeSort(right)
i = j = k = 0
while i < len(left) and j < len(right):
if left[i] < right[j]:
arr... | 3.96875 | 4 |
setup.py | samn33/qlazy | 15 | 12786068 | # -*- coding: utf-8 -*-
import os
import pathlib
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext as build_ext_orig
_VERSION = '0.2.2'
class CMakeExtension(Extension):
def __init__(self, name):
super().__init__(name, sources=[])
class build_ext(bu... | 1.929688 | 2 |
djaimes/flask/FLASK_REST/app.py | gthompsonku/predicting_covid_with_bloodtest | 1 | 12786069 | from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
import os
# Init app
app = Flask(__name__)
basedir = os.path.abspath(os.path.dirname(__file__))
# Database
app.config['SQLALCHEMY_DATABASE_URI'] = ('sqlite:///' +
os.path.join(basedir, 'db.s... | 2.6875 | 3 |
concepts/numberRangeDouble.py | sixtysecondrevit/dynamoPython | 114 | 12786070 | <gh_stars>100-1000
"""
PYTHON RANGE: DOUBLE APPROACH
"""
__author__ = '<NAME> - <EMAIL>'
__twitter__ = '@solamour'
__version__ = '1.0.0'
# DEFINITION:
# Custom definition to build a function similar to our DesignScript
# float range
def floatRange( start, end, step ):
for number in xrange( end ):
yield... | 3.234375 | 3 |
5_Functions/F_return.py | Oscar-Oliveira/Python3 | 0 | 12786071 | <filename>5_Functions/F_return.py
"""
return
"""
def my_max(*numbers):
max = None
for value in numbers:
if max is None or max < value:
max = value
return max
def is_greater_v1(value1, value2):
if value1 > value2:
return True
else:
return False
... | 3.984375 | 4 |
sphenecoll/sphene/sphsearchboard/models.py | pigletto/sct-communitytools | 0 | 12786072 | <gh_stars>0
import logging
import os
from django.conf import settings
from sphene.community import sphsettings
from sphene.community.middleware import get_current_group, get_current_user
from sphene.sphboard.models import Post, get_all_viewable_categories
logger = logging.getLogger('sphene.sphsearchboard.models')... | 1.96875 | 2 |
Python/Metodo Anova.py | filipeaguiarrod/Formacao-Cientista-de-Dados-com-Python-e-R | 0 | 12786073 | <reponame>filipeaguiarrod/Formacao-Cientista-de-Dados-com-Python-e-R<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 15 14:17:40 2020
@author: rodri
"""
import pandas as pd
from scipy import stats
import statsmodels.api as sm
from statsmodels.formula.api import ols
import matplotlib.pyplot as plt # gerar os... | 2.8125 | 3 |
Example_Cases/FDS_Mass_Loss_Rate/Scripts/models.py | koverholt/bayes-fire | 6 | 12786074 | #!/usr/bin/env python
"""Module for setting up statistical models"""
from __future__ import division
from math import pi
import numpy as np
import pymc as mc
import graphics
import data_fds
import external_fds
def fds_mlr():
"""PyMC configuration with FDS as the model."""
# Priors
# FDS inputs: abs_coe... | 2.59375 | 3 |
Python3/test.py | 610yilingliu/leetcode | 0 | 12786075 | import collections
class Solution:
def knightProbability(self, N: int, K: int, r: int, c: int) -> float:
def valid(curr, curc):
if curr < 0 or curr > N - 1 or curc < 0 or curc > N - 1:
return False
return True
if valid(r, c) == False:
... | 2.90625 | 3 |
tracetools_read/tracetools_read/trace.py | paulbovbel/ros2_tracing | 4 | 12786076 | # Copyright 2019 <NAME> GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 1.960938 | 2 |
modules/devenvironments-21/python/Sobres/Sobrial.py | pomaretta/PROG2021 | 0 | 12786077 | <filename>modules/devenvironments-21/python/Sobres/Sobrial.py
"""
Crea un sobre que contingui 5 cartes creades.
El programa ha de poder llistar les cartes contingudes
dins el sobre mitjannat un mètode anomenat
VeureCartesSobre() (per exemple veure el nom de la carta,
el tipus i la raresa).
"""
# AUTHOR <NAME>
# htt... | 3.140625 | 3 |
hasspad/main.py | kvchen/hasspad | 2 | 12786078 | #!/usr/bin/env python3
import asyncio
import logging
from typing import TextIO
import click
import yaml
from rich.logging import RichHandler
from hasspad.config import HasspadConfig
from hasspad.hasspad import Hasspad
logging.basicConfig(
level="INFO",
format="%(message)s",
datefmt="[%X]",
handlers=... | 2.109375 | 2 |
adaptivefiltering/asprs.py | zaw-shinoto/adaptivefiltering | 0 | 12786079 | from adaptivefiltering.utils import AdaptiveFilteringError, is_iterable
# Mapping from human-readable name to class codes
_name_to_class = {
"unclassified": (0, 1),
"ground": (2,),
"low_vegetation": (3,),
"medium_vegetation": (4,),
"high_vegetation": (5,),
"building": (6,),
"low_point": (7... | 3.359375 | 3 |
problems/p009/solution.py | alar0330/ProjectEuler | 0 | 12786080 | """
Project Euler: Problem #009
"""
def solve(s):
"""After a short analytic transformation, the
algorithm searches for an integer value that solves the
derived equation by iterating through all possibilities.
:param s: Constraint on sum, i.e. s = a + b + c
:returns: Returns the product a*b*c... | 3.828125 | 4 |
quantumdl/__init__.py | dexterai-lab/quantumdl | 0 | 12786081 | from quantumdl.models.quantummodel import *
from quantumdl.core.engine import * | 1.0625 | 1 |
hatch_vcs/build_hook.py | ofek/hatch-vcs | 0 | 12786082 | # SPDX-FileCopyrightText: 2022-present <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
class VCSBuildHook(BuildHookInterface):
PLUGIN_NAME = 'vcs'
def __init__(self, *args, **kwargs):
super(VCSBuildHook, self).__init__(*args, ... | 2.078125 | 2 |
speid/processors.py | OsvaldoRino/speid | 22 | 12786083 | <reponame>OsvaldoRino/speid
import os
from stpmex import Client
STP_PRIVATE_LOCATION = os.environ['STP_PRIVATE_LOCATION']
STP_EMPRESA = os.environ['STP_EMPRESA']
STP_KEY_PASSPHRASE = os.environ['STP_KEY_PASSPHRASE']
STP_BASE_URL = os.getenv('STP_BASE_URL', None)
SPEID_ENV = os.getenv('SPEID_ENV', '')
# Configura el... | 2 | 2 |
mplStyle/test/test_MplTickStyle.py | khanfarhan10/mplStyle | 39 | 12786084 | <gh_stars>10-100
#===========================================================================
#
# Copyright (c) 2014, California Institute of Technology.
# U.S. Government Sponsorship under NASA Contract NAS7-03001 is
# acknowledged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or ... | 1.164063 | 1 |
todolist/dashboard/models.py | Joneyviana/todolist-django-angular | 0 | 12786085 | <gh_stars>0
from django.db import models
from ..users.models import User
# Create your models here.
class Plan(models.Model):
name = models.CharField(max_length=50)
user = models.ForeignKey(User, related_name='plans')
class Task(models.Model):
name = models.CharField(max_length=50)
description = models.TextField... | 2.28125 | 2 |
College/HVCC/Python Programming/Ch 4/encrypt_and_decrypt.py | lwoluke/Projects | 0 | 12786086 | <reponame>lwoluke/Projects
"""
File: encrypt_and_decrypt.py
Encypts an input string of lowercase letters and prints
the result. The other input is the distance value.
Next, the output of the encrpyted string is decrypted
back to lowercase letters and the result is printed.
The other input is the distance value.
"""
... | 4.15625 | 4 |
src/pygaps/parsing/mic_excel.py | pauliacomi/adsutils | 0 | 12786087 | <gh_stars>0
"""Parse micromeritics xls output files.
@author <NAME>
@modified <NAME>
"""
import re
from itertools import product
import dateutil.parser
import xlrd
from pygaps import logger
from pygaps.utilities.exceptions import ParsingError
_NUMBER_REGEX = re.compile(r"^(-)?\d+(.|,)?\d+")
_BRACKET_REGEX = re.com... | 2.65625 | 3 |
tools/anki.py | vitkyrka/nordict | 1 | 12786088 | <reponame>vitkyrka/nordict<filename>tools/anki.py
#!/usr/bin/env python3
import argparse
import sys
import os
import re
import hashlib
import pprint
import json
import itertools
import genanki
import attr
class MinimalPairNote(genanki.Note):
@property
def guid(self):
return genanki.guid_for(self.fi... | 2.578125 | 3 |
core/serializers/fields/__init__.py | xuhang57/atmosphere | 0 | 12786089 | from .base import ModelRelatedField
| 1.054688 | 1 |
yat-master/pymodule/yat/shell/ssh.py | opengauss-mirror/Yat | 0 | 12786090 | #!/usr/bin/env python
# encoding=utf-8
"""
Copyright (c) 2021 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFT... | 2.078125 | 2 |
offer/53_03_IntegerIdenticalToIndex.py | DevRoss/python-offer-code | 1 | 12786091 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Created by Ross on 19-1-24
def solve(array: list):
if not array:
return None
start = 0
end = len(array) - 1
while start <= end:
mid = (start + end) >> 1
if array[mid] == mid:
return mid
elif array[mid] < mid:
... | 3.734375 | 4 |
friteup/models/Post/PostUpdates.py | zero-shubham/friteup-graphql-api- | 14 | 12786092 | from pydantic import BaseModel
from bson import ObjectId
from typing import Any, List
from models.comment import CommentBase
from db.mongodb import get_database
class PostUpdates(BaseModel):
id: str
text: str
title: str
user_id: str
published: bool
up_vote: List[str]
down_vote: List[str]
... | 2.5625 | 3 |
data_loader.py | PAI-SmallIsAllYourNeed/Mixup-AMP | 5 | 12786093 | import csv
import random
import re
import sys
import tqdm
import numpy as np
import torch
from torch.utils.data import TensorDataset
from transformers.tokenization_bert import BertTokenizer
def load_glove_txt(file_path="glove.840B.300d.txt"):
results = {}
num_file = sum([1 for i in open(file_path, "r", encodi... | 2.625 | 3 |
deep_thought/repl_cli.py | centralityai/repl-demo | 4 | 12786094 | <filename>deep_thought/repl_cli.py
import click
class DeepThought:
def __init__(self, host):
super().__init__()
self.host = host
@property
def answer(self):
print(f"Connecting to {self.host}...")
return 42
@click.command()
@click.option("--host", default="localhost", hel... | 2.40625 | 2 |
isitup/util/__init__.py | Twi1ightSparkle/matrix | 2 | 12786095 | from . import content
from . import http
from . import matrix
from . import sql
| 1.054688 | 1 |
azurectl/instance/virtual_machine.py | SUSE/azurectl | 9 | 12786096 | # Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 1.890625 | 2 |
tests/test_updater.py | upciti/debops | 0 | 12786097 | from typing import List, Optional
import pytest
from httpx import AsyncClient
from starlette.applications import Starlette
from starlette.requests import Request
from starlette.responses import JSONResponse, Response
from ops2deb.exceptions import Ops2debUpdaterError
from ops2deb.logger import enable_debug
from ops2d... | 2.15625 | 2 |
fluent_python/function/shallow_copy_test.py | helloTC/LearnPython | 0 | 12786098 | <gh_stars>0
#!/usr/bin/env python
# coding=utf-8
l1 = [3, [24,55,33], (15,14,17)]
l2 = list(l1)
l1.append(100)
l1[1].remove(55)
print('l1:',l1)
print('l2:',l2)
l2[1] += [33,22]
l2[2] += (10,11)
print('l1:',l1)
print('l2:',l2)
| 3.203125 | 3 |
jenkins_perf_visualizer/fetch.py | Khan/jenkins-perf-visualizer | 0 | 12786099 | <filename>jenkins_perf_visualizer/fetch.py
"""Routines to fetch data from Jenkins and save it to a data file.
The output data file has all the information needed to make a
visualization graph, and can be given as input to the visualizer
script. It is mostly the html of the "pipeline steps" Jenkins page
for a build, w... | 3.03125 | 3 |
questions/serializers/section.py | Ivin0022/django-questions | 0 | 12786100 | from rest_framework import serializers
# djangorestframework-recursive
from rest_framework_recursive.fields import RecursiveField
# local
from .question import QuestionSerializer
from ..models import Section
class SectionSerializer(serializers.ModelSerializer):
children = RecursiveField(required=False, allow_nu... | 2.1875 | 2 |
app/user/views.py | PythonDjangoJavascript/advanced_django_rest_api_with_tdd | 0 | 12786101 | from rest_framework import generics
from rest_framework import authentication
from rest_framework import permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from user.serializers import UserSerializser
from user.serializers import AuthTokenSerializer
... | 2.234375 | 2 |
adspygoogle/dfp/DfpWebService.py | hockeyprincess/google-api-dfp-python | 0 | 12786102 | <filename>adspygoogle/dfp/DfpWebService.py
#!/usr/bin/python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org... | 1.976563 | 2 |
github/types/headers.py | appheap/PyGithub | 1 | 12786103 | <filename>github/types/headers.py
from dataclasses import dataclass
from typing import Optional
from .object import Object
@dataclass
class Headers(Object):
allow_control_allow_origin: Optional['str']
access_control_expose_headers: Optional['str']
cache_control: Optional['str']
content_encoding: Opti... | 2.359375 | 2 |
utiles/__init__.py | steinvenic/escience | 1 | 12786104 | <reponame>steinvenic/escience<filename>utiles/__init__.py
#!/usr/bin/env python
# encoding: utf-8
"""
@version: python2.7
@author: ‘eric‘
@license: Apache Licence
@contact: <EMAIL>
@site: 00123.ml:8000
@software: PyCharm
@file: __init__.py.py
@time: 18/4/24 下午1:20
"""
| 0.957031 | 1 |
surrortg/inputs/input.py | SurrogateInc/surrortg-sdk | 21 | 12786105 | from abc import ABC, abstractmethod
from .input_config import assert_on_screen_position, convert_enums_to_values
class Input(ABC):
"""Base class for all user inputs
Read more about defaults from input_config.py
"""
def __init__(self, defaults=None):
if defaults:
self.validate_de... | 3.875 | 4 |
geoportal/tests/functional/test_dbreflection.py | rbovard/c2cgeoportal | 43 | 12786106 | <reponame>rbovard/c2cgeoportal
# Copyright (c) 2013-2019, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, ... | 1.234375 | 1 |
icebook/apps/users/forms.py | RohanJnr/IceBook-social_media-django- | 19 | 12786107 | from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import CustomUser, Profile
class CustomUserCreationForm(UserCreationForm):
class Meta:
model = CustomUser
fields = ("first_name", "last_name", ... | 2.5625 | 3 |
src/project/urls.py | jmaslanka/movie-db | 0 | 12786108 | from django.contrib import admin
from django.urls import path, include
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='Movie DB API',
default_version='v1',
description='API to ... | 1.929688 | 2 |
WHI_long_term_detectable_notch_vs_VED_plotting.py | annahs/atmos_research | 2 | 12786109 | import sys
import os
import pickle
import math
import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
os.chdir('C:/Users/<NAME>/Documents/Data/WHI long term record/coatings/')
file = open('fraction of detectable notch positions by BC core size - aged.pickl', 'r')
fractions_detectable_aged = pick... | 2.390625 | 2 |
flask1/flask1.py | fangxian/flask_exercise | 0 | 12786110 | <gh_stars>0
from flask import Flask, flash, render_template, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from forms import RegisterForm, LoginForm, EditArticleForm
from flask_login import login_user
from datetime import datetime
import pymysql
from flask_bootstrap import Bootstrap
app = Flask(__name__)
a... | 2.65625 | 3 |
app/vulnerability/routes.py | sbs2001/vulncode-db | 1 | 12786111 | <gh_stars>1-10
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 1.757813 | 2 |
implicit_emulators/implem/data/data.py | m-dml/lil2021swe | 1 | 12786112 | import numpy as np
import torch
import pytorch_lightning as pl
from torch.utils.data import DataLoader
from implem.utils import device
class SimpleDataset(torch.utils.data.Dataset):
def __init__(self, data, offset=1, start=None, end=None):
super(SimpleDataset, self).__init__()
assert len(data.shap... | 2.71875 | 3 |
test_project/forms.py | ebenh/django-flex-user | 1 | 12786113 | <gh_stars>1-10
from django import forms
from django.utils.text import capfirst
from django.contrib.auth import get_user_model, password_validation
from django.core.exceptions import ValidationError
from django_flex_user.models.otp import TimeoutError
UserModel = get_user_model()
class OTPTokensSearchForm(forms.Form... | 2.4375 | 2 |
core/config/__init__.py | tangchengdong/tang_project | 1 | 12786114 | # -*- coding:utf8 -*-
"""读取配置文件信息"""
import os
import yaml
BASEPATH = os.path.dirname(__file__)
def dbConfig():
data = open(os.path.join(BASEPATH, 'db.default.yaml'), 'r')
dict = yaml.load(data)
data.close()
return dict
if __name__ == '__main__':
print(dbConfig()) | 2.59375 | 3 |
vilya/models/elastic/searcher.py | mubashshirjamal/code | 1,582 | 12786115 | <filename>vilya/models/elastic/searcher.py
# -*- coding: utf-8 -*-
from vilya.libs.search import code_client
class SearchEngine(object):
c = code_client
if not c.head():
c.put('')
@classmethod
def check_result(cls, result):
if result and not result.get('error'):
return T... | 2.1875 | 2 |
src/inworldz/maestro/environment/CredentialCrypt.py | IslandzVW/maestro | 3 | 12786116 | '''
Created on Jan 3, 2014
@author: <NAME>
'''
from Crypto.Cipher import AES
import base64
# the block size for the cipher object; must be 16, 24, or 32 for AES
BLOCK_SIZE = 32
BLOCK_SZ = 14
# the character used for padding--with a block cipher such as AES, the value
# you encrypt must be a multiple of BLOCK_SIZE i... | 3.8125 | 4 |
getwpuser.py | galletitaoreo/PythonPentest | 5 | 12786117 | #coding=utf-8
import sys
import urllib
import httplib
import re
import urlparse
#import requests
count = 100
#httplib.HTTPConnection.debuglevel = 1
def savefile(text):
pass
def checktitle(target):
i = 1
for i in range(count):
url='http://' + target + '/?author=%s' % i
pattern='<ti... | 2.71875 | 3 |
UVa 10424 love calculator/sample/main.py | tadvi/uva | 1 | 12786118 | import sys
import re
sys.stdin = open('input.txt')
while True:
try:
s1 = raw_input().strip()
s2 = raw_input().strip()
except:
break
t1 = sum(ord(c) - ord('a') + 1 for c in re.findall('[a-z]', s1.lower()))
while t1 >= 10:
t1 = sum(int(c) for c in str(t1))
t2 = sum(ord... | 3.109375 | 3 |
mobycity/news/models.py | LucienD/Mobct | 0 | 12786119 | #coding:utf-8
from django.db import models
from django.utils import timezone
from djangocms_text_ckeditor.fields import HTMLField
class News(models.Model):
creation_datetime = models.DateTimeField(default=timezone.now, verbose_name=u'Date de création')
update_datetime = models.DateTimeField(default=timezone.... | 2.046875 | 2 |
dj_generatortools/stubbs/default/views.py | weholt/django-generation-tools | 0 | 12786120 | <gh_stars>0
from django.contrib.auth.decorators import login_required
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator
from django.views.generic import ListView
from django.views.generic.detail import Detai... | 2.171875 | 2 |
boot.py | dlizotte-uwo/matrixportal-messageboard | 0 | 12786121 | <filename>boot.py
import board
from digitalio import DigitalInOut, Direction, Pull
up_button = DigitalInOut(board.BUTTON_UP)
up_button.direction = Direction.INPUT
up_button.pull = Pull.UP
if not up_button.value:
import storage
storage.remount("/", False)
led = DigitalInOut(board.L)
led.direction = Dire... | 3.015625 | 3 |
utils/label_broadcast.py | Jo-wang/LDBE | 7 | 12786122 | import torch
import torch.nn as nn
def label_broadcast(label_map,target):
# label_map is the prediction output through softmax operation
N, C, W, H = label_map.shape
# label_map = label_map.softmax(dim=1)
new_label = label_map.clone()
mask = (target.unsqueeze(1) != 255).detach()
new_... | 2.734375 | 3 |
Find Digit.py | joel-razor1/HackerRank_Problem_Solving | 1 | 12786123 | import math
import os
import random
import re
import sys
# Complete the findDigits function below.
def findDigits(n):
cnt=0
a=[int(i) for i in str(n)]
print(a)
for i in range(0,len(a)):
if a[i]!=0:
if n%a[i]==0:
cnt=cnt+1
else:
cnt=cnt+0
return ... | 3.515625 | 4 |
scripts/generate_aruco_mesh.py | hubertbraszko/follow-marker | 3 | 12786124 | <reponame>hubertbraszko/follow-marker
#!/usr/bin/env python
# import the necessary packages
import rospy
import rospkg
import numpy as np
import cv2
import sys
import os
# import debugpy
# debugpy.listen(("localhost", 5678))
# debugpy.wait_for_client() # optional, blocks execution until client is attached
# Get pac... | 2.125 | 2 |
homogen.py | Gkdnz/SfePy | 0 | 12786125 | <reponame>Gkdnz/SfePy
#!/usr/bin/env python
from optparse import OptionParser
import sfepy
from sfepy.base.conf import ProblemConf, get_standard_keywords
from sfepy.homogenization.homogen_app import HomogenizationApp
usage = """%prog [options] filename_in"""
help = {
'filename' :
'basename of output file(s) ... | 2.40625 | 2 |
sklearn_fine_tuning.py | dropofwill/author-attr-experiments | 2 | 12786126 | <reponame>dropofwill/author-attr-experiments
import numpy as np
import os
import time as tm
from sklearn import datasets
from sklearn.cross_validation import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.naive_bay... | 2.28125 | 2 |
Plugins/Classes/Ship.py | bvbohnen/X4_Customizer | 25 | 12786127 | <reponame>bvbohnen/X4_Customizer
from .Macro import Macro
from .Connection import Connection
from .Component import Component
from .Storage import Storage
from Framework import File_System
from .Shared import Physics_Properties
__all__ = [
'Ship',
]
class Ship(Macro, Physics_Properties):
'''
Ship ma... | 2.625 | 3 |
student_sys/student/migrations/0001_initial.py | timTianWSRF/student_management | 0 | 12786128 | # Generated by Django 2.2.3 on 2019-07-22 13:33
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Student',
fields=[
('id', models.AutoField(... | 2 | 2 |
api/api_endpoints/model/posts_system/posts_system_models.py | albcristi/TheHub | 0 | 12786129 | <filename>api/api_endpoints/model/posts_system/posts_system_models.py
from django.db import models
from ...models import AppUsers
class Posts(models.Model):
"""
A post is created by a user and
is used in order for a user to
share its thoughts and emotions
"""
post_id = models.Aut... | 2.796875 | 3 |
dev/tools/pqrne/wanderlust.py | gusugusu1018/simmobility-prod | 50 | 12786130 | #!/usr/bin/env python
# Copyright (2012) Singapore-MIT Alliance for Research and Technology
import math
from PyQt4 import QtGui, QtCore
from paper import Tracing_paper
from digital_map import Lane_marking, Kerb_line, Road_section
from network import Lane_edge
from point import Point, nearest_point, re_arrange_co_lin... | 2.703125 | 3 |
icekit/content_collections/page_type_plugins.py | ic-labs/django-icekit | 52 | 12786131 | <filename>icekit/content_collections/page_type_plugins.py
from django.conf.urls import patterns, url
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from icekit.page_types.layout_page.admin import LayoutPageAdmin
from icekit.plugins import ICEkitFluentContentsPagePlugin
class Li... | 1.882813 | 2 |
hood/views.py | Ianodad/Hoodwatch | 0 | 12786132 | from django.shortcuts import redirect, render, get_object_or_404
from .forms import ProfileForm, Hoodform, BusinessForm, PostForm
from django.contrib.auth.decorators import login_required
from .models import Hood, Profile, Business, Post
from urllib import request
from django.db.models import Q
# Create your views he... | 2.15625 | 2 |
xpmig_migrate.py | kschets/XP_migrator | 1 | 12786133 | <filename>xpmig_migrate.py
#!/usr/bin/python
"""
####################################################################################################
TITLE : HPE XP7 Migration, Migrate
DESCRIPTION : Migrate the data to the new server
AUTHOR : <NAME> / StorageTeam
VERSION : Based on previous ODR framework
1... | 1.734375 | 2 |
Beginner/AdultAge.py | man21/IOSD-UIETKUK-HacktoberFest-Meetup-2019 | 22 | 12786134 | # Code for Adult age
# By Ebuka
import re
age = input("Enter your age")
try:
int_age = int(age)
except TypeError:
raise TypeError("Age is not valid")
if int_age >= 18:
print("Access granted")
else:
print("Access Denied") | 4.03125 | 4 |
rexR-V1.0.5-release/x86_attack/tools.py | t3ls/rex-r | 1 | 12786135 | <gh_stars>1-10
import os
from pwn import *
class tools():
def __init__(self, binary, crash):
self.binary = binary
self.crash = crash
self.core_list = filter(lambda x:"core" in x, os.listdir('.'))
self.core = self.core_list[0]
def gdb(self, command):
popen=os.popen('gdb ... | 2.15625 | 2 |
Source/AItetris.py | BSAA0203/AI_Tetris | 0 | 12786136 | import pygame as pg
import random, time, sys
import copy,numpy,pyautogui,math
# Define settings and constants
pyautogui.PAUSE = 0.03
pyautogui.FAILSAFE = True
# 게임 가로 세로 사이즈
WINDOWWIDTH = 800
WINDOWHEIGHT = 640
#블록 사이즈,가로,세로 길이
BOXSIZE = 30
BOXWIDTH = 5
BOXHEIGHT = 5
#보드 가로, 세로 길이
BOARDWIDTH = 10
BOARDHEIGHT = 20
... | 2.4375 | 2 |
setup.py | margulies/brainsvg | 0 | 12786137 | <filename>setup.py
from distutils.core import setup
setup(name='brainsvg',
version='0.0.1',
install_requires = ['numpy',
'gdist',
'nibabel',
'scipy',
'xml',
'pandas',
... | 1.203125 | 1 |
tpd_analyse/tpd.py | CatTheoryDTU/tpd-analyse | 0 | 12786138 | <gh_stars>0
"""
Main file for TPD analysis.
"""
import numpy as np
from glob import glob
from pprint import pprint
import os, sys
from scipy.optimize import curve_fit, least_squares, minimize
from tpd_analyse.tools.parser_class import experimentalTPD
import mpmath as mp
from mpmath import mpf
from ase.thermochemistr... | 2.4375 | 2 |
Script/PostProcessMain.py | hkujy/LinJuanJuan | 0 | 12786139 | """
main entry of post process results data and plot
"""
import PlotHeatMap
import PostProcessDataFuns as psf
import PlotOperatorConverge
import para
import PlotGantt
# root_folder = r"C:\Users\phdji\OneDrive - Danmarks Tekniske Universitet\JuanJuanLin\Tests2022/"
# root_folder = r'C:/GitCodes/Res/'
# root_folde... | 2.171875 | 2 |
italian_csv_type_prediction/simple_types/plate_type.py | LucaCappelletti94/italian_csv_type_prediction | 0 | 12786140 | <reponame>LucaCappelletti94/italian_csv_type_prediction<filename>italian_csv_type_prediction/simple_types/plate_type.py
from ..utils import normalize
from .regex_type_predictor import RegexTypePredictor
from .string_type import StringType
class PlateType(StringType):
def __init__(self):
"""Create new Pla... | 2.625 | 3 |
src/tests/test_bacon_with_eggs.py | lipegomes/rp-tdd-pytest | 0 | 12786141 | """
TDD - Test Driven Development
"""
import unittest
from src.base.bacon_with_eggs import bacon_with_eggs
class TestBaconWithEggs(unittest.TestCase):
def test_bacon_with_eggs_assertion_error_do_not_receive_int(self):
with self.assertRaises(AssertionError):
bacon_with_eggs('')
def test_... | 4 | 4 |
appengine_config.py | lemmings-io/facebook-messenger-google-app-engine | 4 | 12786142 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
`appengine_config.py` is automatically loaded when Google App Engine
starts a new instance of your application. This runs before any
WSGI applications specified in app.yaml are loaded.
"""
from google.appengine.ext import vendor
# Third-party librari... | 1.804688 | 2 |
urls.py | fightingfish008/tornado-extensions | 5 | 12786143 | <reponame>fightingfish008/tornado-extensions<filename>urls.py
# -*- coding:utf-8 -*-
from libs.handler import ErrorHandler
from libs.decorators import route
from handlers import extensionCheck, systemInfo, celerySendSms
handlers = []
# add xxxx handlers
handlers.extend(extensionCheck.handlers) # app 版本相关功能
handlers... | 1.984375 | 2 |
DCT/Noisy.py | Satjpatel/Digital-Image-Watermarking-and-Its-FPGA-Implementation | 0 | 12786144 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 6 23:59:38 2021
@author: <NAME>
"""
# Adding Salt and Pepper Noise to image
import cv2 as cv
import numpy as np
import random
# Adding salt and pepper noise
def gaussian_noise(image):
row = 512
col = 512
mean = 0
var = 0.1
sigma = var**... | 3.390625 | 3 |
setup.py | gillenbrown/prettyplot | 3 | 12786145 | from setuptools import setup, find_packages
setup(
name="betterplotlib",
version="1.5.0",
description="Some wrappers for matplotlib to make plotting easier and nicer.",
long_description="This module contains wrapper functions for matplotlib. A lot of the matplotlib plots are ugly and not easy to make, so I wrote... | 1.609375 | 2 |
setup.py | neuro-inc/neuro-extras | 2 | 12786146 | <reponame>neuro-inc/neuro-extras<filename>setup.py<gh_stars>1-10
import re
from setuptools import find_packages, setup
with open("neuro_extras/version.py") as f:
txt = f.read()
try:
version = re.findall(r'^__version__ = "([^"]+)"\r?$', txt, re.M)[0]
except IndexError:
raise RuntimeError("... | 1.914063 | 2 |
gs/group/messages/post/text/postbody.py | groupserver/gs.group.messages.post.text | 0 | 12786147 | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2012, 2013, 2014, 2015 OnlineGroups.net 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 ... | 1.585938 | 2 |
supersqlite/third_party/_apsw/tools/docmissing.py | plasticity-admin/supersqlite | 1,520 | 12786148 | <reponame>plasticity-admin/supersqlite<filename>supersqlite/third_party/_apsw/tools/docmissing.py
# python
#
# See the accompanying LICENSE file.
#
# Find things that haven't been documented and should be or have been
# but don't exist.
import glob, sys
import apsw
retval=0
classes={}
for filename in glob.glob("do... | 2 | 2 |
configs/conf_exp.py | baimengwei/Traffic-Flow-Test-Platform | 2 | 12786149 | <reponame>baimengwei/Traffic-Flow-Test-Platform<gh_stars>1-10
class ConfExp:
def __init__(self, args):
self.__model_name = args.algorithm
self.__train_round = args.train_round
self.__num_generators = args.num_generator
self.__num_pipeline = args.num_pipeline
@property
def NU... | 2.375 | 2 |
target/apps.py | groundupnews/gu | 19 | 12786150 | from django.apps import AppConfig
class TargetConfig(AppConfig):
name = 'target'
| 1.15625 | 1 |